Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fetching translations from multiple languages at once #27971

Closed
TheDuriel opened this issue Apr 13, 2019 · 5 comments
Closed

Allow fetching translations from multiple languages at once #27971

TheDuriel opened this issue Apr 13, 2019 · 5 comments

Comments

@TheDuriel
Copy link
Contributor

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.

@Calinou
Copy link
Member

Calinou commented Apr 13, 2019

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 🙂 Just write them in the language as-is (e.g. Français for fr).

@TheDuriel
Copy link
Contributor Author

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

@Calinou
Copy link
Member

Calinou commented Apr 13, 2019

@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.

@akien-mga akien-mga changed the title allow fetching translations from multiple languages at once Allow fetching translations from multiple languages at once Apr 15, 2019
@KoBeWi
Copy link
Member

KoBeWi commented Jul 5, 2019

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.

@mhilbrunner
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants