You are on page 1of 2

Multiple Language Support for Operator Views 1

Operator View Localization in Design Assistant X


Overview
Operator View localization provides multiple language support for Operator Views. A file called
LocalizedLabels.js contains the text currently used for each localized label. Unicode character sets provide
support for most languages. A separate file is prepared for each supported language. Each language file
should be named, LocalizedLabels-XXXX.js, where the portion following the hyphen (XXXX) is displayed in
the Portal Page drop list for selecting the current language

Once the project is deployed, you can select the display language from the portal page. You may need to
clear the cached information for the operator view (Ctrl-F5) in the browser to clear the previous language
and display with the newly chosen one. Behind the scenes, the content of the chosen language file is placed
in the current LocalizedLabels file.

An example project is provided in the Tutorials Start Page.

Procedure
1. In the Operator View layout tab, add the prefix LOC_ to every word that you wish to localize, for
example LOC_Project_Title, LOC_TotalPass. Items that can be localized are labels, button text,
toggle button text and PassFail element text.

2. Using an editor, open the provided LocalizedLabels.js and save it in the project's OperatorView
folder with a new name for the language you are working on, for example LocalizedLabels-
French.js. The default language should be a copy of one of the languages with the language name
removed.

PRELIMINARY
Multiple Language Support for Operator Views 2
3. For every item to translate you add a key:value pair to the enumeration. For example:

// Use this format format for each localized string


// "Key" : "Value"

var __languageName = "Français"

var __localizedStr =
{
"LOC_Project_Title": "Projet ABC",
"LOC_TotalPass": "Total Pass"
};

Remember that the file must have valid javascript syntax, so the items in the localization list must
be separated by commas.
Notice also the variable that that contains the string you would like to use to identify the currently
selected language. Typically, this string would match the last part of the filename, LocalizedLabels-
XXXX.js.

Localization instructions DA 5.1:


This mechanism can also be applied to DA 5.1 projects, but requires some additional file substitutions, since
the DA 5.1 deployment and portal are not aware of localization.

Procedure
Prepare the LocalizedLabels files as described above.
1. Open the attached Operator View Localization.zip file.
2. Navigate to Program Files/MatroxImaging/DA 5.1/Web/dawebinc. Backup then replace
DAWebtools.js and DesignAssistant.css with the provided corresponding files from the zip
3. Navigate to Program Files/MatroxImaging/DA 5.1/OperatorView/Web. Backup then replace
OperatorViewHeader.htm with the provided corresponding file from the zip

PRELIMINARY

You might also like