julkascript / cardflow

The open-source Trading Card Game market
MIT License
10 stars 4 forks source link

Implement internalization #126

Closed RyotaMitaraiWeb closed 5 days ago

RyotaMitaraiWeb commented 5 days ago

Closes #115

This PR introduces the ability to switch languages, as well as translations for most of the, if not the entire, application.

General Notes

Translation files Translation files are stored in src/translation/{language} as .json files, where {language} is any of our supported languages. The files are split as follows:

Note: occassionally, stuff like table headers, which happen to be the same across multiple pages, are still translated within their page files and are not extracted in common.json, this is mostly because I'd rather avoid accidental side effects if we decide we want to change the specific translation and do not intend to do it globally.

Change language menu As mentioned in #115, the menu's implementation is temporary for now. For new users, the menu will detect the browser language and select the translation (and therefore corresponding option) automatically. After that, the menu will appropriately save the user's preference (if they decide to change it)

Although I mentioned that the mobile variant will implement the menu with a native select, it turns out that there are several limitations to the component such as that my mobile wireframe will prove impossible to implement, so the mobile variant for now is also a standard dropdown menu

Other notes

Let me know if I missed any translation

julkascript commented 5 days ago

I appreciate the hard work and initiative. Looks really good! I spot a few typos here and there but they will be fixed another time when we do a deeper UI review.