SupportJPG
  Support Home   |   Search   |   Documentation
ArticleId = kb000216

HOWTO: Retrieve Local Language - Locale ID - from AVR

The information in this article applies to:

    • ASNA Visual RPG, Release 3.5 and higher
    • Windows

SUMMARY:

This article will discuss a way in which you can obtain the Local Language Locale ID for a Windows System from an AVR application.

MORE INFORMATION:

NOTE:  These methods listed below are examples.  There might be other methods in which this feature can be incorporated into an AVR application that is not mentioned in this article.

This example illustrates a  method to find the users language. We will find the registry value that holds a hex value that tells us what language is used.  Then we can compare the value against a list and retrieve the language.

Note: This example is tailored for AVR 3.5 which incorporates a Registry Control.

TIP:  You can also use a third party registry control instead of the AVR 3.5 Registry control supplied.  This third party registry control can read registry properties.  You will need to refer to the third party control's documentation or ASNA's Object Browser for example code.

Figure 1 shows the example form:

Figure 1

You will have to draw a button on a form and call it "btnExit", two IoFields, and some labels.

Figure 2 displays the example code required.

DCLFLD name(Language) Type(*String)
DCLFLD Result TYPE(*String)
DCLFLD BaseKey TYPE(*Integer) LEN(4) // Valid values are defined by the vxRegBaseKey enumeration.
DCLFLD KeyName TYPE(*String)
DCLFLD ValueName TYPE(*String)
DCLFLD DefaultValue TYPE(*String)

// Find Registry Value for Locale Key
Result = *App.GetStringValue(2, 'SYSTEM\ControlSet001\Control\Nls\Locale','(default)')

// These are Microsoft standard locale IDs (LCID) values listed at:
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsmscLCID.asp
// Have fun!

iofield2.text = result

If result = "00000409"        //hex value is 0x0409
    Language = "English (United States)"
ENDIF

If result = "00000412"
    Language = "Korean"
ENDIF

iofield1.text = Language

BEGSR btnExit Click
  unload *thisform
ENDSR

Figure 2

Note the use of reading the registry to obtain the System's Locale.  You can look at other methods, events, properties for the Registry Control Object using ASNA's Object Browser.

Other ASNA KB Articles:

Other Microsoft Articles:

Keywords: LCID, Locale ID, example, client, develop, IDE, runtime, Code Page, CCSID

Last Modified Date: 1/23/2002 3:21:11 PM

Copyright © 2005, 2006 ASNA Inc.

  Support Home   |   Search   |   Documentation