1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| ;@author : Progi1984
;@desc : Returns the current language of the system
ProcedureDLL.s System_GetCurrentLanguage()
Protected sLanguage.s
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Linux ;{
sLanguage = GetEnvironmentVariable("LANG")
;}
CompilerCase #PB_OS_MacOS ;{
; http://developer.apple.com/documentation/MacOSX/Conceptual/BPInternational/Articles/ChoosingLocalizations.html#//apple_ref/doc/uid/20002397-SW4
;}
CompilerCase #PB_OS_Windows ;{
#LOCALE_SISO639LANGNAME = 89
#LOCALE_SISO3166CTRYNAME = 90
Protected sBuffer.s
Protected lBufferLen.l = 1000
sBuffer=Space(lBufferLen)
GetLocaleInfo_(#LOCALE_SYSTEM_DEFAULT, #LOCALE_SISO639LANGNAME, sBuffer, lBufferLen)
sLanguage = sBuffer
sBuffer=Space(lBufferLen)
GetLocaleInfo_(#LOCALE_SYSTEM_DEFAULT, #LOCALE_SISO3166CTRYNAME, sBuffer, lBufferLen)
sLanguage + "." + sBuffer
;}
CompilerEndSelect
ProcedureReturn sLanguage
EndProcedure
Debug System_GetCurrentLanguage()
|