Creating and Shipping a Localized Application Using LabWindows™/CVI™

Updated Jun 1, 2023

Environment

Software

  • LabWindows/CVI

This document describes how to use LabWindows/CVI to create and ship a localized application. For more information about creating localized applications, refer to the sample program located in the \samples\apps\localui directory of the LabWindows/CVI installation directory. For more information about the LabWindows/CVI features described in this document, refer to the LabWindows/CVI Help.

Installing Fonts and Character Sets

Complete the following steps to ensure that the proper fonts and character sets are on your development computer. These directions assume you are running Windows 7.

  1. Open the operating system Control Panel and select Region and Language.
  2. Select the Administrative tab. In the Language for non-Unicode programs section of the Administrative tab, select the Change system locale button.
  3. In the Region and Language Settings dialog box, select the language you want to translate your application to and click OK.
  4. Select the Keyboards and Languages tab and then click the Change Keyboards button to open the Text Services and Input Languages dialog box.
  5. In the Text Services and Input Languages dialog box, click the Add button to open the Add Input language dialog box.
  6. In the Add Input language dialog box, select the language you want to translate your application to from the Input language drop-down list.

Creating a Language Resource File

Complete the following steps to create a language resource (.lwl) file and use the .lwl file in a LabWindows/CVI project.

  1. In LabWindows/CVI, select Tools»User Interface Localizer to launch the CVI GUI Localization Utility.
  2. With the utility open, select <Alt-Shift> to cycle through the languages available on your computer and select the language you want to translate your application to. By default, the languages appear in your desktop toolbar. If you are using a multibyte language, you also must select <Alt-`> to open the Input Method Editor (IME).
  3. In the utility, select File»Open User Interface to load the .uir file you want to translate.
  4. For each user interface item, enter a local language string in the Local Language control.
  5. Select File»Save Localization to export to a .lwl file.
  6. In your source code, call LocalizePanel, which is available in \toolslib\localui\localui.fp. Insert this function after LoadPanel and before DisplayPanel.


Translating the Run-Time Message File

You must translate the run-time message file if you want run-time dialog boxes, such as the File Open dialog box, to be translated. Complete the following steps to translate the run-time message file.

  1. Create a copy of the msgrte.txt file that is located in the \bin directory of the run-time engine installation directory. The run-time engine installation directory is typically \Windows\system32\cvirte for 32-bit systems, \Windows\SysWOW64\cvirtefor 32-bit components on 64-bit systems, and \Windows\system32\cvirte for 64-bit components on 64-bit systems). Name this copy using a language-specific name, such as msgrte_russian_draft.txt. (Note: The remainder of this procedure will use msgrte_russian_draft.txt to refer to the new file.)
  2. Use a text editor to modify msgrte_russian_draft.txt. Translate only the text that is inside quotation marks. Do not add or delete any message numbers.
  3. Use the following commands to run countmsg.exe, which encodes msgrte_russian_draft.txt for use with the run-time engine and renames the new message file. countmsg.exe is located in the \bin directory of the LabWindows/CVI installation directory. (The LabWindows/CVI installation directory is typically C:\Program Files\National Instruments\CVInn.)

    countmsg msgrte_russian_draft.txt msgrte_russian.txt

 

Building a Distribution

Complete the following steps to build a distribution of your localized application.

  1. Select Build»Distributions»Manage Distributions to open the Manage Distributions dialog box.
  2. In the Manage Distributions dialog box, click New, and then click OK to open the Edit Installer dialog box.
  3. Select the Files tab. In the Local Files & Directories option, browse to the folder containing the .lwl file you saved previously.  
  4. Select the .lwl file and click the Add File button.
  5. In the Advanced tab, enable the Install LabWindows/CVI Shared Run-Time Engine custom message file in the application directory: Directory option and browse to the path for msgrte_russian.txt.
  6. Click OK to close the Edit Installer dialog box.
  7. Select Build»Distributions»Build Project.