-
Notifications
You must be signed in to change notification settings - Fork 1
Adding a New Language
First, you need to create a file in assets/languages/ called [language-code].json.
The name doesn't really matter, so you can call it whatever you want.
For its data, copy this, and edit it with your translations.
Now, you need to edit the main text file, assets/languages/languagesList.txt, which just contains the data for your language(s).
To add your language into languagesList.txt, use this format:
Name (Country/Tag):save-tag
So, for example, if you wanted to add German, it would look like:
Deutsch (Deutschland):de
If you want to add a custom font to your language, add this field anywhere in your .json:
{
"customFont": "font"
}Also, make sure that your font actually exists before doing so.
You can also have your font be shown in the language selection menu.
Wherever your languages is in languagesList.txt, add this extra field:
Deutsch (Deutschland):de:germanFont
Like most functions, these can be accessed through scripting.
HScript:
Localization.switchLanguage('language-tag');Lua:
switchLanguage('language-tag');If that language is already selected, the change will not happen.
HScript:
Localization.get('key', 'language-tag');Lua:
getLangKey('key', 'language-tag');If the second parameter is empty, defaults to current language.
For further documentation, check out SimpleLocalization.