Supporting Privacy Notices in Multiple Languages

Privacy notices can be translated into multiple languages, but the notice can display in only one language at any time. If a specific language cannot be determined, the SDK will always render the default language defined for the notice. In addition, if the root language translation of a privacy notice is configured and a user's language preferences are set to a related language-locale variation of the root language, then the privacy notice will display in the root language translation for that user, rather than the default language defined for the notice.

For example, if a translation is configured for Portuguese (pt) and a user's language is set to Portuguese Angola (pt-ao), Brazil (pt-br), or Portugal (pt-pt), then the user will be shown the privacy notice in Portuguese (pt) if no additional translations were configured for pt-ao, pt-br, or pt-pr.

Showing a privacy notice in different languages

You can reference one of the following methods to set up your pages so that the privacy notice displays in the right language under the given circumstances.

Note:

When using one of the following methods, there must be an exact match between the language either set in the HTML tag or passed in the LoadNotices parameter and the language code stored in the JSON file. The true boolean is related to the recording of a page load event, and should not be altered but must always be present.

Method 1: Declare the language in the page HTML

You can declare the language directly in the page HTML by including an additional tag. For example, you can include the <html lang="fr"> tag at the top of your page. If there is a published French translation for your privacy notice, the notice will then display in French.

Note:

This is the recommended method as it aligns with WCAG accessibility guidelines.

Method 2: Modify the code in the integration script

You can modify the code for the integration code snippet and add extra parameters to define the language in which the notice will display. For example, adding the true and fr parameters in the following script will trigger the French translation of the privacy notice to display. You can hard code this in your page or set it more dynamically depending on your specific implementation.

JSON
OneTrust.NoticeApi.LoadNotices(["https://{BASE URL}/{TENANT GUID}/privacy-notices/{NOTICE GUID}.json"],true,”fr”);
CAUTION:

Do not copy this code snippet. Copy the one generated by your notice on the Integration tab and modify the code accordingly.