Server-side localization

JavaScript localization support is available in workflows and workflow libraries. The pattern is similar to the one used in Form AftergenerateJS, with a small difference at call time:

Copy

var resource1 = new EbsResource({
    key : "myKey",
        "ro-RO" : "mesaj romana",
        "en-GB" : "English message"
});
 
throwException( getString(resource1), 1 );  //the resource must be passed as parameter to getString
 
//support for message formatting
 
var resource2 = new EbsResource({
    key : "myKey",
    "ro-RO" : "Atributul {0} din entitea {1} nu poate fi null",
    "en-GB" : "Attribute {0} in entity {1} cannot be null"
});
 
// getString can be called as string.Format in .NET, passing the formatting args as an array argument
 
throwException( getString(resource2, ["MyManadatoryAttribute","MyEntity"]) , 1 );         

Upon save, the resource keys are automatically inserted within the LocalizationResource and available for edit in the Localization Resources editor. The resource keys will be saved with the module name following these naming conventions: