LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

fileselectpopup produces buttons with different language

Hi,

i have a language localization problem with the fileselectpopup running labwin 8.1.0 on a germany winxp computer:

The following :

    if(FileSelectPopup (proj_dir, "*.tnf", "*.tnf", "Daten laden", VAL_LOAD_BUTTON, 0, 1,
         1, 1, file_name)>0)
    {

produces a dialog box with the buttons "Load" (which is obviously english) and "Abbrechen" (Germany for "cancel").

The code:

if(FileSelectPopup (proj_dir, cDummy, "*.tnf", "Daten speichern", VAL_SAVE_BUTTON, 0, 1,
         1, 1, file_name)>0)
    {

produces german labels on both buttons. I´m quite puzzled how to handle that type of problem.

Would be glad if anyone had a clue what to do about it....

best regards

DoS
0 Kudos
Message 1 of 5
(3,574 Views)
Hello DoS,

CVI itself is not localized, which means that when you invoke functions that display built-in CVI dialog boxes, those dialog boxes display english labels. However, the FileSelectPopup function is implemented by customizing a native Windows dialog, rather than creating one from scratch. This Windows dialog is localized, so that when you run it in a German OS, its labels are translated into German. However, the buttons that are added by CVI are not localized, which meanst that you end up with a mixture of english and german in the same dialog box which, of course, is somewhat unsettling.

If your goal is to show all the strings in English, that is not possible. If your goal, however, is to show them all in German, then you do have a possible solution:

1. Open the following file in some text editor: c:\windows\system32\cvirte\bin\msgrte.txt.
2. Look for strings that you might want to translate: for example, "&Load" and "Directory &History:"
3. After you translate those strings, you need to run the following program: c:\program files\national instruments\cvi81\bin\countmsg.exe (this will update the values in the first line of the msgrte.txt file)

There's one caveat to this. If you then create an installer distribution in CVI in order to deploy your application, it will not include the changes that you made to the message file. If you're in this situation, let me know. I think there is a workaround, but I'll hold off on describing it unless you need it.

Luis

Message Edited by LuisG on 08-23-2007 11:47 AM

Message Edited by LuisG on 08-23-2007 11:47 AM

0 Kudos
Message 2 of 5
(3,561 Views)
First of all - thanks for your immeditate reply.

I was quite happy reading that there is a solution to the problem until i reached the end of your message: I have to write an apllication for an external customer. Thus i need to generate a distribution kit for installation.
I desperately need a fix for that problem - otherwise i would be forced to create a file window on my own as a workaround ;-(

thanks in advance

DoS
0 Kudos
Message 3 of 5
(3,551 Views)
Hello DoS,

This is what you have to do in order to include the translated message file in your installation.

1. Install the CVI run-time engine locally, instead of globally (you set this option in the Advanced tab of the Edit Distribution dialog. The option is called "Install LabWindows/CVI Run-Time Engine in the application directory"). By installing it locally, you ensure that the customized version of the CVI run-time engine won't be overwritten by a later version that some other NI software might install.

2. Add the translated msgrte.txt to your distribution, and install it at the top level of your application directory.

3. Create a batch file that copies "%1\msgrte.txt" to "%1\cvirte\bin\msgrte.txt".

4. Add this batch file to your distribution, install it at the top level of your application directory, and specify that it should run after installation (you do this by double-clicking the batch file in the "Installation Files & Directories" control of the Files tab of the Edit Distribution dialog, and then selecting the "Launch After Installation" option. You will also need to enter "%dest" in the "Cmd Line Args" control).

I think this should work. Let me know if you have any problems.

Luis

Message Edited by LuisG on 08-24-2007 03:41 PM

0 Kudos
Message 4 of 5
(3,528 Views)
First of all: Thanks for the very detailed description. I´ll realize this next week as i had some sudden high priority feature request from my customer.

I think that should solve the problem - but will definitely report if the solution worked.

Thanks for the support!
0 Kudos
Message 5 of 5
(3,487 Views)