OrchardCore: BUG: 'zh' localization directory not exist
Describe the bug
To Reproduce
Steps to reproduce the behavior:
- when my chrome broswer language is ‘中文(简体)’, the
CurrentUICulturefield value iszh, - then ModularPoFileLocationProvider() can’t find the
zhlocalization dir. because it is not existed. - so the website always display
en-USculture.
Expected behavior
show Chinese properly
Screenshots

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 98 (97 by maintainers)
Okay interesting, and I assume you also added in the admin settings
zh-Hans-CNin the supported cultures and not marked as the default culture, as you mentioned, right?Okay but with the exact same configuration, in my case when putting a break point in the alias middleware the current culture is
en-US, I can getzhif I add it to the supported cultures in the admin settings, but neverzh-CNthat I can’t add in the settings, so no mapping is done on my side.Can you show your admin culture settings? Did you save them, maybe
zh-CNis still in the database document. Would be good to put a breakpoint in the module startup to see what is added in the supported cultures, just try to understand how it can select a culture which is not in the supported cultures.Thanks for trusting me 😉 But even if it works for someone else, it will not magically start to work on my machine.
The Translation repository is now updated:
https://sites.psu.edu/symbolcodes/languages/asia/chinese/
I added the custom languages on crowdin: https://crowdin.com/project/orchard-core/zh-hans-cn https://crowdin.com/project/orchard-core/zh-hant-tw but there is no such thing than “renaming” a culture into another one.
A mitigation is to set this ENV:
DOTNET_SYSTEM_GLOBALIZATION_USENLS=1Then thezh-CNwill appear in the list.I notice that too
I totally agree with @hyzx86, that’s what I mentioned earlier here
in my submission… All the billions of browsers in China should be
zh-CN🤣BTW I think you did the following fallback
https://github.com/OrchardCMS/OrchardCore/blob/083d5d7f9885b6ba034f642259cb94326af9e551/src/OrchardCore/OrchardCore.Localization.Core/DefaultPluralRuleProvider.cs#L66-L78
Right?
rename the directory can resolve it, but There are same problems in macos and windows 10. so i suguest to add
zhdir toOrchardCore.Translationsrepo, or add some codes to enhance it. (^_^)