joel16 / NX-Shell

A multi-purpose file manager for the Nintendo Switch.
GNU General Public License v2.0
947 stars 64 forks source link

Add a Multi-language support and Chinese language support #86

Closed tiansongyu closed 3 years ago

tiansongyu commented 3 years ago

I changed some code and you can merge it after you clean up the code by your code style :) I have success to build it, so the code is fine. The app is amazing ,I hope my work can help you to complete the app. I have add some annotation in this code to help you to change the code. And you can just change a few code to add a new language !!! (after you read the code)

There is a matter I want to let you know two choices to set up the default language 1.set the language by the machine language that the user use(auto to select the language) 2.set the language by the user manual ( manual to select ) (use the config.json to save the option language )

I choose the 1 option . any way . you can use your way to set language

Finally , my code is sucks ,I hope you can forgive me :D
have a good day !!!

joel16 commented 3 years ago

Hey I appreciate the idea for this but unfortunately there's a lot of things here that aren't consistent with my style of coding. Like for example I don't think loading strings from json is a good idea. We can easily eliminate using IO by simple including a header will all the strings. I can try working on this at some point when I get more free time. I appreciate the time and effort you put into this, and it is indeed a great idea to add multiple languages. If you want I can use your strings for Chinese (with your permission) and I can credit you for it when I can finish my implementation.

tiansongyu commented 3 years ago

Of course,you can change the code by your way , It's my pleasure to do something helpful for people. Do it ! :)

joel16 commented 3 years ago

Hi, I'm going to close this because I came up with my own implementation for language support that does not rely on external files. Thank you for giving me the idea. If you don't mind could you make a new fork with the latest changes and replace the English strings with Chinese here? https://github.com/joel16/NX-Shell/blob/next/source/language.cpp#L406-L471

Once it's done you can replace "// TODO: Simplified Chinese ("Chinese")" with "// Simplified Chinese ("Chinese")"