Localize Gosu code in a workflow step
About this task
It is possible to localize the language used for Gosu code that you add to any workflow step, such as in an Enter Script block.
Note: Besides
runAsCurrentLanguage, other LocaleUtil wrapper methods useful for localization include runAsCurrentLocale and runAsCurrentLocaleAndLanguage.Procedure
-
Wrap the Gosu code in the following method:
gw.api.util.LocaleUtil.runAsCurrentLanguage( alternateLanguage, \ -> { code } ) -
Set the value of
alternateLanguageto the language to use for the Gosu code block.For example:
gw.api.util.LocaleUtil.runAsCurrentLanguage( gw.i18n.ILocale.LANGUAGE_FR_FR, \ -> { code } )
What to do next
See also
