The config used to initialize this SDK.
The label storage. This will used when there is no Local storage
getter method for namespace. Provides the salesforce org namespace
setter method for namespace. Set custom namespace
Clear the label storage. This will remove all labels in storage.
true on successfully clearing the label storage.
Create an input object of the FetchTranslationInput.
This function fetch the translations for a given set of label(s) with the language provided.
Return the labels in cache as a JSON Object with label key as the key and the custom label as the value.
JSON objec to label keys and translated labels as values.
Check the input.textToTranslate contains labels that are already in labelStorage. If already exists in labelStorage, remove it from input.textToTranslate.
Returns the number of labels in labelStorage.
Store translated labels in cache.
number of labels stored.
Get the corresponding translated string for a given label. fetch() must be called first before calling this function. This function translates only strings exist in local Storage/this.labelStorage. Otherwise, it will return the provided label.
Returns the version number of SDK.
Returns SDK version number as string
Adds all the enumerable string keyed function properties of a source
object to the sdk prototype.
.extend
should only be used to add new methods and it won't override the existing methods.
Note: If the property already exists, it will be not be added.
Custom functions which are being extended should have proper namespaces to avoid issues during upgrades. When Vlocity releases new changes it won't impact if unique namespaces are used.
Example: myCompanyOrFeatureMethodName
The object of functions
Get a singleton instance of this Translation.
an instance of this SDK.
Adds all the enumerable string keyed function properties of a source object to the sdk prototype.
.override
method should only be used to override the existing methods and should only be used in rare cases.
Overriding the existing or default methods may cause unintended consequences and may also impact during upgrades.
Please be cautious while using this
The object of functions
Generated using TypeDoc
TranslationService is the Service responsible for translation. Current implmenetation supports SalesForce Custom Labels and Dictionaries.