Sign in to follow this  
Followers 0
lafafmentvotre

Detect Language on a XP multilanguage

5 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

HELLO

Thank you for help, it's match very well

thank you

Share this post


Link to post
Share on other sites

Does this dll call will work on Vista too?

Share this post


Link to post
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
Sign in to follow this  
Followers 0