Internationalization Guidelines for LabVIEW Applications

Internationalization is the practice of designing software in a way that lends the software to localization without requiring major reengineering. In general, internationalize LabVIEW code by avoiding block diagram logic that relies on user-facing strings or labels.

  • Be aware of items in your block diagram code that differ based on the language and locale. These formats include things like date and time formats, currency symbols, decimal separators, and so on.

    Besides translating strings on the front panel, you can use localized decimal separators when converting numbers to strings. Use the Format Date/Time String function to specify how to display the date and time.

  • Avoid user-facing string constants in your block diagram code; use string controls on the front panel instead.

    Localizing block diagram string constants might cause VIs to break. Breaking VIs is especially likely when block diagram string constants contain multibyte or UTF-8 characters.

  • On the front panel, use the caption to present localizable text for a control or indicator in the user interface instead of the label. Block diagram code interacts with a control or indicator based on the label. As a result, translating a label breaks block diagram code that references that label. In contrast, the caption is solely for presenting text to users, so you can translate captions without repercussions on code execution.

    Because you cannot localize control labels, controls also have captions. When exporting the VI strings into a text file, LabVIEW creates a caption for each control and substitutes the label with a caption on the front panel.

    For information about using captions, refer to Creating Captions.

  • To facilitate localization, use ring controls instead of enumerated type controls (enum controls) whenever possible. With enums, the user-facing string is inherent to the data type. As a result, translating enum values affects block diagram logic that relies on the enum. Ring controls are solely numeric on the block diagram, so you can translate ring items without affecting your code.
  • Avoid using Case structures that select cases based on user-facing string data. Using user-facing string data to select cases ties language-specific text to the programming logic of the Case structure. Consider an alternative input data type, such as a ring.
  • If your front panel includes images that have user-facing text, consider using a 2D Picture control to load locale-specific images. Using the 2D Picture control lets you load locale-specific images based on program logic. You can therefore avoid manually copying and pasting new images into your application when you make changes.
  • Be aware of text expansion on the front panel. A string with a certain meaning in one language does not necessarily have the same length as a string with that same meaning in another language. A translated string is often longer than the corresponding string in the original language. These differences in string length between languages is called text expansion. For VIs that you intend to localize, make design choices on the front panel that limit the impact of text expansion.