nulastudio / NetBeauty2

Move a .NET Framework/.NET Core app runtime components and dependencies into a sub-directory and make it beauty.
MIT License
419 stars 21 forks source link

Support for ResX localization! #10

Closed da3dsoul closed 4 years ago

da3dsoul commented 4 years ago

explorer_2020-08-10_06-42-10 As you can see, ResX generates language code folders which have additional DLLs inside them. According to this, they are loaded in the same way that this does, so simply putting them inside the libraries folder would clean it up nicely.

EDIT: I noticed that it gets some of the files, but not all of them.... I wonder why....

da3dsoul commented 4 years ago

explorer_2020-08-10_06-59-52 That's what's left. It got Microsoft DLLs.

da3dsoul commented 4 years ago

It appears to take runtimepack.Microsoft.WindowsDesktop.App.Runtime runtimes and add .resources.dll to them. Unfortunately, the deps,json doesn't seem to list them.

da3dsoul commented 4 years ago

The dirty solution would be to check for the existence of these folders, see if they contain nothing but DLLs and move them. I just dumped all possible language codes from netcore. lang.txt

liesauer commented 4 years ago

NetCoreBeauty analyses deps.json to detemine which should be moved. if they aren't moved, they must be not included in deps.json.

liesauer commented 4 years ago

but those files should be listed in deps.json. btw could you upload a test case?

da3dsoul commented 4 years ago

I'll see if I can make one. This particular project is 14 years old and been through a lot of changes.

da3dsoul commented 4 years ago

https://github.com/da3dsoul/LocalizationTest There you go. Verified. I noticed that for some reason, it creates a bunch of folders for cultures that aren't even supported.

liesauer commented 4 years ago

it looks like only the app's localization resources are listed in the deps.json. the libraries's localization resources aren't listed for some reason.

da3dsoul commented 4 years ago

Yeah, that's why I mentioned the "dirty solution". Ideally, those would be listed, but ideally, this project wouldn't need to be so complex to work.

liesauer commented 4 years ago

you are right, there is no need to generate those localization that we don't use at all. i will try re-adding those resources back to deps.json and see if the app still can read those localization strings. in theory, this should work.

liesauer commented 4 years ago

try the latest v1.2.9

da3dsoul commented 4 years ago

No change. I notice the build failed, as well, and that appears to be a deployment failure.

liesauer commented 4 years ago

No change. I notice the build failed, as well, and that appears to be a deployment failure.

ignore the build. are you using Nuget? you need to upgrade the package.

<PackageReference Include="nulastudio.NetCoreBeauty" Version="1.2.9" />
da3dsoul commented 4 years ago
Screenies! ![rider64_2020-08-14_09-08-30](https://user-images.githubusercontent.com/5205810/90252732-fedc1a00-de0d-11ea-966a-db0073170522.png) ![explorer_2020-08-14_09-09-08](https://user-images.githubusercontent.com/5205810/90252992-70b46380-de0e-11ea-95da-3d0e62c7ae1c.png) ![explorer_2020-08-14_09-09-17](https://user-images.githubusercontent.com/5205810/90253000-74e08100-de0e-11ea-9fbd-601d2664614f.png)

To show how I have it set up. I then publish with dotnet publish -c Release -r win10-x64 -p:PublishTrimmed=false

EDIT: Apparently it doesn't want to format that as code. Probably an issue with the details (collapsible) tag

liesauer commented 4 years ago

have you beauty this project before?( check if this is a file called NetCoreBeauty). if so, you need to set <ForceBeauty></ForceBeauty> to True, because NetCoreBeauty only beauty once.

da3dsoul commented 4 years ago

I deleted the build folder prior. Is it kept anywhere else?

liesauer commented 4 years ago

entire bin folder?

da3dsoul commented 4 years ago

Yes, though I didn't delete obj

liesauer commented 4 years ago

could you set <BeautyLogLevel></BeautyLogLevel> to Info and see what output?

liesauer commented 4 years ago

btw, could you upload your release?

da3dsoul commented 4 years ago

Found the issue. If I set <BeautyExcludes>Shoko*.dll</BeautyExcludes> it doesn't clean up the rest

liesauer commented 4 years ago

you need to set more specific rule.

da3dsoul commented 4 years ago

It also wasn't needed. It works, thanks