You can assign string values to messages and labels globally or locally within a specific view. Messages and labels are defined in a "strings" object. The "strings" object at the top level of your UI configuration file contains messages and labels that are used throughout the App SDK. A "strings" object that is nested inside of a "_view" object is used only by that view.
For example, if you replace the value for "next_button" at the top level of your UI configuration file, then the App SDK labels all Next buttons with your string.
{ ...
"strings":{
"next_button":"Continue"
},
...
}The example below contains a customization specific to the Suggest Registration view. The label for the Cancel button is "No".
{ ...
"views":{
"suggest_reg_view":{
"strings":{
"cancel_button":"No"
}
}
},
...
}Localizing Your App
Your application can include localized versions of the JSON UI Configuration file. The App SDK finds the UI Configuration file that corresponds to the system's local language.
Take the following steps to localize your app using the JSON UI Configuration file:
Step 1: Create a copy of your JSON UI configuration file for each language that your app supports. Append the ISO language code and, optionally, the ISO region code to the filename. Here are two example filenames:
ui_cfg_fr.json - Where fr is the system language code.
ui_cfg_fr-ca.json - Where fr is the system language code and ca is the region code.
Step 2: Edit each file that is specific to a language, keeping track of which lines you change. When you are finished editing the language-specific file, delete any lines that you did not change and leave only lines that you changed.
Step 3: Skip this step if your configuration files are stored on a remote server. If your configuration files are stored locally, ensure that each app passes true to the localize parameter when the app directs the App SDK to your modified configuration files. See Direct the App SDK to a Locally Stored UI Configuration File section in the Android, iOS or Web Developer Guide.
Step 4: The App SDK determines the final configuration by merging configuration files in the following order:
The App SDK starts with the default configuration file.
For locally stored UI configuration files, the default configuration file is the source of your configuration file that you specified when your app directs the App SDK to the UI configuration file.
For remotely stored UI configuration files, the default configuration file is default/ui_cfg.json
If the App SDK can find a JSON file whose name has an appended language code that matches the system language, then it merges that JSON file into your UI configuration.
If the App SDK can find a JSON file whose name has the same appended language code found in Step 2 plus an additional region code, it merges that JSON file into your UI configuration.
In an Android app, you can alternatively use a strings.xml file to localize your app. In an iOS app, you can alternatively use a .bundle to localize your app. See the Localizing section in the Android or iOS Developer Guide.
Explaining to the User Why Additional Authentication is Required
When an adaptive ruleset requires the user to complete more than one authentication method, the App SDK can explain to the user why they are being prompted for an additional authentication method. The Adaptive Ruleset, defined in the Cloud Console's Server Administration page, can contain a reason code. Your UI configuration file can include a "reasonCodeMap" object at the top level that maps that reason code from the Cloud Console to an explanation that the App SDK displays to the user. You can define both the reason code in the Cloud Console and its corresponding explanation in your UI configuration file.
Here are default reason codes and their corresponding explanations.
{ ...
"reasonCodeMap":{
"passkey_on_new_device":"New device detected!",
"key_protection_software":"To protect your account additional verification is required."
}
...
}