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

Wrong language display name #171

Closed
Misaka-L opened this issue Feb 18, 2024 · 0 comments · Fixed by #172
Closed

Wrong language display name #171

Misaka-L opened this issue Feb 18, 2024 · 0 comments · Fixed by #172

Comments

@Misaka-L
Copy link

Problem

I found that ndmf using the System.Globalizatio.CultureInfo api to get language display name.

try
{
return CultureInfo.GetCultureInfo(lang).NativeName;
}

But in some cases, it will return a wrong language display name. For example:

Debug.Log(new CultureInfo("zh-Hans").NativeName);
Debug.Log(new CultureInfo("zh-Hant").NativeName);
Debug.Log(new CultureInfo("zh").NativeName);

It will output:

中文
中文
中文

and the correct output should be like that:

中文(简体)
中文(繁體)
中文

Possible solutions

Required a language display name when register language instead of using System.Globalizatio.CultureInfo to get the language display name. But it may break other library which depend on this library.

And i found the modulat avatar already have a Dictionary which contains the correct language display name.

https://github.com/bdunderscore/modular-avatar/blob/0d4378764a434e6b2a2e74b021f8378a7b9c44fb/Editor/Localization/Localization.cs#L24-L29

bdunderscore added a commit that referenced this issue Feb 18, 2024
Also: Remove uncultured language names from language switcher when a
cultured variant is found

Closes: #171
Closes: #157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant