ServerPackCreator-Help Help

Translating ServerPackCreator

i18n in ServerPackCreator

If you wish to run ServerPackCreator with your locale (if it is already supported), you can either:

  1. Run java -jar ServerPackCreator-X.X.X.jar -lang your_locale for example java -jar ServerPackCreator-X.X.X.jar -lang en_GB. This will create the lang.properties-file with your specified locale.

  2. Running java -jar ServerPackCreator-x.x.x.jar without -lang en_GB or any other language will set the locale to en_us by default and create the lang.properties-file.

  3. Modify the serverpackcreator.properties-file in the same directory as ServerPackCreator-X-X-X.jar and set your locale like this lang=your_locale for example lang=en_GB

If you want to contribute translations to ServerPackCreator, check out the serverpackcreator-api/src/commonMain/i18n-directory containing already available translations to see how they are set up. Then, make your changes, test them, and open a pull request on GitHub according to the CONTRIBUTING.md.

Adding a translation

Say you want to translate ServerPackCreator to german. You would need to add the file Gui_en_GB.properties

In the english properties, you will see entries like

menubar.gui.menu.file=File menubar.gui.menu.edit=Edit menubar.gui.menu.view=View menubar.gui.menu.about=About menubar.gui.menu.help=Help

So, in order to translate them to german, in your Gui_en_GB.properties-file, you would add

menubar.gui.menu.file=Datei menubar.gui.menu.edit=Bearbeiten menubar.gui.menu.view=Ansicht menubar.gui.menu.about=Info menubar.gui.menu.help=Hilfe

Then, either in your serverpackcreator.properties set de.griefed.serverpackcreator.language=de_DE or launch ServerPackCreator with the argument -lang=de_DE.

Voila! The menubar will now have german translations!

Keep in mind when using languages other than en_GB: Any key not found in your currently set language will fall back to the english default.

Last modified: 11 August 2024