Closed TheDuriel closed 4 years ago
This would for example allow language selection screens to fetch multiple variants of the same key, avoiding some of the usual hardcoded effort involved with setting them up.
Language names in language selection screens should generally not be translated, otherwise people might not be able to understand them at all :slightly_smiling_face: Just write them in the language as-is (e.g. Français
for fr
).
Debatable, if the consumer does not speak English, displaying the name of their language in English will often not help. Even more so when they use a different script altogether. (Russia, China, Japan, etc.)
Language eccentric projects, like educational software, can also benefit here. Having the ability to display the same text in multiple languages is a vital feature for most of them.
Basically the idea is to allow this:
var english_text = tr("key1") # the active locale is english
var french_text = tr("key1", fr_FR) # optional argument
@TheDuriel I was saying you should write the name of the language in the language that will be translated to if you select the option, regardless of the current language.
There's a hack for that. In my app I made a generic language name word, which originally is English and then translated to other languages as that language (so e.g. English in German is translated as Deutsch). The code to make it work is this:
for i in language_list.size():
TranslationServer.set_locale(language_list[i])
$LanguageContainer/LanguageList.add_item(tr("English") + "")
Not sure if we need the original proposal, depending on how much it's needed. Especially since the workaround exists.
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!
Feature Request: I would like an optional argument in TranslationServer.translate(), to allow specifying a locale to pull from that is not currently active. This would for example allow language selection screens to fetch multiple variants of the same key, avoiding some of the usual hardcoded effort involved with setting them up.
Another cool thing this would make possible, is to allow "conlangs" to be loaded in an otherwise unused or custom locale, so you could keep the original and translated versions in the same system. Think of Twilight Princesss Hylian Script being displayed alongside the translated version. Instead of requiring you to hardcode the text, or fetch it from a separate file, the unicode/transliterated version could simply be stored in an separate, in your game unused, language.