-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat: include Uzbek variants in default DB locales #19783
base: master
Are you sure you want to change the base?
Conversation
...dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/I18nLocalePopulator.java
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know the rest of the system can actually handle the locales. There are plenty of Locale
from String
places in the code. Why would they now handle these correct when you had to introduce parseLocaleString
here to make it work? I would think that if this hasn't produced an error yet for you, you just haven't tried the function that does.
In any case we should add at least one test that goes through the scenario you describe in the issue description.
@jbee ok, this should at least have a unit test. As for the change, just to be clear, all this does is result in two additional locales (the Uzbek variants) in a blank DB. It has no impact on the rest of the runtime behaviour whatsoever. Currently Uzbek implementations have to manually edit the DB to make these entries directly in the locales table whenever they set up a new blank instance - and they requested these defaults in order to avoid that. |
@Philip-Larsen-Donnelly The way I see it is, either we do not need the custom parse function you added because the parsing for locales we have elsewhere can handle it, or, if it cannot handle it, adding these to the DB as you say is asking for errors later on when they do get parsed by the locale parsing that is in place elsewhere. If these have been inserted into DB manually without causing trouble then I suppose you don't need the custom parsing because apparently the locale parsing we have can handle it, or, as I say they just never invoked the operation what would fail parsing them. I would like to to know which one it is before we add this. |
This adds Uzbek variants to the default database locales.
The previous code parsed the default strings only one way; which could set the variants, but resulted in locales in the database that couldn't be handled by the core upon retrieval.
The changes here now parse the language, country, and variant parts separately, which results in a locale in the database that is supported without changes elsewhere.
Note that these changes do not affect any of the existing defaults, which remain the same, but only add the two new Uzbek variants in the supported format.
Note also that these defaults only apply to a blank database.
To Test: