Launching Multi-Language Angular Omniscripts (Managed Package)

For the managed package runtime, by default, a multi-language Angular Omniscript uses the language configured for the user who is running the script. To specify the language in which a script is run, use a Salesforce-supported language code.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

When launching an Omniscript using a URL, you can specify the language setting in the LanguageCode parameter. For example:

https://MyDomainName--c.vf.force.com/apex/myorg__OmniScriptUniversalPage?LanguageCode=zh_CN&OmniScriptLang=Multi-Language...

To launch a multi-language Omniscript from a VisualForce page, include the following line in the header:

language="{!$CurrentPage.parameters.LanguageCode}"

If the Omniscript includes elements that use custom templates that use custom labels, you can enable the translation of the custom labels by declaring them in the Visualforce page that launches the Omniscript and using specific syntax in the custom templates. To declare the labels on the VisualForce page, map them in the script section as shown in the following example:

<apex:page standardStylesheets="false" showHeader="false" sidebar="false" docType="html-5.0"  language="{
!$CurrentPage.parameters.LanguageCode}">
    <div class="vlocity via-slds via-omni" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ng-app="NewOmniScript">
        <c:BusinessProcessComponent strOmniScriptType="Jun"
            strOmniScriptSubType="Multi-lang"
            strOmniScriptLang="Multi-Language"
            previewMode="{!$CurrentPage.parameters.previewEmbedded}"
            verticalMode="{!$CurrentPage.parameters.verticalMode}"
            strOmniScriptId="{!$CurrentPage.parameters.designerPreviewId}"
            scriptLayout="lightning"/>
        <script type="text/javascript">
            var modules = ['vlocity-business-process'];
            var myModule = angular.module('NewOmniScript', modules);
            customLabels.custom1 = "customLabel1}";
            customLabels.custom2 = "customLabel3}";
            customLabels.custom3 = "customLabel3}";
[...]
        </script>
    </div>
    <c:VFActionFunction /> 
</apex:page>

In the custom templates that display the custom labels, use the following syntax to refer to them: {{::customLabels.custom1}}

To launch a multi-language OmniForm from an Integration Procedure and specify the language dynamically, create a key/value pair in the OmniForm action's Remote Options settings list as follows:

  • Key: LanguageCode
  • Value: %LanguageCode%