Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Apr 19, 2010


Feedback


Yes No

Related Categories

Products

Development Topic

      Related Links - Developer Zone

      Related Links - Products and Services

      Localization Configuration Editor Reference Example

      2 ratings | 5.00 out of 5
      Print

      Overview

      Localization is the process of making a system available for international distribution via translation of the human-machine interface. For LabVIEW, that means the ability to easily change the text of controls and indicators on a front-panel depending on a selected language. To facilitate localization an example localization configuration editor and application specific interface is provided below.

      Installation

      The Localization Configuration Editor Example has three downloads.  

      lce_installer_101.zip installs the LCE executable which is used to create resource files.  It require LabVIEW 2009 runtime engine, but does not require the LabVIEW 2009 development environment.  After installing lce_installer_101 you can start the LCE executable by going to the Tools→Localization Configuration Editor in the LabVIEW menu, or the start menu for windows.

      lce_lib_installer_b.zip installs the reference library that is used to load and parse the resource files.  It requires LabVIEW 8.6.1 development environment.

      lce_source_101.zip includes the source code for the Localization Configuration Editor.  It requires LabVIEW 2009 development environment to view the code.

      Introduction

      The Localization Configuration Editor (LCE) is used during the development phase of an application that requires the support of multiple languages. The LCE is an editor which quickly and intuitively allows the developer to generate a resource file which carries the information to switch text between different languages. After a resource file is generated, the LCE API can be used to extract that information into your application.


      [+] Enlarge Image
      Figure 1:  Process to localize a Front Panels using the Localization Configuration Editor

      The LCE user interface is very intuitive and easy to use. Create, remove, and duplicate objects in the configuration by right-clicking in the tree control. Folders allow the user to organize resources in logical groups. You can edit objects in the configuration by selecting them in the tree control, and then changing their parameters on the right side of the window.


      [+] Enlarge Image
      Figure 2:  The Localization Configuration Editor User Interface

      Resource Configuration Development

      This section describes the basic operations of the LCE used to create or edit a resource file.

      Launching the LCE

      After installing the LCE executable, you may start it by going to the LabVIEW menu bar, and selecting Tools→Localization Configuration Editor. If you do not have LabVIEW installed, the LCE can be started by going to Start→All Programs→Localization Configuration Editor.

      Creating, Opening, and Saving a Localization Configuration

      A new localization configuration can be created using the Create New … button or the File menu. An existing configuration can be loaded from file using the Open… button or File menu. If a new configuration is created or an existing configuration is loaded while another configuration is already loaded in memory, the editor will unload the current configuration and prompt you to save any unsaved changes.

      The current configuration is saved using the Save button or the File menu. The current configuration can be saved in a different file using the Save As … option in the File menu.

      Creating and Editing Resources/Languages

      A resource is a collection of language translations of a single word or phrase.  Resources can be created by right-clicking on a Localization Root (the top-most item) or folders inside of the tree control and selecting Add→resource. Individual resources may be duplicated or removed via right-clicking on them and choosing the appropriate menu.

      Figure 3:  Resource Specific Settings

      A resource is selected by left-clicking on it in the tree control. Its settings, as well as the values of languages related to that resource, can be edited in the right side of the editor. These settings include name, description, and the translation depending on the selected language. Add/Removing of language support can be accomplished from the Operate menu. Adding or removing retroactively changes the language support on all existing resources.

      Deploying a Localization Configuration

      Sometimes you will want to use a resource file on a remote target, such as a touch panel or cRIO. To use a resource file in an application it must be deployed to the target system before resources can be loaded by the application. Typically the file is copied using FTP to the target system.

      If you make changes to a resource file in the process of developing an application you must re-deploy the files to your targets before running the application.

      LCE Application Programming Interface

      This example includes the VIs necessary to parse a resource file to easily switch between different languages, as well as resources. After installing the examples, these API VIs are located in the <user.lib> directory of your version of LabVIEW. They include two primary VIs which will be discussed in this article, and additional VIs in the utility palette which have context help.

      Load LCE Resource List is used to load our created resource file from a file path.  The resource information is stored in the functional global variable for later use by other API VIs.

      LCE Get Resource Value retrieves a resource value from a loaded resource file based upon the resource name and Language.  To improve the performance, the first read of the VI stores the resource information so that next time it does not need to look-up the resource again.  You can force a look-up with the optional input "Change Resource?".

      Source Code

      The Localiztion Configuration Editor is based on the Generic Configuration Editor (xCE) framework. For more information on the xCE framework consult the xCE documentation. The source code is provided as open source and may be edited and redistributed as such.

      Machine Control Reference Architecture

      Although the LCE was designed to localize any LabVIEW application, it was original designed for the Machine Control Reference Architecture. To better understand how it relates to the rest of the architecture review the documents describing the architecture and its components starting with A Reference Architecture for Local Machine Control.

      The following is a map of other documents that describe the machine control reference architecture.  You can click on the image to navigate directly to each document.

      Feedback

      This reference application was created by the NI Systems Engineering group. 

      We do not regularly monitor Reader Comments posted on this page.

      Please submit your feedback in the Reference Example for Localization Configuration Editor for LabVIEW discussion forum so that we can improve this component for future applications. 

      Please direct support questions to NI Technical Support.

      Requirements


      Filename: lce_installer_101.zip

      Software Requirements


      Application Software: LabVIEW Professional Development System 2009

       
      Filename: lce_source_101.zip

      Software Requirements


      Application Software: LabVIEW Professional Development System 2009

       
      Filename: lce_lib_installer_b.zip

      Software Requirements


      Application Software: LabVIEW Professional Development System 8.6.1

       
      2 ratings | 5.00 out of 5
      Print

      Reader Comments | Submit a comment »

       

      Legal
      This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).