-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
LocalizationService.GetLanguageByIsoCode my return language different to the one requested #5959
Comments
Ouch, that's not a change you would add to a repository, especially without opt-in! 😮 And PR #4519 doesn't correctly get the parent culture for cultures that contain multiple dashes or just different names (e.g. |
I'll pick this one up 👍 |
OK so... we can't solve this with an opt-in/overload on the affected method(s) without causing a breaking change on Given how #5358 now allows us to localize the backoffice independently of the dictionary and the active languages, perhaps the best approach here is to simply revert #4519 and no longer (attempt to) support fallbacks to culture invariant translations in the dictionary? Unless there is some Cloud implication I am unaware of here - can you have user defined language overrides on Cloud? |
Thanks @kjac - I know you slept on it and had some more clever ideas, look forward to seeing those! |
@nul800sebastiaan you got it 😆 new PR in #6090 reverts the changes from #4519 and adds the same feature by other means. |
Calling the LocalizationService GetLanguageByIsoCode may return a 'parent' language to the one requested if it can't find it.
e.g GetLanguageByIsoCode("en-US") will return the "en" language if the en-US language is missing.
this may or may not be a bug but the method should be at least annotated to tell you that you might not get what you asked for - maybe there should be a fallback option exposed?
ultimately it happens in the repo:
Umbraco-CMS/src/Umbraco.Core/Persistence/Repositories/Implement/LanguageRepository.cs
Line 240 in e5956e4
The text was updated successfully, but these errors were encountered: