Jump to content

Detect Language on a XP multilanguage


Recommended Posts

Hello

Sorry for my bad english.

I use the macro @OSLANG to determine the language of the computer where the user works.

But on a XP US with FR MUI pack or Spanish MUI pack, my value is always english (0409).

Who can'i detect the true computer lang for computers with XP US + multilanguage pack ?

Thanks for Help

If ProcessExists("saplogon.exe") Then
    
    ;French
    $m0_FR = "FR description for user "
    $m1_FR = "FR description for user "
    $m2_FR = "FR description for user "
    $m3_FR = "FR description for user "
    $m4_FR = "FR description for user "
    $m5_FR = "FR description for user "
    
    ;US, UK
    $m0_US = "EN description for user "
    $m1_US = "EN description for user "
    $m2_US = "EN description for user "
    $m3_US = "EN description for user "
    $m4_US = "EN description for user "
    $m5_US = "EN description for user "


Select
    Case @OSLang = "040C"
        $m0 = $m0_FR
        $m1 = $m1_FR
        $m2 = $m2_FR
        $m3 = $m3_FR
        $m4 = $m4_FR
        $m5 = $m5_FR
        $m6 = "Mise à jour SAP"
        $m7 = "10 secondes avant la fermeture de SAP"
    Case @OSLang = "0409"
        $m0 = $m0_US
        $m1 = $m1_US
        $m2 = $m2_US
        $m3 = $m3_US
        $m4 = $m4_US
        $m5 = $m5_US
        $m6 = "SAP Update"
        $m7 = "10 seconds before SAP shutdown"
EndSelect
Link to comment
Share on other sites

Hello

Sorry for my bad english.

I use the macro @OSLANG to determine the language of the computer where the user works.

But on a XP US with FR MUI pack or Spanish MUI pack, my value is always english (0409).

Who can'i detect the true computer lang for computers with XP US + multilanguage pack ?

Thanks for Help

If ProcessExists("saplogon.exe") Then
    
    ;French
    $m0_FR = "FR description for user "
    $m1_FR = "FR description for user "
    $m2_FR = "FR description for user "
    $m3_FR = "FR description for user "
    $m4_FR = "FR description for user "
    $m5_FR = "FR description for user "
    
    ;US, UK
    $m0_US = "EN description for user "
    $m1_US = "EN description for user "
    $m2_US = "EN description for user "
    $m3_US = "EN description for user "
    $m4_US = "EN description for user "
    $m5_US = "EN description for user "
Select
    Case @OSLang = "040C"
        $m0 = $m0_FR
        $m1 = $m1_FR
        $m2 = $m2_FR
        $m3 = $m3_FR
        $m4 = $m4_FR
        $m5 = $m5_FR
        $m6 = "Mise à jour SAP"
        $m7 = "10 secondes avant la fermeture de SAP"
    Case @OSLang = "0409"
        $m0 = $m0_US
        $m1 = $m1_US
        $m2 = $m2_US
        $m3 = $m3_US
        $m4 = $m4_US
        $m5 = $m5_US
        $m6 = "SAP Update"
        $m7 = "10 seconds before SAP shutdown"
EndSelect
Link to comment
Share on other sites

@OSLang detects the English OS - it is not looking at the language pack.

We use English XP with an optional French language pack.

I use this code:

$Lang_dll = DllOpen("kernel32.dll")

$UserIntLang=DllCall ( $Lang_dll, "int", "GetUserDefaultUILanguage" ) ;This result is an integer - need the hex equivalent

If @error=0 Then

$UserIntLang=Hex($UserIntLang[0],4) ;Convert to HEX

Else

;Unable to determine user interface language

$UserIntLang="UNKNOWN"

EndIf

DllClose($Lang_dll)

It returns $UserIntLang=0409 for English, 040C for the French interface, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...