Add languages and locales
Some of the content on this page deals with a legacy feature of the Akamai Identity Cloud (in this case, the JavaScript SDK). If you are currently an Identity Cloud customer and are using the JavaScript SDK, that SDK is still supported. However, if you’re new to the Identity Cloud the JavaScript SDK is no longer available. Instead, you should use Hosted Login for your login and registration needs.
Localized elements
Generally speaking, Fields and i18nStrings (“access denied” messages, for example) are localized. However, any markup besides the field JTL tags are not localized.
If you wish to add localized strings to your registration experience that aren’t input elements (for instance, localizing the text of the submit button), you can utilize the [/config/{app}/flows/{flow}/strings] operation to add additional localized strings to your Flow.
Viewing the localized strings in a flow
If you wish to see all strings that are localized in your Flow, make a GET call the /config/{app}/flows/{flow}/translations operation.
You can receive your translations encoded in either CSV or JSON format, however we recommend using CSV format because it can be directly edited by a spreadsheet program. To do this, set the Accept header to “text/csv” in your request. Below is an example csv-formatted response:
path,key,en-US
fields.someField.label,6b233d297b11ee86e054bea7c381610d,Register
fields.anotherField.label,61dcb42842469f0f198aea9d809176d0,Hello!
fields.oneMoreField.label,5992bf1a97a97e36c18b3aa1459efda7,Goodbye
...
Do not remove any of the existing columns, such as path or key; these are required by the flow. The path key corresponds to a field or i18nString path/name, and the key provides a unique identifier that is utilized in the field and i18nString definitions.
Load the Registration UI in a different language
To view your Registration UI in a different localization, there are two JavaScript settings that should be enabled:
janrain.settings.language = 'fr-FR';
janrain.settings.capture.language = 'fr-FR';
There is an important distinction between these two settings. The janrain.settings.language setting controls localization for the Social Login Registration UI, and only a limited set of languages are supported.
On the other hand, the janrain.settings.capture.language setting specifies the locale of elements defined in the Flow translations, which are not constrained to a specific set of locales. You can add or update new translations via the Configuration API.
Add a new language or locale to registration
To add a new language/locale to your registration, you need to make configuration changes via the configuration API.
-
GET your current translations.
-
Add the new locale to your current translations by adding a new column for the new locale and name it in the header row; in the example below, the “fr-FR” locale has been added to the CSV file:
path,key,en-US,fr-FR
fields.someField.label,6b233d297b11ee86e054bea7c381610d,Register,Faire inscrire
fields.anotherField.label,61dcb42842469f0f198aea9d809176d0,Hello!,Bonjour!
fields.oneMoreField.label,5992bf1a97a97e36c18b3aa1459efda7,Goodbye,Au revoir!
...
- Upload your new translations by making a PATCH request to the /config/{app}/flows/{flow}/translations operation. PATCH the updated file into the Flow specifying the content type as text/csv.
To view the updated translations, set the locale of the Registration UI by updating the language setting:
janrain.settings.language = 'fr-FR';
Modify the translations for an existing locale
You can follow the same set of steps as described in the section on how to add a locale, with one modification: instead of adding a new locale to the translations file, you can simply modify the translations as-is.
For instance, if your translations are currently:
path,key,en-US
fields.someField.label,6b233d297b11ee86e054bea7c381610d,Register
fields.anotherField.label,61dcb42842469f0f198aea9d809176d0,Hello!
fields.oneMoreField.label,5992bf1a97a97e36c18b3aa1459efda7,Goodbye
...
You can modify them like so, and make a PATCH request with the modified file:
path,key,en-US
fields.someField.label,6b233d297b11ee86e054bea7c381610d,Join Us
fields.anotherField.label,61dcb42842469f0f198aea9d809176d0,Good day!
fields.oneMoreField.label,5992bf1a97a97e36c18b3aa1459efda7,See you later
...
Updated almost 2 years ago