xHarbour Reference Documentation > Function Reference |
Queries or changes the current national language .
HB_LangSelect( [<cLanguageID>] ) --> cOldLanguageID
The function returns a character string identifying the national language selected before the function is called.
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 name | Code page | REQUEST symbol | <cLanguageID> | Source file |
---|---|---|---|---|
Basque | 850 | HB_LANG_EU | "EU" | msgeu.c |
Belorussian | 866 | HB_LANG_BY866 | "BY866" | msgby866.c |
Belorussian | Windows-1251 | HB_LANG_BYWIN | "BYWIN" | msgbywin.c |
Bulgarian | DOS-MIK | HB_LANG_BGMIK | "BGMIK" | msgbgmik.c |
Bulgarian | Windows-1251 | HB_LANG_BGWIN | "BGWIN" | msgbgwin.c |
Catalan | 850 | HB_LANG_CA | "CA" | msgca.c |
Chinese Simplified | 936 for ZH, | HB_LANG_ZHGB | "ZHGB" | msgzhgb.c |
ZH-CN, ZH-SG | ||||
Chinese Traditional | 950 for | HB_LANG_ZHB5 | "ZHB5" | msgzhb5.c |
ZH-HK, ZH-TW | ||||
Croatian | 1250 | HB_LANG_HR1250 | "HR1250" | msghr1250.c |
Croatian | 437 | HB_LANG_HR437 | "HR437" | msghr437.c |
Croatian | 852 | HB_LANG_HR852 | "HR852" | msghr852.c |
Croatian | ISO-8859-2 | HB_LANG_HRISO | "HRISO" | msghriso.c |
Czech | 852 | HB_LANG_CS852 | "CS852" | msgcs852.c |
Czech | ISO-8859-2 | HB_LANG_CSISO | "CSISO" | msgcsiso.c |
Czech | Kamenickych | HB_LANG_CSKAM | "CSKAM" | msgcskam.c |
Czech | 1250 | HB_LANG_CSWIN | "CSWIN" | msgcswin.c |
Dutch | 850 | HB_LANG_NL | "NL" | msgnl.c |
English | 437 | HB_LANG_EN | "EN" | msgen.c |
Esperanto | 850 | HB_LANG_EO | "EO" | msgeo.c |
French | 850 | HB_LANG_FR | "FR" | msgfr.c |
Galician | 850 | HB_LANG_GL | "GL" | msggl.c |
German | 850 | HB_LANG_DE | "DE" | msgde.c |
German WIN | ANSI | HB_LANG_DEWIN | "DEWIN" | msgdewin.c |
Hebrew - Dos | 862 | HB_LANG_HE862 | "HE862" | msghe862.c |
Hebrew - Windows | Windows-1255 | HB_LANG_HEWIN | "HEWIN" | msghewin.c |
Hungarian | 852 | HB_LANG_HU852 | "HU852" | msghu852.c |
Hungarian | CWI-2 | HB_LANG_HUCWI | "HUCWI" | msghucwi.c |
Hungarian | Windows-1 | HB_LANG_HUWIN | "HUWIN" | msghuwin.c |
Icelandic | 850 | HB_LANG_IS850 | "IS850" | msgis850.c |
Indonesian | 437 | HB_LANG_ID | "ID" | msgid.c |
Italian | 437 | HB_LANG_IT | "IT" | msgit.c |
Korean | 949 | HB_LANG_KO | "KO" | msgko.c |
Lithuanian | Windows-1257 | HB_LANG_LT | "LT" | msgltwin.c |
Polish | 852 | HB_LANG_PL852 | "PL852" | msgpl852.c |
Polish | ISO-8859-2 | HB_LANG_PLISO | "PLISO" | msgpliso.c |
Polish | Mazowia | HB_LANG_PLMAZ | "PLMAZ" | msgplmaz.c |
Polish | 1250 | HB_LANG_PLWIN | "PLWIN" | msgplwin.c |
Portuguese | 850 | HB_LANG_PT | "PT" | msgpt.c |
Romanian | 852 | HB_LANG_RO | "RO" | msgro.c |
Russian | 866 | HB_LANG_RU866 | "RU866" | msgru866.c |
Russian | KOI-8 | HB_LANG_RUKOI8 | "RUKOI8" | msgrukoi.c |
Russian | Windows-1251 | HB_LANG_RUWIN | "RUWIN" | msgruwin.c |
Serbian | Latin II 852 | HB_LANG_SR852 | "SR852" | msgsr852.c |
Serbian | ISO-8859-2 | HB_LANG_SRISO | "SRISO" | msgsriso.c |
Serbian | Windows-1251 | HB_LANG_SRWIN | "SRWIN" | msgsrwin.c |
Slovenian | Latin II 852 | HB_LANG_SL852 | "SL852" | msgsl852.c |
Slovenian | ISO-8859-2 | HB_LANG_SLISO | "SLISO" | msgsliso.c |
Slovenian | 1250 | HB_LANG_SLWIN | "SLWIN" | msgslwin.c |
Spanish | 850 | HB_LANG_ES | "ES" | msges.c |
Spanish WIN | ANSI | HB_LANG_ESWIN | "ESWIN" | msgeswin.c |
Ukrainian | 866 | HB_LANG_UA866 | "UA866" | msgua866.c |
Ukrainian | KOI-8U | HB_LANG_UAKOI8 | "UAKOI8" | msguakoi.c |
Ukrainian | Windows-1251 | HB_LANG_UAWIN | "UAWIN" | msguawin.c |
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 |
// 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
http://www.xHarbour.com