-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Expose standardized locales with added defaults #11119
Comments
This is based on the way different OSes and Godot editor translation files name locales. Practically, translation for |
I completely understand why it's done that way. Tons of locales are going to be ambiguous. What I'm asking is for Godot to expose the way that it handles that ambiguity since it's a black box right now. How would I know |
I'm not familiar with this area. I've only seen Wikipedia use For game translations, I think using |
Actually, |
Describe the project you are working on
The Block Coding plugin.
Describe the problem or limitation you are having in your project
When trying to add translations, it seems that the OS locale was being handled in surprising ways that would cause the wrong translations to be chosen. I think I've figured out the solution to that, but it would have been nice to see more detail about how Godot has handling the input locale string.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
TranslationServer::compare_locales uses locales standardized with additional defaults that make the results surprising. For example, comparing
zh
andzh_CN
is reported as an exact match because both locales get converted tozh_Hans_CN
. I ran into this while working on godotengine/godot#98743.It would be nice if these standardized locales with added default were exposed through TranslationServer::standardize_locale. In other words, add a second parameter
add_defaults: bool = false
. That would allow users to see how actually Godot treats partial or even seemingly fully specified locales.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
Mostly it's informational. You could work around the issue of the wrong locale being set by building up some heuristics and calling
TranslationServer.set_locale()
for specific cases that you know would work incorrectly. However, even then it would be nice to see ifTranslationServer.standardize_locale()
changed when adding defaults. If there was no difference between the two cases when passing in the OS locale, then you would know that Godot was already going to do what you'd expect.Is there a reason why this should be core and not an add-on in the asset library?
The purpose is to expose details about the core locale implementation. You can't do that in an add-on.
The text was updated successfully, but these errors were encountered: