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

Add a method to output the name of a locale in its language (instead of English) #2378

Open
toby3d opened this issue Feb 28, 2021 · 3 comments · May be fixed by godotengine/godot#78006
Open
Milestone

Comments

@toby3d
Copy link

toby3d commented Feb 28, 2021

Describe the project you are working on

Single and multiplayer quiz game.

Describe the problem or limitation you are having in your project

I have a menu screen with settings for the language of the game, including options to show subtitles, to switch the voiceover language and the text language separately. The problem is that TranslationServer.get_locale_name(locale) always returns the name of the imported locale in English. To get around this, I have to separately create a map of relationships between the code and its name in the language of that locale.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

To improve accessibility, instead of displaying any name in English, you should display the name of the locale in its language. Not all users know English and not all of them can recognize the name of their language in English.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Instead of bringing the names of languages to English:

  • English
  • Russian
  • Spanish
  • Turkish
  • Czech

It should be returned:

  • English
  • Русский
  • Español
  • Türkçe
  • Čeština

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes. Either on the part of the project developer via code map with the name bypassing get_locale_name method, or on the part of the engine developers by simply fixing the already implemented name strings, or by creating a separate method to get language name in locale language, so as not to break backward compatibility.

Is there a reason why this should be core and not an add-on in the asset library?

This is a small enough fix that does not break the existing engine logic and its results are quite common in games with support for additional localizations.

@Calinou
Copy link
Member

Calinou commented Feb 28, 2021

I thought we were already using translated locale names, but I just checked the Godot editor and they're all in English…

List

image

We need to replace all the English locale names with their translated variants, but this may be considered a breaking change. This means it'll likely have to wait for 4.0.

There are very few reasons for displaying all language names in the user's current language (on top of the burden it imposes on translators), so we might as well replace the original strings directly in the source code.

@Calinou Calinou added this to the 4.0 milestone Feb 28, 2021
@phil-hudson
Copy link

Bump on this, was there any resolution for 4.0?

@Calinou
Copy link
Member

Calinou commented Feb 6, 2023

Bump on this, was there any resolution for 4.0?

As far as I know, no contributor is currently working on this. Also, since 4.0 is in feature freeze, this will have to wait for a future 4.x release to be implemented. For compatibility reasons, this will require adding a new method such as TranslationServer.get_native_locale_name() instead of replacing the existing method.

I'm not currently working on this, so feel free to open a pull request for this if you wish 🙂

@Calinou Calinou modified the milestones: 4.0, 4.x Feb 6, 2023
@Calinou Calinou changed the title Output the name of a locale in its language Add a method to output the name of a locale in its language (instead of English) Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants