MartinDesrosiers / TopRunners

Play Toprunners, a classic 2D platformer video game based on Speedrun.
0 stars 0 forks source link

Translate the game in French #108

Closed MartinDesrosiers closed 6 years ago

MartinDesrosiers commented 6 years ago

We need to translate the scenes Main Menu, Level Selection, and the Level Editor. Patrick will create the function and I'll do the translation. We start only with the French version, but the system needs to allow other languages later.

Note: there was already a translation script for the Main Menu. We could reuse it or find a more global function. Ideally, all would be done in an xml external file for the translator.

Note: All the texts in the UI are already configured to stretch according to the text length. So translating the game won't have too much unintended visual impact

projettow2 commented 6 years ago

The french/english text is set with the UI_languageSelection componet set on the text field of a button or a label.

The modification is done directly on the UI_languageSelection instead of an XML file. However, it could be change if needed.

ss_ui_languageselection

Adding a new Language will be 3 simple steps.

  1. Add a text field in UI_languageSelection script.
  2. Add the new language name in the enum in the menuOptions script.
  3. Set the switch case in the UpdateLanguage function in UI_languageSelection script.

TODO On the GameManager init, we could load a file with the options set by the user.

TODO On change, save options in a file.

projettow2 commented 6 years ago

The issue is done.

Next step is to integrate it to a menu option.

projettow2 commented 6 years ago

Sent on branch menuOptions. Awaiting confirmation/merge to master to close it.