08-03-2010 11:12 AM
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.
08-04-2010 12:58 AM
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,
07-05-2016 09:41 AM
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
07-06-2016 02:52 PM
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