LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bi-lingual Front Panel

Is there a way to change the language on the front panel objects? I want the operator to have the ability to change the text language.
I am using labVIEW 8.2.
0 Kudos
Message 1 of 4
(3,069 Views)
The Import Strings.. and Export Strings.. under Tools >> Advanced can be used in the development environment.

For the user to change languages you can use write text to the control Captions (not Labels!) using property nodes. If all the controls are simple numerics, strings, and booleans without boolean text on the buttons, this is quite straightforward. If you have complex controls like clusters, radio buttons, and tabs, it can get much messier quickly. Make sure each control has a unique label. The hide the labels and show the captions on each control. This is because you can change captions programmatically but cannot change the labels. The captions must be shown for each control manually from the edit mode before calling the Caption.Text property node or an error will occur. Get references to the panel. From that get the Controls[] reference array. Using autoindexing in a loop, match the label text from a property node to a list of labels. When a match is found, write the caption text for the selected language. Proceed to the next match. When the control type is one of the complex one, like a cluster, obtain a reference array to the controls contained within and repeat the matching process. Search the archives for some examples of how this has been done by others.

Also remember to check the panel layouts so that the captions fit when the language using the largest number of characters is selected.

The captions can be stored as diagram constants if there are only a few controls. Storing the the captions in a file is more versatile and allows changing the translations or adding a language with minimal or no change to the program.

Lynn
Message 2 of 4
(3,054 Views)


johnsold wrote:
The Import Strings.. and Export Strings.. under Tools >> Advanced can be used in the development environment.

and by using a VI class method in an executable.

___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(3,031 Views)
There are a couple of schools of thought on this process.
  1. Use the VI methods Import Strings and Export Strings to set and get the string values from a VI.
  2. Use custom methods to set and get strings for every control and block diagram constant you care about (controls have VI server methods to get their strings - sometimes well hidden).  Use this to create an indexed string table with one entry for each control/string.
In practice, I found the latter method easier, even with the higher up-front cost, because it gave me the control and ease-of-maintenance I wanted in integrating it with the documentation (developer ease-of-use is another matter).  When you design your system, make sure you take into account the full round trip experience - create the strings, translate them, store in some sort of string table, read back during execution.  Think about how you want to do maintenance on the VIs and what implications this has for your string tables and translations.

For example, you want to add a new control to your VI.  In method one, this would mean exporting the strings again, extracting the strings you want to translate, extracting the new strings from this list, translating, creating the new string file, then using it.  In method 2, this would mean adding another entry to your string tables.   Both methods can be automated to a high degree.

Bottom line - you can do this.  It isn't particularly hard, but can take a fair amount of planning before you try to execute.
0 Kudos
Message 4 of 4
(2,998 Views)