-
Notifications
You must be signed in to change notification settings - Fork 249
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
Set locale from within app: support multi language app #503
Comments
@fredhersch could I get access to the mock up linked above so that I can implement the language switcher? |
@ndegwamartin Martin, what would be better is if you could add a drawer to the demo app and have the language option in there. Similar to the COVAX demo app that was shared yesterday. Let me know if this doesn't make sense. Can you make the list of languages a config option too |
@fredhersch yeah I think we can go with the drawer approach. For the configuration of the list of languages, what did you have in mind? |
@ndegwamartin re: configuration - I was just thinking it would be based on an input file (like the strings.xml) with options for the languages being supported |
@fredhersch got you. We can have an array with language codes (Case insensitive) e.g.
This will work for any valid language tags that conform to the IETF BCP 47 standard (same as HL7 FHIR) e.g. |
Discussed with @fredhersch @f-odhiambo and @ndegwamartin. Multiple language translation is a feature the data capture library already supports: if the questionnaire resource has translation information, namely questions and text fields have the FHIR translation extension, they will be displayed if the language matches the system language. For example if a questionnaire is in English and French, if your phone system language is english, we'll display english, if your phone system language is french, we'll display french. However, language switching functionality within the application (i.e. providing a UI to do it) is a different thing. As @ndegwamartin has demonstrated here, the implementation is not without complexity (also see https://proandroiddev.com/change-language-programmatically-at-runtime-on-android-5e6bc15c758 and other blogposts). What the implementation does is essentially changing the underlying context and setting the locale, so that the data capture library renders the questionnaire in a different language context. This does not demonstrate any new functionality of the library. It's demonstrating how we can change language in an android app, which is very useful, but not what the data capture library does. As a result, I feel this feature should live in the appication (or fhir core), but not in the demo app for the data capture library. This PR is still valuable and anyone wishing to implement something like this can use thsi code, but it's not something we'll be maintaining in the data capture gallary app. I hope this sounds reasonable to all, and as a result I'll close this issue - but please do feel free to reopen the discussion. Thanks! |
Is your feature request related to a problem? Please describe.
Currently can't set the locale from within a client app. Need to use the system settings. This makes it difficult to support multi-languages within an application
Describe the solution you'd like
Describe alternatives you've considered
#465
Additional context
For showing this working, let's add a language options to the reference application. This can be accessed by hitting the settings icon. Will update reference app mocks
https://screenshot.googleplex.com/9aTFbEpCzNgDV2i.png
Would you like to work on the issue?
Happy to provide additional input
The text was updated successfully, but these errors were encountered: