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

fix translation installation for locales with script name #2565

Merged
merged 1 commit into from Oct 8, 2021

Conversation

ultrabug
Copy link
Member

@ultrabug ultrabug commented Sep 8, 2021

when a locale like zh_CN is parsed by babel.core.Locale, the
result Locale is zh_Hans_CN which is then used to find out if
translations exist for this locale name

the Hans part is the guessed script name part of the babel Locale
but is almost never contributed as translation locale name so
we have to make sure what we look for the language + territory
locale name instead of the fully parsed name from babel

when a locale like zh_CN is parsed by babel.core.Locale, the
result Locale is zh_Hans_CN which is then used to find out if
translations exist for this locale name

the Hans part is the guessed script name part of the babel Locale
but is almost never contributed as translation locale name so
we have to make sure what we look for the language + territory
locale name instead of the fully parsed name from babel
@ultrabug
Copy link
Member Author

ultrabug commented Sep 8, 2021

With this + #2564 we will be able to support zh_CN language

@prcr
Copy link

prcr commented Sep 8, 2021

Good one, I was thinking of proposing this functional approach on #2564 to solve the issue of the pt_BR translation in #2535. 👍

@ultrabug
Copy link
Member Author

ultrabug commented Oct 8, 2021

@oprypin please consider this PR for the upcoming release, it is safe and future proof IMHO

@ultrabug ultrabug merged commit 0937f7d into mkdocs:master Oct 8, 2021
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 this pull request may close these issues.

None yet

3 participants