getLocaleForRule([localeRuleKey])
Obtains the locale JSON for a rule.
Returns
The fields object from the localization store. If the passed key does not exist in the localization store, an undefined value is returned.
Parameters
Name | Type | Description | Required |
localeRuleKey | string | The key to the rule whose locale JSON must be obtained. | ❌ |
Usage example
In this example, the API returns a locale JSON for the
WORK-HOME!VIEW!PERSONALINFO
key.
PCore.getLocaleUtils().getLocaleForRule("WORK-HOME!VIEW!PERSONALINFO");
//The localization store has the following structure
{
"WORK-HOME!VIEW!PERSONALINFO" : {
"fields" : {
"First Name" : "Primeiro nome",
"Last Name" : "Último nome"
}
}
}
//The call to the API returns the following JSON object
{
"fields" : {
"First Name" : "Primeiro nome",
"Last Name" : "Último nome"
}
}
Previous topic APIs in the LocaleUtils class Next topic getLocaleValue(localeKey [, localePath] [, localeRuleKey])