UmbraSpaceIndustries / USI-LS

USI Life Support
Other
65 stars 47 forks source link

Localization support #295

Closed tinygrox closed 4 years ago

tinygrox commented 4 years ago

I localized the parts and the user interface

tinygrox commented 4 years ago

And I'm also localizing the MKS

tjdeckard commented 4 years ago

A few notes:

tinygrox commented 4 years ago

A few notes:

  • This PR makes changes to the .csproj file that will probably mess with the build scripts. Please exclude the .csproj from the PR.
  • I think we would prefer that things like color tags not be included in the localization .cfg files. Is there a reason you moved them into the .cfg files vs. leaving them in code?

Thanks for the notes. And I really dont know how to exclude the .csproj files.is there any guide for this?Tell me pls.

tinygrox commented 4 years ago

Now it is changed.

tjdeckard commented 4 years ago

Almost there! It looks like one color tag is still remaining in the Chinese localization file. It's near the top of the file, #LOC_USILS_EVATimeExpired.

tinygrox commented 4 years ago

Done. But I still don't know how to exclude the .csproj file

tjdeckard commented 4 years ago

The .csproj file needs to remain in the repo. Your original commit had made changes to the file though that needed to be excluded from the PR. It looks like you fixed that with commit 63da4f4, so as far as I can tell, the PR is in good shape now.

If you're wondering how to avoid making inadvertent changes to the .csproj in future commits... that can be a bit tricky. The primary issue is that the .csproj file includes "hints" that tell Visual Studio where to find externally referenced DLLs (like the Unity DLLs, KSP DLLs, USITools, etc.). It saves these hints as relative paths. So if the folder structure on your computer doesn't match the folder structure that the original developer used on their computer, Visual Studio will show that all the references are missing. If you then update the references to where they're located on your computer and upload those in a PR, then all the references will go missing on the original developer's computer.

The way I handle this is to setup folders on my computer so that they match the folder structure expected in the .csproj file. All of the USI projects are setup the same way, so you only have to setup the folder structure once. This isn't necessarily true for all KSP mods though. So there isn't a "one size fits all" solution to this problem.

An alternative is to just not add the .csproj file when you make a commit. This is probably the simplest solution if you're just updating existing code files. If you're using a GUI Git client like GitHub Desktop, GitKraken, etc. then just un-check the box next to the .csproj file before making your commit. If you use Git from the command line, then it's a little more annoying (but if you're using git from the command line then I kinda expect you to know how to exclude individual files from a commit ;-) ). You can also setup git exclude rules on a per repository basis to exclude the .csproj file from your commits. That's also sort of tricky to setup though. These alternatives also only work if you're making changes to existing files. If you create a new .cs file, that will be reflected in the .csproj file and that will need to be included in your PR otherwise it will be missing when the original developer tries to load in your changes.

tjdeckard commented 4 years ago

That last commit (83dd3f9) looks like it may be a regression.

tinygrox commented 4 years ago

......

tinygrox commented 4 years ago

I will find another time.