LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best method for multiple language interface?

Hi,

 

I need to adapt my CVI application to multiple languages.  But I have to be able to do this on the fly.  The Localizer is great for all the panel objects and this works great.  But I was wondering what the best method is for all the dialog box text?  Right now I'm using const char defines for the text. For exampl:

 

const char *CONST_NO_STRING         = "No";

 

Is there a simple method, or best practice method, to load different language dialog text at run time or on the fly?

 

Thanks,

 

Andy

Message 1 of 7
(5,404 Views)

What kind of "Dialog Box" are you using?

 

One suggestion would be to create a new Panel to resemble your Dialog Box then call LoadLocalizedPanel() to load the localized version of this new panel.

 

There is an example in the CVI Example Finder for reference:

Help>>Find Examples...>>Search for "localization">>intgraph.cws

 

Let me know if this helps.

 

Regards,

---

Peter Flores
Applications Engineer
0 Kudos
Message 2 of 7
(5,357 Views)

I think Andy is more concerned with the content that he puts into controls (list boxes, text, etc.). All that text is specific to his application and what it needs to report to the user - not simply a control label which can be handled by functions like LoadLocalizedPanel.

 

I'm very interested in further responses to his question.

 

--Ian

0 Kudos
Message 3 of 7
(5,328 Views)

Well, since I do not know of any reliable auto-translator, someone has to hand-write them.

To have them accessible by the code there would be 2 trivial options for me:

 

- Write all language strings inside code

- Write them in a text file (all in one file or one file for each language)

 

The first approach is not maintainable and it becomes a pain to update the executable for each single change in a string.

So it is logic to choose the second option.

 

I have seen many programs, not specificly of CVI origin, that use this method (and requests user to submit a file for his/her native language if none available in community) to give multilanguage support.

 

To simplify the file parsing one can use the INI-file library of CVI.

Message Edited by ebalci on 11-02-2010 11:15 AM
S. Eren BALCI
IMESTEK
Message 4 of 7
(5,311 Views)

I second ebalci in his anaisys. External file approach is more flexible and easier to maintain over time.

By the way, this methods appears at the basis of user interface localizer: if you happen to look into the generated .LWL files you will see all UI elements translations in a ini-style fashion.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 7
(5,305 Views)

I think that an external text file is the best approach.

The only problem is when you want to load multibyte languages from the text file into controls...

(With CVI 9.0 it's easy to use multibyte languages with the localizer)

I think it could be done (as some documents in the knowledgebase explain) but it's an hard job....

 

Am I right?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 6 of 7
(5,299 Views)

Not sure if Andy's original concern was settled... but let's try and button this up:

 

- The UI Localizer does use a text file with manually-written translated strings for each supported language

- From the Localizer help: this will only aid in translating the panel labels.

 

Use this instrument driver to easily display user interfaces in different languages. When loading a panel or menu bar, you can specify a language file that contains translations for all the labels on the panel and all the menu items. You can create different language files for the user interfaces by translating them with the User Interface Localizer utility (localui.exe).

- If you have additional content to be translated (like the text inside a drop down box), manually loading from .lwl, or similar, files and programmatically setting those dialog box entries would be the solution.

- Looks like CVI should handle multibyte languages just fine (see below), though I have never used them.

 

 

To close, these 2 devzones are good references:

http://zone.ni.com/devzone/cda/tut/p/id/4036

http://zone.ni.com/devzone/cda/tut/p/id/3841

 

Regards,

 

---

Peter Flores
Applications Engineer
0 Kudos
Message 7 of 7
(5,281 Views)