LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MessagePopup, ConfirmPopup - how to display message in different language such as Chinese? Any examples exist?

I currently have MessagePopups and ConfirmPopups in English.. Would like to display in different languages such as Chinese -- What is the most efficient way to implement?  Can I put the translated code in my source code or do I need a similar tool such as "User Interface Localizer" to generate the various messages.

0 Kudos
Message 1 of 4
(4,154 Views)

You can use #if / #else blocks inside which you #define the strings as constants.

You need to have an extra #define to set the language.

This method requires, you build your application twice, one for English and one for Chinese.

 

#define LANG_ENGLISH

#undef LANG_CHINESE

 

#ifdef LANG_ENGLISH

#define MESSAGE_STRING "Something in English"

#else

#define MESSAGE_STRING "..." //the Chinese translation which I have no idea 😉

#endif

 

Another way is to define your own CustomMessagePopup function in which you check the value of a global language variable and call the MessagePopup function with the appropriate string. You need to pass the both strings as parameters into your custom function.

 

Hope this helps,

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 4
(4,141 Views)

Hi S. Eren BALCI,

 

Could you give some more detailed information to explain how "to define your own CustomMessagePopup function in which you check the value of a global language variable and call the MessagePopup function with the appropriate string. You need to pass the both strings as parameters into your custom function" since I have to translate many popout messages into Chinese?

 

I am new for LabWindows and C programming.

 

Thank you very much for your attention and help,

 

James

Email: xiaohong_ouyang@arxtron.com

Tel: 647-786-8600

0 Kudos
Message 3 of 4
(3,638 Views)

Hi James4711,

 

Since this is a very old thread, I recommend creating a new thread on the LabWindows/CVI forum for your question. New threads are more likely to garner attention and stimulate discussion.

 

It seems to me that ebalci was talking about setting aside a global variable in your application to keep track of the language that the end user's operating system is using, and then deciding which string to display in the Popup based on that variable. For reference, I have attached a link below to a KnowledgeBase article that explains how to get the Windows language programmatically.

 

How Can I Get the Current Windows System Language in LabWindows/CVI?: http://digital.ni.com/public.nsf/allkb/4DE1C2D3E5310A9986257656005A6050

Tom D.
Staff Software Engineer
NI
0 Kudos
Message 4 of 4
(3,622 Views)