Anniversary Edition/Installer/Localization: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(Created page with "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...")
 
m (wording)
Line 1: Line 1:
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 a string name and then the contents of that string. For instance, this line in MainWin.properties:
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
  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 that follows, when the AEI is running in English. For the German localization, this same line says:
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
  menu.runOniFullTooltip=Starte Oni im Vollbildmodus
As you can see, the name of the string is always the same.
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 [[wikipedia:ISO_639-1|ISO abbreviation]] for "German". (The original English files do not use a locale suffix.)
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 [[wikipedia:ISO_639-1|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 file, so in order to translate strings from their original English, you have to get the properties files from the AEI source code. Click [http://websvn.chrilly.net/listing.php?repname=Oni2&path=%2Fjava%2Finstaller2%2Fsrc%2Fnet%2Foni2%2Faeinstaller%2Flocalization%2F& here] to see the source directory that contains the English localization files.
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 [http://websvn.chrilly.net/listing.php?repname=Oni2&path=%2Fjava%2Finstaller2%2Fsrc%2Fnet%2Foni2%2Faeinstaller%2Flocalization%2F& 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.
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:
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
  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 [[User:Admin|Alloc]].
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 [[User:Admin|Alloc]].


[[Category:Anniversary Edition]]
[[Category:Anniversary Edition]]

Revision as of 16:18, 27 March 2016

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.