-
-
Notifications
You must be signed in to change notification settings - Fork 379
i18n
TShock supports the concept of multiple languages using GetText.NET
.
CI is automatically designed to build and push updated .po
files (the source for lang files) based on usage in TShock.
To use a localized string instead of a standard string, use GetString()
. For example, GetString("Invalid command!")
instead of "Invalid command!"
.
A test language file has been added that converts a limited number of phrases to Toki Pona, the language of good. To use this, you can set an environment variable called TSHOCK_LANGUAGE
set to tok
. For example, TSHOCK_LANGUAGE=tok dotnet run --project TShockLauncher
. Then, run the die
command.
The automatic .po
to .mo
compilation only works if you have msgfmt
installed (part of Git Bash, or part of gettext
itself). If you don't have this, when you run in debug mode, it will fail to compile the .mo
file in the i18n
folder. If this happens, you may want to download the latest artifacts from GitHub, and pull out the .mo
file(s) of choice and place them into the i18n
folder.
The base for the i18n system was built by Janet Blackquill (@pontaoski). A small donation in her honor was made to the KDE project as a thankyou for this work.
To help localize/internationalize TShock, you can contribute changes through Crowdin. Crowdin changes are merged in via @cardinal-system on GitHub automatically via pull-request. The current active language projects are: Chinese (Simplified), Russian, Russian (Ukraine), Spanish, Japanese, Turkish, German, French, French (Quebec), and Toki Pona. If you want a language project added, please notify someone in the TShock discord server to add it.