Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. First we need to setup a label that contains the language codes that you want to use in your app.  In your form, add a label with the question ID of lang-code and label text that matches the language code for each language.  We'll also set a Display Condition of 1=2 on this to ensure that it doesn't appear in the form.  This label will be used to determine which language to display, based on what language is chosen. 
    Image RemovedImage Added

  2. Now add a single or multiple answer lookup table question question to the form 
    Image RemovedImage Added
  3. Choose the Lookup Table Data item
    1. Set the lookup table to the lookup table you uploaded (ex. state)
    2. Set the value field to the column in your table you want to store (ex. id)
    3. Set the display text field to the following: name[@lang = jr:itext('lang-code-label')] . You can replace name with the column that contains multiple languages. 



  4. Update and Save your form.  Now the list of options should change their label based on what language is chosen for the application.  However, the data stored will remain the same.

...

  1. Sync your application. Some users have reported this error with large lookup tables that have not properly downloaded which choosing "Update Commcare" from the menu. Run the sync to ensure all assets are properly downloaded to the device
  2. Make sure that the current user has lookup table rows assigned to them (Creating and Updating Lookup Tables
  3. Alternatively, setup your lookup table so that it is available for all users (For the lookup table, set it up so that it is "Visible to All Users" by clicking Edit Type). 
  4. Once you've done this, make sure you've synced your phone. 

...