Previous Topic: General CommandsNext Topic: Enumeration Commands


Example: Create Localized Settings Trees

The fifth parameter of the Option command eliminates the following needs:

The CA DMM scripts generate the settings trees. Do not use language-independent reference names. DMM Templates are created with a language-dependant Settings tree references. This causes a problem when the strings of a script are translated to a different language as the templates can no longer select settings.

Use the fifth parameter to create a unique reference name (for example, background) that is independent of the locale-dependant version of the display name (for example, Bildschirmmaske) so that templates are based on reference names, not display names.

The fifth parameter specifies a language-independent reference name. The path that is used now to create the option becomes the display name parameter.

Sample script code:

var g_SettingsDisplayPath = "MS Word/Settings";

function PrepareLanguages()
{
     // don't need to check for english because the global strings default to english.
     if (LANGUAGE == 'ger')
     {
          g_SettingsDisplayPath = "MS Word (german)/Settings";
     }
     else if (LANGUAGE == 'jpn')
     {
          g_SettingsDisplayPath = "MS Word (japanese)/Settings";
     }
}

function Detection()
{
     PrepareLanguages();
     
     Option(g_SettingsDisplayPath, "Store", "Apply", "", "msword/settings");
}