Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Static Translation not working for UI page

ApurvaS
Tera Contributor

We have custom "On Hold" UI action on incident form which opens a pop-up through UI page to enter details, we tried adding ${} to texts and create entries in sys_ui_message table but static translation is not working.

Below is the HTML code snippet from UI page

<div>
            <label for="textarea" id="selectOptions">On Hold Reason</label>
            <p>
                <select name="onHold" id="onHoldReason" onchange="onHoldChoiceMandatory()" class="form-control">
                    <option value="noneValue" role="option">--None--</option>
                    <option value="awaitingCaller" role="option">Awaiting Caller</option>
                    <option value="awaitingVendor" role="option">Awaiting Vendor</option>
                    <option value="awaitingChange" role="option">Awaiting Change</option>

                    <j:if test="${jvar_showUserOffboarding}">
                        <option value="userOffboarding" role="option">User Offboarding</option>
                    </j:if>
                </select>
            </p>
        </div>

 

1 REPLY 1

Ankur Bawiskar
Tera Patron

@ApurvaS 

that syntax won't work on UI pages

you need to use g:message

something like this, I haven't tried this

<div>
    <label for="textarea" id="selectOptions">
        <g:message key="on_hold.reason" />
    </label>
    <p>
        <select name="onHold" id="onHoldReason" onchange="onHoldChoiceMandatory()" class="form-control">
            <option value="noneValue" role="option">
                <g:message key="none" />
            </option>
            <option value="awaitingCaller" role="option">
                <g:message key="awaiting.caller" />
            </option>
            <option value="awaitingVendor" role="option">
                <g:message key="awaiting.vendor" />
            </option>
            <option value="awaitingChange" role="option">
                <g:message key="awaiting.change" />
            </option>
            <j:if test="${jvar_showUserOffboarding}">
                <option value="userOffboarding" role="option">
                    <g:message key="user.offboarding" />
                </option>
            </j:if>
        </select>
    </p>
</div>

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader