LW Light Info 2 Info Messages Globals Table of Contents

"Locale Info"

Availability:  LightWave 5.5 (250) - 6.0, Inspire 1.0 (250)
Component:  Layout, Modeler

The locale info global returns a code indicating the (human) language setting of the system.

Global Call

   unsigned long locinfo;
   locinfo = ( unsigned long ) global( "Locale Info", GFUSE_TRANSIENT );

The global function ordinarily returns a void *, so this should be cast to an integer type to get the return value.

The language ID is in the low 16 bits of the return value. The high 16 bits are reserved for future use. The language ID can be extracted using a macro defined in lwhost.h.

   langid = locinfo & LWLOC_LANGID;

The language IDs are identical to those defined in the Microsoft Win32 API and exposed in the Microsoft Visual C++ winnt.h header file. Bits 7 - 0 define the language group and bits 15 - 8 define the sublanguage. The plug-in SDK header file lwserver.h contains symbols for some of the more common language IDs.

   LANGID_GERMAN      0x0407
   LANGID_USENGLISH   0x0409
   LANGID_UKENGLISH   0x0809
   LANGID_SPANISH     0x040a
   LANGID_FRENCH      0x040c
   LANGID_ITALIAN     0x0410
   LANGID_JAPANESE    0x0411
   LANGID_RUSSIAN     0x0419
   LANGID_SWEDISH     0x041D

Note that the low order bits for USENGLISH and UKENGLISH are the same. Win32 defines 9 flavors of English (as well as 16 flavors of both Arabic and Spanish, for example) that are distinguished by sublanguage code.

Your plug-in isn't required to implement localization, but even if you don't provide error messages or panel text in multiple languages, you may still want to localize things like date formats or currency symbols.