You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Texts specific to a level are not currently translatable, but they should be. Since the translations for Gettext (which TSC's C++ code uses) have to be supplied at compile-time, it is not possible to do this with Gettext.
I propose an SSL extension that allows such translation. An SSL script would be used to implement the actual translation "engine" (something simplistic suffices for starting out), and the level scripts could then use that translation engine. The core C++ API would only need an extension in so far as that the detected user locale needs to be provided to the scripts (e.g. via addition of a method TSC::locale()).
For the level authors, it could then look like this in the level script:
require"ssl/i18n"# Actual translation databaseI18n.setup_translationsdo |t|
t["en"].boxes.text.firstbox"This is the text for the first box"t["en"].boxes.text.secondbox"This is the text for the second box"t["de"].boxes.text.firstbox"Dies ist der Text für die erste Box"t["de"].boxes.text.secondbox"Dies ist der Text für die zweite Box"end# Find the objects to work withbox1=UIDS[45]box2=UIDS[923]# Attach the correct translation. The I18n::[] method calls TSC::locale() and# takes care of selecting the correct translation string matching the found locale.box1.text=I18n["boxes.text.firstbox"]box2.text=I18n["boxes.text.secondbox"]
The text was updated successfully, but these errors were encountered:
Another approach (that also requires more work) is to extend the level editor's UI. The settings page could gain a new tab "text translations", where it picks up any in-game text (i.e. text boxes) and allows translation of that text. The translations are then saved into the level XML.
If this approach is chosen, it needs to be considered that level authors still need access to translations from a level's script, in order to show messages depending on conditions that can only be expressed with scripting.
Texts specific to a level are not currently translatable, but they should be. Since the translations for Gettext (which TSC's C++ code uses) have to be supplied at compile-time, it is not possible to do this with Gettext.
I propose an SSL extension that allows such translation. An SSL script would be used to implement the actual translation "engine" (something simplistic suffices for starting out), and the level scripts could then use that translation engine. The core C++ API would only need an extension in so far as that the detected user locale needs to be provided to the scripts (e.g. via addition of a method
TSC::locale()
).For the level authors, it could then look like this in the level script:
The text was updated successfully, but these errors were encountered: