Anniversary Edition/Installer/Localization

From OniGalore
Jump to navigation Jump to search

To make localizing (translating into additional languages) easy, the AE Installer stores its text in a set of plain-text files with the suffix ".properties". Each line of each file has an identifying string name and then the contents of that string. For instance, this line in MainWin.properties:

menu.runOniFullTooltip=Run Oni in fullscreen mode

tells us that when the AEI wants to print the string "menu.runOniFullTooltip", it will use the text "Run Oni in fullscreen mode" when the AEI is running in English. For the German localization, this same line says:

menu.runOniFullTooltip=Starte Oni im Vollbildmodus

As you can see, the name of the string remains the same.

By providing new .properties files, the AEI will automatically use the translated phrases in that file if the .properties files' locale matches the computer's locale setting. The locale of the .properties file is indicated by a suffix in the name. For instance, the German translation above came from MainWin_de.properties; "de" is the official ISO abbreviation for "German". (The original English files do not use a locale suffix.)

For the default language, English, the .properties files are not accessible to the end user because they are built into the Installer executable, so in order to start translating strings, you should get the English .properties files from the AEI source code. Click here to see the source directory that contains the English localization files.

It's a good idea to make sure you know where the strings appear in the application, rather than translating blindly. For instance, despite its name, "menu.runOniFullTooltip", the sample string above will display when you hover over the "Run Oni (fullscreen)" button in the main window.

To test your translation, place your new .properties files, named with the correct ISO suffix, in the directory Oni/AE/AEInstaller/bin/locales/net/oni2/aeinstaller/localization/ (the files for German and any other supported languages should already be here). Now you have to tell the AE Installer to run in the language you're translating into. You either have to set your computer's locale to that language, or pass a language argument to the AEI on the command line; e.g., to run in German:

java -Duser.language=de -jar AEInstaller2.jar

There are about 1200 words to translate in order to make a new localization. When you have finished and want to get your .properties files added to the next release of the AE Installer, you should notify Alloc.