-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[CI4] Language fallback improvements #3995
[CI4] Language fallback improvements #3995
Conversation
- Changes for following best practice for CI4 localization - Norwegian and Urdu languages now working again - Sort languages by alphabet in config
Great work sorting this out @BudsieBuds . The issue in german with empty strings is not resolved then by renaming the en-US to en? |
how do we decide whether we use a base language folder like But I'm not sure whether weblate would be able to handle this setup. |
That's what I thought, but unfortunately no. It is resolved by removing the keys though. It's also an option to remove all empty keys during build or something, but I think coding in that empty values should be ignored would be better and less prone to error.
I thought about this before this PR and think it's better to have everything fall back to English. Mainly because that's the only one being consistently updated, like I mentioned. I think the fact that this is a POS means that seeing the wrong translation (f.e. from The only way I see this being an option is when Weblate can handle showing what it falls back to, in what order, and with multiple languages. But from what I could find in the docs this isn't possible with PHP strings. |
@BudsieBuds one last question, why do we convert Would like to understand the rationale behind either going for language name with or without localization suffix (but then excluding english) |
Ask away. I'm not the best at describing my PRs. Among other resources, I've referred to this file in the repo. I removed all ISO 3166-1 region codes from languages that are only mentioned once. However, I didn’t do the opposite. For instance, with French, the variant is unknown ( Therefore, I changed There's only one assumption: changing Following the BCP 47 as recommended by CI4, I've checked the official resources for the shortest ISO 639 (language) code and official English name and the ISO 3166-1 (region) code. Adjusted them accordingly. Yes, I went down the rabbit hole. 👀 |
thanks for the clarification and research @BudsieBuds . Looks all fine to me. |
@jekkos Should a database migration script be written for updating the languages on upgrade? |
selected language might indeed be in the Config table. So indeed this config value needs to be migrated. |
Following best practices for language fallback in CI4, I've made the following changes.
en-US
toen
for fallback purposes. See CI4 docs.NOTE: Language fallback to English is currently broken in OSPOS because of empty strings, see #3994.