This tiny actions plugin (just 90 KB for Lua 5.1) allows you to determine the language of the operating system your application is running on. The action return a table with the Language ID codes as used in AutoPlay Media Studio or Setup Factory.
The default action System.GetDefaultLangID() returns the primary and secondary language as adjusted in the "Current language for non-Unicode programs" setting, the system locale, found in the Control Panel, under Region and Language > Administrative:
This plugin complements the former action, adding two new functions to check for the original language of Windows when it was installed (the "install language"), and the current display language, if a language pack was applied and is selected for the current user.
This sample shows that the regional settings are adjusted for Brazilian Portuguese (primary language id 22, secondary language id 1), however the display language is US-English (primary language id 9, secondary 1).
This other sample shows that the regional settings are adjusted again for Portuguese (22), the original installation language of Windows was English (9), and the language currently being used for the user interface is German (primary language id 7, secondary language 1). It is up to you to decide which of the three available language codes should be used to determine which language to use in your application.
It is required to set the system locale to the same language of the text you are attempting to show in Input fields, Comboboxes or Listboxes. These Windows controls may not show the captions correctly if the display language and system locale are using different charsets. For example, using a system locale of 9 (English) and a display language set to 25 (Russian) does not work, as these languages are not using the same charsets (one uses Cyrillic, the other the Western alphabet). To avoid this kind of problem, System.GetDefaultLangID() use the system locale, and not the installation or display language.
Don't have Setup Factory?
If you want to purchase a license for Setup Factory 9, now is a good time! You can get 10% off the list price simply by clicking the banner below: