How to localize Field Configuration with REST API
Introduction
From Identify Admin 5.4, SharedConfigurableSettings fully supported all methods including GET, POST, PUT, DELETE, PATCH and added more properties that contains localized contents. Therefore, using this API, password validation rule can be updated with localized content for Help text and Error message from now on.
The new properties used for localization purpose are helpTextLocalization and errorMessageLocalization. These properties are available on methods POST, PUT and PATCH. More details can be found on Swagger https://your_tenant/admin/swagger/ui/index. For a list of predefined culture names, see the National Language Support (NLS) API Reference at the Go Global Developer Center.
Examples
Example 1: Use PUT method to update password validation rule and localized content of Help text and Error message in English (en) and Dutch (nl)
{
"name": "Password1",
"resourceKey": "Password1",
"expression": "^(?=.*?\\d)(?=.*[a-z])(?=.*[A-Z])(\\w|[!@#$%^&*(\\)\\\\\\-=_+{}[\\]|<>,./?~`:;'\"]){10,100}$",
"defaultErrorMessage": "The format of this password is invalid",
"defaultHelpText": "A valid password must have from 10-100 characters. In addition, it must not contain username but must contain at least 1 upper, 1 lower alphanumeric character, 1 digit and only those special characters are allowed !@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"helpTextLocalization": [
{
"content": "A valid password must have from 10-100 characters. In addition, it must not contain username but must contain at least 1 upper, 1 lower alphanumeric character, 1 digit and only those special characters are allowed !@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "en"
},
{
"content": "Een geldig wachtwoord moet uit 10 tot 100 tekens bestaan. Bovendien mag deze geen gebruikersnamen bevatten, maar moet deze minstens 1 bovenste, 1 onderste alfanumerieke teken, 1 cijfer en alleen de speciale tekens zijn toegestaan!@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "nl"
}
],
"errorMessageLocalization": [
{
"content": "The format of this password is invalid",
"languageCode": "en"
},
{
"content": "Het formaat van dit wachtwoord is ongeldig",
"languageCode": "nl"
}
]
}
Example 2: Use PATCH method to add localized content of Help text in English (en) and Dutch (nl) Request URL: https://your_tenant/admin/api/rest/v2/sharedconfigurablesettings/Password1 Input Json:
"op": "add",
"path": "helpTextLocalization",
"value":
[
{
"content": "A valid password must have from 10-100 characters. In addition, it must not contain username but must contain at least 1 upper, 1 lower alphanumeric character, 1 digit and only those special characters are allowed !@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "en"
},
{
"content": "Een geldig wachtwoord moet uit 10 tot 100 tekens bestaan. Bovendien mag deze geen gebruikersnamen bevatten, maar moet deze minstens 1 bovenste, 1 onderste alfanumerieke teken, 1 cijfer en alleen de speciale tekens zijn toegestaan!@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "nl"
}
]
}
Example 3: Use PATCH method to replace localized content of Help text in English (en) and Dutch (nl) Request URL: https://your_tenant/admin/api/rest/v2/sharedconfigurablesettings/Password1 Input Json:
{
"op": "replace",
"path": "helpTextLocalization",
"value":
[
{
"content": "[Updated] A valid password must have from 10-100 characters. In addition, it must not contain username but must contain at least 1 upper, 1 lower alphanumeric character, 1 digit and only those special characters are allowed !@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "en"
},
{
"content": "[Updated] Een geldig wachtwoord moet uit 10 tot 100 tekens bestaan. Bovendien mag deze geen gebruikersnamen bevatten, maar moet deze minstens 1 bovenste, 1 onderste alfanumerieke teken, 1 cijfer en alleen de speciale tekens zijn toegestaan!@#$%^&*()-=_+{}[]|\\<>,./?~`:;'\"",
"languageCode": "nl"
}
]
}
Example 4: Use PATCH method to remove localized content of Help text in English (en) and Dutch (nl) Request URL: https://your_tenant/admin/api/rest/v2/sharedconfigurablesettings/Password1 Input Json:
{
"op": "remove",
"path": "helpTextLocalization",
"value":
[
{
"languageCode": "en"
},
{
"languageCode": "nl"
}
]
}