Customizing Languages and Locales

What elements are localized?

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 endpoints to add additional localized strings to your Flow.

How do I see all localized strings in my flow?

If you wish to see all strings that are localized in your Flow, make a GET call the the /config/{app}/Flows/{Flow}/translations endpoint.

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
...
Caution. 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.

How can I load the Registration UI in different languages?

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.

How do I add a new language/locale to registration?

To add a new language/locale to your registration, you need to make configuration changes via the configuration API.

  1. GET your current translations.
  2. 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!
...
  1. Upload your new translations by making a PATCH request to the /config/{app}/Flows/{Flow}/translations endpoint. 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';

How do I 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
...