xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_LangSelect()

Queries or changes the current national language .

Syntax

HB_LangSelect( [<cLanguageID>] ) --> cOldLanguageID

Arguments

<cLanguageID>
This is a character string identifying the national language to select as current (see table below).

Return

The function returns a character string identifying the national language selected before the function is called.

Description

Function HB_LangSelect() queries and optionally changes the current national language used for functions returning constant character strings. Functions CDoW() or CMonth() are examples where return values differ by the national language.

By default, the English language is selected. In order to change the language, the corresponding module must be linked. That is, the symbolic names of the national languages to be available at runtime must be REQUESTed.

When the language module is linked, the language can be changed at runtime by passing the language identifier <cLanguageID> to HB_LangSelect(). The following table lists the REQUEST symbols and language identifiers available in xHarbour. Note that the code page must be set correctly with HB_SetCodePage() for the national languages as well.

National language support in xHarbour
Language nameCode pageREQUEST symbol<cLanguageID>Source file
Basque850HB_LANG_EU"EU"msgeu.c
Belorussian866HB_LANG_BY866"BY866"msgby866.c
BelorussianWindows-1251HB_LANG_BYWIN"BYWIN"msgbywin.c
BulgarianDOS-MIKHB_LANG_BGMIK"BGMIK"msgbgmik.c
BulgarianWindows-1251HB_LANG_BGWIN"BGWIN"msgbgwin.c
Catalan850HB_LANG_CA"CA"msgca.c
Chinese Simplified936 for ZH,HB_LANG_ZHGB"ZHGB"msgzhgb.c
 ZH-CN, ZH-SG   
Chinese Traditional950 forHB_LANG_ZHB5"ZHB5"msgzhb5.c
 ZH-HK, ZH-TW   
Croatian1250HB_LANG_HR1250"HR1250"msghr1250.c
Croatian437HB_LANG_HR437"HR437"msghr437.c
Croatian852HB_LANG_HR852"HR852"msghr852.c
CroatianISO-8859-2HB_LANG_HRISO"HRISO"msghriso.c
Czech852HB_LANG_CS852"CS852"msgcs852.c
CzechISO-8859-2HB_LANG_CSISO"CSISO"msgcsiso.c
CzechKamenickychHB_LANG_CSKAM"CSKAM"msgcskam.c
Czech1250HB_LANG_CSWIN"CSWIN"msgcswin.c
Dutch850HB_LANG_NL"NL"msgnl.c
English437HB_LANG_EN"EN"msgen.c
Esperanto850HB_LANG_EO"EO"msgeo.c
French850HB_LANG_FR"FR"msgfr.c
Galician850HB_LANG_GL"GL"msggl.c
German850HB_LANG_DE"DE"msgde.c
German WINANSIHB_LANG_DEWIN"DEWIN"msgdewin.c
Hebrew - Dos862HB_LANG_HE862"HE862"msghe862.c
Hebrew - WindowsWindows-1255HB_LANG_HEWIN"HEWIN"msghewin.c
Hungarian852HB_LANG_HU852"HU852"msghu852.c
HungarianCWI-2HB_LANG_HUCWI"HUCWI"msghucwi.c
HungarianWindows-1HB_LANG_HUWIN"HUWIN"msghuwin.c
Icelandic850HB_LANG_IS850"IS850"msgis850.c
Indonesian437HB_LANG_ID"ID"msgid.c
Italian437HB_LANG_IT"IT"msgit.c
Korean949HB_LANG_KO"KO"msgko.c
LithuanianWindows-1257HB_LANG_LT"LT"msgltwin.c
Polish852HB_LANG_PL852"PL852"msgpl852.c
PolishISO-8859-2HB_LANG_PLISO"PLISO"msgpliso.c
PolishMazowiaHB_LANG_PLMAZ"PLMAZ"msgplmaz.c
Polish1250HB_LANG_PLWIN"PLWIN"msgplwin.c
Portuguese850HB_LANG_PT"PT"msgpt.c
Romanian852HB_LANG_RO"RO"msgro.c
Russian866HB_LANG_RU866"RU866"msgru866.c
RussianKOI-8HB_LANG_RUKOI8"RUKOI8"msgrukoi.c
RussianWindows-1251HB_LANG_RUWIN"RUWIN"msgruwin.c
SerbianLatin II 852HB_LANG_SR852"SR852"msgsr852.c
SerbianISO-8859-2HB_LANG_SRISO"SRISO"msgsriso.c
SerbianWindows-1251HB_LANG_SRWIN"SRWIN"msgsrwin.c
SlovenianLatin II 852HB_LANG_SL852"SL852"msgsl852.c
SlovenianISO-8859-2HB_LANG_SLISO"SLISO"msgsliso.c
Slovenian1250HB_LANG_SLWIN"SLWIN"msgslwin.c
Spanish850HB_LANG_ES"ES"msges.c
Spanish WINANSIHB_LANG_ESWIN"ESWIN"msgeswin.c
Ukrainian866HB_LANG_UA866"UA866"msgua866.c
UkrainianKOI-8UHB_LANG_UAKOI8"UAKOI8"msguakoi.c
UkrainianWindows-1251HB_LANG_UAWIN"UAWIN"msguawin.c

Info

See also:HB_AnsiToOem(), HB_LangName(), HB_OemToAnsi(), HB_SetCodePage()
Category: Language specific , xHarbour extensions
Source:rtl\langapi.c, lang\msg*.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows the result of CDoW() depending
// on the selected national language

   REQUEST HB_LANG_ES             // Spanish language
   REQUEST HB_LANG_IT             // Italian language

   PROCEDURE Main

      ? HB_LangSelect()           // result: EN
      ? Cdow( Date() )            // result: Friday

      ? HB_LangSelect( "ES" )     // result: EN
      ? HB_LangSelect()           // result: ES
      ? CdoW( Date() )            // result: Viernes

      ? HB_LangSelect( "IT" )     // result: ES
      ? HB_LangSelect()           // result: IT
      ? CdoW( Date() )            // result: Venerdì

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe