Movicon.NExT Help on Line - Rel. 4.2.358
When opening the String Resource for the first time you will need to create at least one column relating to a text language using a window which automatically opens for selecting a language (or Culture). In this window you will find listed all the languages identified by the Windows operating system. Each one of these languages is represented with an identification that reports the language and geographical area. For example, "en-GB" and "en-US". In this case the first part of the identifier represents the language (en = English) and the second part represents the geographical area (GB = Great Britain and US = United States).
The definition of the language name is preset by the operating system and cannot be changed. The language name is conventional and necessary to eventual automatic text translations as we will see below. |
Adding a new language
The use of the String Table requires that at least one text column be added referring to the selection of one language. The first time the resource is opened, the window for adding a new language opens automatically. Other new languages can be subsequently added by using the "Add New Language" command available from the Text Toolbar or with the right mouse key.
The Add New Language command is used for adding new languages to the String Table
This command can be used each time a new language has to be added to the project.
Movicon does not impose any limits on the number of languages that can be inserted in the project. However, the product may not be guaranteed to work correctly with projects using more than 32 language columns at the same time. |
Adding a new text string
After creating the Columns corresponding to the languages, you can add new text strings by editing the Text Table manually or by importing strings already used in the project into the Text Table.
Manual Editing
New text strings can be added manually by selecting "Add New String" from the contextual menu. To edit the text simply double click on the cell. To go from one cell to another on the table, you can either use the direction arrow keys or the tab key. Below is a screen shot of the string resource editor window.
Importing strings used in the project
To add strings that have already been used in the project to the Text Table in order to translate them into different languages, use the Options menu > Add String ID, or the icon in the Main Toolbar.
According to which resource is open (Screen, Alarms...), the used strings will be imported to the Text Table.
In addition, it is also possible to use the Cross Reference to analyze strings used in the project but not yet added to the Text Table. In order to do this, please refer to the topic on "Cross Reference" for further details. |
Managing Strings in the editor
Language settings can be managed within the development environment by using a popup menu placed at the bottom of the screen editing window.
The languages to choose from are those set in the project.
When the project is started up in runtime without a selected language, it will start with the language selected in editing mode. Subsequently in runtime, any language set by using the command for objects will have priority.
The text defined in the Label objects within Reports behave like "String IDs" within screens.
Therefore, when "String IDs" that are present in the text table are used in a report's labels, they will be replaced with the language currently in use at Runtime, just like they do in the project screens.
Movicon.NExT provides the possibility to load the string table not from the table defined in design mode but from a custom file, if one exists, added to the project's strings folder. This will allow you to customize the project's strings without having to open them in design mode.
Both the Server and Client will search for the files in the project's “Strings” folder that have the "*.custstrings" extension. When these files are found, they will be imported and used instead of the String Table defined in design mode.
In cases where there is at least one 'runtime' file, the table defined in design mode will not be loaded and as a consequence if those strings defined in design mode are missing in the runtime file, they will be displayed with the simple "String IDs" associated in the object's or resource's text. |
The runtime file must have the same import file structure as for the string editor, being:
1° row: ID;[cultura1];[cultura2],...
next rows: Key;string1;string2,...
A practical file example would be:
ID;it-IT;en-US;es-ES
NewTextID_01;Ciao;Hello;Hola
NewTextID_02;Allarme;Alarm;Alarma
The runtime strings are also loaded when the string table in design mode is empty. However, it is necessary that the table in design mode be defined with cultures you wish to use and that these cultures are also present in the runtime file. |
String Concatenation
The user can insert multple string ID for each text property that supports string ID: "{ID_1}{ID_2}".
When a String ID has already been inserted in the property, the procedures will be as follows:
The objects that currently support string concatenations are:
Text (Text) Alarm Banner (BannerAlarmWindow) Animated Text (AnimatedText) (FullAnimatedText) CheckBoxes (ChecBoxControlArray) Option Buttons (OptionButtonControl) Data Analysis Trend (DataAnalysis) (DataAnalysisRT) DB Connector Grid (GridControl) Displays (EditDisplay) Simple line Charts (SparklineChart) Gauges (FastGaugeControl) Advanced Gauges (GaugeControl) Potentiometers (KnobExpress) Sytem XML event Debug (Log4NetViewer) Bargraphs (FastLinearMeterControl) Advanced Bargraphs (LinearMeterControl) State Bar Charts (StatesChartControl) RealTime Trend (RealTimeTrendControl) Chart XY (ChartXY) Charts (Chart) OPC UA Data Server Grid (ServerHistoryTrend)
|
Selections made using the StringPropertyEditor:
Selections without "text" prop. text box focus:
The oldest ID will be enclosed between "{}" (if not already done so)
New ID will be inserted encolsed between "{}" at the end of the previous text.
NOTE: When the text field is empty and only one element is selected from the string table, the ID of the string will not be enclosed between brackets to ensure its backward compatibility.
Selections without control text box focus:
The test box's text selected will be removed (if present).
New ID will be inserted enclosed between "{}" in the point where cursor is found within the text box.
Multiple string ID can be selected from the string editor's popup window and all the selected IDs will be inserted in the property's text between {}.
Selection made by changing the control's property directly:
A string enclosed between brackets or without brackets or one or more substrings enclosed between can still be written directly.
Example:
String table with:
ID1 : text 1
ID2 : text 2
..
IDN : text N
examples of strings allowed:
ID1
{ID1}
{ID1} some text {ID2}{ID1}{IDN}
some text
{some text}
result:
text 1
text 1
text 1 some text text 2text 1text N
some text
{some text}