Skip to content

JKISoftware/JKI-Simple-Localization

Repository files navigation

Do you have JKI Simple Localization questions, ideas, or challenges you'd like discuss? Join the conversation happening in the JKI Simple Localization Community Forum.

JKI Simple Localization

A very simple LabVIEW toolkit for localizing VI front panels, based on a dictionary translation file.

Image Image LabVIEW Version Windows OS

This toolkit makes use of the "Language for non-Unicode programs" setting in Windows (located in the "Region and Language" settings). The toolkit uses a JSON dictionary file (can be in Unicode format) to store phrases in several different languages. The toolkit will translate from the default language (typically English) to the target language specified as the "Language for non-Unicode programs" in Windows.

It does all this by making calls into the Windows API to translate the Unicode 16-bit characters from the dictionary into 8-bit non-unicode characters that can be displayed by non-Unicode program (assuming the "Language for non-Unicode programs" has been properly set in Windows).

In this way, LabVIEW developers have a simple way to localize their applications, even though LabVIEW does not support Unicode, out-of-the-box.

Installation

You can download and install JKI Simple Localization with VI Package Manager.

Get JKI Simple Localization

Requirements

  • LabVIEW 2017 or greater
  • Windows 7 or greater
  • VIPM 2017 or greater

Usage

IMPORTANT: For this library to work, you must first set the "Language for non-Unicode Programs" to the target language you wish to translate into. See instructions here

This library has just a handful of simple VIs required for use:

  • Initialize - Loads a dictionary file.
  • Set Language - Sets/changes the desired target language all registered VIs.
  • Register VI - Registers a VI whose front panel will be localized to the target language any time Set Language is called.
  • Set Language (By VI) - Sets/changes the desired target language of the VI without adding it to the registry.
  • Get Localized Phrase - Allows translating a phrase from the default language to the target language, which is helpful for passing text in the default (programmers language) programmatically to dialogs (which should be displayed in the target/translated language).
  • Get Languages - Gets all languages configured in the dictionary file.
  • Generate Dictionary - Generates a dictionary file using the localizable text shown on the VIs in the current language. The file will need to be updated to include all additional languages.

NOTE: This library uses key value pairs to localize phrases. By default, control and indicator labels are used as the key to localize the caption, which should be shown instead of labels.

Palette

SimpleLocalizationPalette

Examples

See the Localization Demo VI on the Functions >> JKI Tools >> JKI Simple Localization palette.

LocalizationDemoPalette

Run the VI and then choose a target language from the drop-down list.

English

Example_english

Dutch

Example_dutch

Chinese

Example_chinese

Dictionary file

The dictionary file uses JSON format to list the languages, font information for each language, and key-value pairs linking each key to a set or localized phrases in each language in the dictionary.

Example Dictionary File

A formatted dictionary file can be generated from a VI front panel by going to Tools >> JKI Simple Localization Palette >> Localize This VI... See instructions here

Support

If you encounter incorrect or undocumented behavior or would like to file a new feature request, you can do so by filing a new issue on GitHub. For paid customized support, please contact JKI.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

To contribute to JKI Simple Localization, you will need 32-bit LabVIEW 2017 professional development environment.

Credits

JKI Simple Localization is an open source project maintained by JKI.

License

JKI Simple Localization is distributed under the open source three clause BSD license providing everyone right to use and distribute both souce code and compiled versions of the software. See LICENSE.md file for details.

About

A very simple and basic LabVIEW toolkit for localizing VI front panels

Resources

License

Stars

Watchers

Forks

Packages

No packages published