Develop Translatable Components for Multilingual Sites

Developers of custom components can designate which strings within a custom component should take part in page translations for multilingual (MLS) sites.

To do this, you need to introduce an nls property at the top level when saving your data to the customSettingsData object.

For example:

SitesSDK.setProperty('customSettingsData', {
		'nls': {
			linkText: 'More...'
		}
	});

When a translation job is created, Oracle Content and Experience will check the top-level properties of the customSettingsData object and export the entire nls object for each custom component instance on the page. Translators will translate these values, which can then be imported back into the site.

Once the site translations have been imported, the correct version of the nls object will be returned in the customSettingsData object for the translated locale.

For example, if you translated the site to French and then render the page in the French locale, the value of the nls object in the customSettingsData object passed to the custom component would be updated to:

               {
                    'nls': {
                        'linkText': 'Plus...'
                    }
                },

The format of the nls object in customSettingsData should be limited to name/value pairs. This aids in translation and ensures that translated values can be applied correctly to the base values in the site when the page is rendered in a translated locale.