-
Notifications
You must be signed in to change notification settings - Fork 59
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
[Enhancement] Set the locale based on user, system, and config settings #3645
Comments
@ndegwamartin please advise |
We could also introduce a new config entry for default language and have the users configure with that. That way we still have the flexibility for the list of languages e.g. how they are ordered in the context of a UX. e.g. {
"default_language": "en"
} or {
"lang": "en"
} |
Yea I think the more explicit |
On the other hand, what do we do if the config sets the default language to "es", but the device settings have the default language as "en". It seems odd to override the default device settings. Asked another way, is the default setting here only used if the device doesn't have it's own default? Or if the device default isn't supported in the app? That's seems reasonable. |
We've previously (v1) overridden device settings with the app settings buy using the Language switcher
|
Assuming we have the following scenario App Config "languages": [
"en",
"id"
],
---
"default_language": "id",
---- Questionnaire {
"system": "urn:oid:2.16.578.1.12.4.1.1.8655",
"display": "eCBIS Child Immunization",
"_display": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/translation",
"extension": [
{
"url": "lang",
"valueCode": "id"
},
{
"url": "content",
"valueString": "Imunisasi anak eCBIS"
}
]
}
]
}
}
"languages": [
"en",
"id"
],
---
|
I want to slightly clarify this. In (2) this is checking if the user has already set their language manually, NOT if the app config has a default_language in (4) it first checks for a default_language, and choose that if it exists, if not it goes by the ordering in the "languages" array is that clear? |
Hey @pld for 4 is clear for 2 When you first install the app the user has not chosen anything. So if you have "languages": [
"en",
"id"
],
--- English should be the language else If you have "languages": [
"id",
"en"
],
--- Bahasa should be the language of choice On resume app, we pick what the user has now selected manually in case a change was done |
In most cases, we'll expect the user to never choose anything, if they haven't and if their device settings are set to "en" it'll load "en", if they're set to "id" it'll load "id". Otherwise, we'll check for "default_locale" in the config, and choose that, if that doesn't exist then we'll go w/what you've described |
@f-odhiambo I've update the issue to reflect the above comments, let me know if there is anything that is still unclear, thank you |
This enhancement uses the device settings to set the locale and language, and provides consistent prioritization for how to choose locales when a particular locale is not supported in the app.
The text was updated successfully, but these errors were encountered: