getSvcLocale(locale, key)
Obtains the localization instance from the Constellation service for a given user locale and an instance key. This call is authenticated by the Constellation service, using the issued B2S JWT token.
Returns
A promise that resolves to a locale JSON.
Parameters
Name | Type | Description | Required |
locale | string | The name of the locale for which the localization instance must be obtained. | ✅ |
key | string | The name of the localization instance that must be obtained. | ✅ |
Usage example
In this example, the API obtains the locale JSON for the en_US
locale and for the PyCaseSummary
view in the Work- class. This API
call returns a promise which when resolved gives the locale JSON.
const localeJson = await AssetLoader.getSvcLocale('en_US', 'WORK-!VIEW!PYCASESUMMARY.json')
.then((data) => {
// data is the response from the constellation service which is the locale JSON
});
Previous topic getSvcImage(key) Next topic initServer(url [, b2sJWT])