Sign in to follow this  
Followers 0
ty2d

Multilingual Gui

4 posts in this topic

#1 ·  Posted (edited)

Hello,

i'm a newbie to autoit and right now i'm trying to make a admin tool which will help our helpdesk fullfilling their service to our customer.

because we've got several settlements here in the german region (the emea hq and the german hq) i want to make the gui multilingual (english and german) so if a user works on a english machine he'll get the english gui and on german machines the german gui.

my code for this looks like:

$strOsLanguage = @OSLang
$strLGerman = "0407"

If $strOsLanguage = $strLGerman Then
 #include <german.au3>
Else
 #include <english.au3>
EndIf

$mNetwork = GUICtrlCreateMenu ($_network_)              
   $msPing = GUICtrlCreateMenuitem ($_ping_, $mNetwork)         
   $msNetPerf = GUICtrlCreateMenuitem ($_netperf_, $mNetwork)           
$mSystem = GUICtrlCreateMenu ($_system_)                
   $msCmdPrompt = GUICtrlCreateMenuitem ($_cmd_, $mSystem)          
   $msComputer = GUICtrlCreateMenuitem ($_manage_, $mSystem)

The vars $_xxx_ are the language variables who are defined in the files german.au3 and english.au3 as Global Const. The If Else works, but the compiler gives me the following error message:

ERROR: $_network_ previously declared as a 'Const'

Global Const $_network_ = "Network"

$_ping_ previously declared as a 'Const'

Global Const $_ping_ = "Ping"

and so on

any hints for me? or is my approach wrong?

rgds

ty2d

Edited by ty2d

Share this post


Link to post
Share on other sites



you've declared those 2 variables as const

seems like autoit doesn't like that very much

you could do an ini-file instead of your 2 extra-scripts from where the gui gets the descriptions

deine 2 variablen haste zu konstanten gemacht - scheinbar findet das autoit net so toll

du könntest das ganze 2sprachige auch über ein ini-file machen dann sparst du dir die 2 extr-scripts hast allerdings ein ini-file mehr

Share this post


Link to post
Share on other sites

you've declared those 2 variables as const

seems like autoit doesn't like that very much

you could do an ini-file instead of your 2 extra-scripts from where the gui gets the descriptions

deine 2 variablen haste zu konstanten gemacht - scheinbar findet das autoit net so toll

du könntest das ganze 2sprachige auch über ein ini-file machen dann sparst du dir die 2 extr-scripts hast allerdings ein ini-file mehr

hm, could you give me an example how to do that?

Share this post


Link to post
Share on other sites

ah, ok, got it by myself.

thx for the help

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