Changing the App User Language

I have a user using a Smarthealth App who has selected a wrong language and will be great to know how to change this back to the default language.

FYI: The user had already created a few records with the new language and that is also creating some conflicts on the database level. Solutions on this will be greatly appreciated too!

@kenasiago - there are two ways to switch languages for a user.

The first is via User settings:

  1. Go to hamburger menu and choose “User Settings”
  2. Then choose “Edit user profile”
  3. Finally choose the language in the “Language” drop down and click “Submit”:

The other way is to log out and login:

  1. Go to hamburger menu and choose “Log out”
  2. On the login screen click your desired language and log back in:

Note that the hamburger menu can be configured in app settings (for example can_log_out_on_android), so not all options may be available depending on your settings. In a worst case, sync all your data (super important!), then delete the CHT Android app storage. When you next launch the app, it will prompt you for a login and password and you can also choose the language.

2 Likes

Thanks @mrjones for your response. Most of these users especially the CHWs do not usually have access to user settings. The partner would also be interested to know how these users can be identified and how the team can handle the reports (with a different language) that have been submitted by these users. cc @jonathan

Hey kenasiago we could query users with non-english language settings I have some sample query that can achieve this:

select 
couchdb.doc ->> '_id' as id,
couchdb.doc ->> 'language' lang,
couchdb.doc ->> 'name' as username,
cm.name,
cm2.name as Area,
couchdb.doc ->> 'roles' as roles,
couchdb.doc ->> 'contact_id' as contact_id, 
couchdb.doc ->> 'facility_id' as facility_id

FROM couchdb, contactview_metadata cm, contactview_metadata cm2 
  WHERE (couchdb.doc ->> 'type'::text) = 'user-settings'
  and couchdb.doc ->> 'language' != 'en'
  and couchdb.doc ->> 'contact_id' = cm.uuid 
  and couchdb.doc ->> 'facility_id' = cm2.uuid 

The same thing could apply for reports, if they arent very many affect we could query them out and correct them manually otherwise we might need to run a script for this

We also need to disable non-english languages for the app so users don’t make this mistake again
Under: App management → display → languages
Select a given language then click on disable to remove it from the log in page

2 Likes

This is great! Giving it a try

Thanks for your response @mrjones

Happy to help @kenasiago! Let us know if you have any issues implementing any of the solutions outlined above - there’s some great suggestions from @jonathan as well!

1 Like

The user had already created a few records with the new language and that is also creating some conflicts on the database level.

I’m curious what kinds of database conflicts you are seeing based on a user’s language setting. Normally the language just dictates how a field is rendered on the screen, not how the value is stored in the database.

For example… if you have a slect_one yes_no field, the question and answer options will be shown on the screen in the selected language…

…but in the database it will store the name (yes vs. no)