Localization

To get your app ready for local systems and conditions, we have to make sure to make it adaptable on the language front. While working with the microapp on the studio, there are several prompts and messages as responses it throws at the users, all these can be changed and converted into your desired language.

All these can be done from Localization setting which can be found under the Settings and Config of the microapp as shown below.

Once you navigate to localization settings, the details about the language data along with the button to add a new language will appear.

Language Data

To proceed with making the microapp multilinguistic, understanding the language data and its format is important. DronaHQ generates a JSON file of all strings that can be internationalized at different places in the app which includes - system messages, static strings used in screens, rules, data queries and controls including but not limited to their properties and data. Download it from the default language and translate and upload it for different languages.

Note: Localization should be done once the complete app is ready for deployment.

Click the Download button, this will download the JSON file, containing all the system messages, static formulas for controls and variables, static strings in actions, and static values from rules and validations.
This then will be used for localization with different languages.

Downloaded JSON will look something like this:

Modifying language data

The previously downloaded JSON file of the master language would require to be updated with the desired language you want, in the exact format of the JSON file.
There are a few crucial points to remember while updating the JSON file with other language:-

  1. Do not change any Key in the JSON, if the user wants, they can add new Key value pair to JSON.
  2. User only needs to change the values part in the JSON
  3. For dynamic values user should not change anything between {{}} (double curly braces)

Example:

Adding language data

After JSON is ready, the user needs to upload that JSON file by

  1. Clicking + Add Language.
  2. Select the language you are going to upload in the JSON file.
  3. Attach the modified JSON file.
  4. Click Upload.

Example:

Once you uploaded the JSON file(s) for the microapp, they will be showcased there only.

With click of three dots beside the uploaded languages, one can find basic operations available for the uploaded language file :

  1. Edit
  2. Download
  3. Delete
  4. Activate (uploaded language active by default) / Deactivate (language will not be available for testing as well as will not be included in the package).

Finally, save it by clicking Save Localization. The translation is available in the preview as well as on the device the next time you publish your app.

Two new Keywords introduced:

  1. LANGUAGES – this will have an array of objects of all the uploaded active languages, so users can directly use this as a formula to change between different languages.
  2. LANGAUGE – this will represent the language in which the app will be loaded, by default we will read the browser’s current locale language and load the app in that language (if JSON is available)
    To switch languages, we have introduced a new action CHANGE LANGAUGE
    image

Here user needs to pass the locale code in which they wish the app to be loaded.

App Preview:

DronaHQ Docs have found a new place!

We have updated and moved our documentation to docs.dronahq.com.
You can continue to ask questions in the community here.