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

Merging similar languages on project level #3086

Closed
tariver opened this issue Oct 2, 2019 · 7 comments
Closed

Merging similar languages on project level #3086

tariver opened this issue Oct 2, 2019 · 7 comments
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@tariver
Copy link

tariver commented Oct 2, 2019

I have a project with two components.
First is a desktop application written in C# and it has it's localization files in language-country format - ru-RU.lang / en-US.lang / de-DE.lang
Russian is the base language

Second is a web application with Java properties files and it's localization uses i10n/language-code/default.properties pattern and ISO 639-1 code
i18n/ru/default.properties
i18n/en/default.properties
i18n/de/default.propertie

So my desktop app component has English (United States) in it's list of languages and Java web app one is called just English.

The problem here is that there are separate glossaries for both of English languages and most probably it doesn't check for inconsistency between two component translations (haven't checked it yet).

What I did - in admin/lang/language/ changed en_US code's name to just English and recreated the component. The name changed but there were two English glossaries nevertheless.

In settings.py SIMPLIFY_LANGUAGES is set to True but I guess that this setting works on component level.

What I wanted to ask - is there a way to "merge" variants of English on project level or the only solution is to unify codes across components?

@nijel
Copy link
Member

nijel commented Oct 8, 2019

SIMPLIFY_LANGUAGES only allows to use language aliases in case the language is not defined in Weblate database. For languages defined there, it makes no difference for matching ones. The problem with English is that British and American English are different and there is no consensus which of these en should be. Having some overrides per component might address this.

@tariver
Copy link
Author

tariver commented Nov 28, 2019

Run into similar problem with Kazakh. In language-country format desktop application's file name should be kk-KZ.lang
When adding Kazakh to desktop application's component using Weblate's interface it creates a file named kk.lang
If a file is added to repository named kk-KZ.lang Weblate displays it's language as "Kazakh (kk_KZ)" with the same problems described in the first message (seperate glossary etc)

Interestingly, German language file de-DE.lang and Russian language file ru-RU.lang don't have this problem. My guess is that it's because the language code part and country code part is identical.

nijel added a commit that referenced this issue Nov 28, 2019
Issue #3086

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member

nijel commented Nov 28, 2019

@tariver There is list of such locales and Kazakh was missing there, I've just added it. Still, this is different from en / en-US where such decision can not be made automatically.

nijel added a commit to WeblateOrg/language-data that referenced this issue Nov 28, 2019
It should be in same location as other language data.

See WeblateOrg/weblate#3086

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Nov 28, 2019
Also split the generated files to avoid them growing too big.

Issue #3086

Signed-off-by: Michal Čihař <michal@cihar.com>
@tariver
Copy link
Author

tariver commented Nov 28, 2019

Thank you for quick fix.
I understand that en /en-US different, but I guess I can do a workaround with adding it to that list. That's not a universal solution but it will do for me.

@tariver
Copy link
Author

tariver commented Nov 28, 2019

I understand that en /en-US different, but I guess I can do a workaround with adding it to that list. That's not a universal solution but it will do for me.

Just realized that en_US is already in weblate/lang/data.py file but it won't "stack" with en

@nijel
Copy link
Member

nijel commented Nov 28, 2019

To make en_US work as an alias for en, you would have to first delete the language in Weblate. It would be however recreated on upgrade.

@nijel nijel modified the milestones: 4.3, 4.2 Aug 3, 2020
@nijel nijel closed this as completed in e5b2084 Aug 3, 2020
@nijel nijel self-assigned this Aug 3, 2020
@github-actions
Copy link

github-actions bot commented Aug 3, 2020

Thank you for your report, the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, consider supporting Weblate by donating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants