Language Helper

note

You only need four functions, one label and a variable with the Translations to make your script compatible with plenty languages.

Example

IniVar=
(
[lang]
actualLang=fr
possibleLangs=de,en,fr

[de]
MenulanguageTitel=Sprachauswahl
testvar =deutsch

[en]
MenulanguageTitel=Languages
testvar =english

[fr]
MenulanguageTitel=Language
testvar =francais

)
; ---------------------------------------------------------------------
LangHelp_LoadLanguageVars(IniVar,"updateLang")
; ---------------------------------------------------------------------

Gui,Add, text, vtestvar w300, testvar=%testvar%
Gui,Add, text,

; ---------------------------------------------------------------------
Menualt := LangHelp_showLangTrayMenu(possibleLangs, MenulanguageTitel)
LangHelp_showLangMenu(possibleLangs, MenulanguageTitel)
LangHelp_showLangRadioMenu(possibleLangs, actualLang)
; ---------------------------------------------------------------------

Gui,Show, ,Language - Sprache
Return

; ---------------------------------------------------------------------
updateLang:
GuiControl, ,testvar, testvar=%testvar%
return
; ---------------------------------------------------------------------

esc::
GuiEscape:
GuiClose:
ExitApp
Return

#include LangHelp.ahk
Summary
You only need four functions, one label and a variable with the Translations to make your script compatible with plenty languages.
Load Languagevars possibleLangs,actualLang from an ini-like Variable Sets a Label where you can update your Controls
Make a Bar from Radiobuttons
Make a Languagemenu
Make a Languagemenu

Functions

LangHelp_LoadLanguageVars(IniVar,”updatelabel”,MyMenuBarName=”MyMenu”)

Load Languagevars possibleLangs,actualLang from an ini-like Variable Sets a Label where you can update your Controls

Parameters

IniVarVariable like an ini-file
updatelabelLabel where you update your controls
MyMenuBarNameIf you want to set later a menubar

Returns

nothing

Remarks

IniVar must have the above format.  You can easily load inifiles with readfile updatelabel is a Label where you update your controls

Example

LangHelp_LoadLanguageVars(IniVar,"updatelabel")
LangHelp_LoadLanguageVars(IniVar,"updatelabel","MyMenuBar")

LangHelp_showLangRadioMenu(possibleLangs,possibleLangs)

Make a Bar from Radiobuttons

Parameters

possibleLangsStringvar like de,en,fr, ...
actualLangone of the above: de or en or fr

Remarks

nothing

Example

LangHelp_showLangRadioMenu(possibleLangs,possibleLangs)

LangHelp_showLangMenu(possibleLangs,possibleLangs)

Make a Languagemenu

Parameters

possibleLangsStringvar like de,en,fr, ...
actualLangone of the above: de or en or fr

Remarks

nothing

Example

LangHelp_showLangMenu(possibleLangs,possibleLangs)

LangHelp_showLangTrayMenu(possibleLangs,possibleLangs)

Make a Languagemenu

Parameters

possibleLangsStringvar like de,en,fr, ...
actualLangone of the above: de or en or fr

Remarks

nothing

Example

LangHelp_showLangTrayMenu(possibleLangs,possibleLangs)

The other functions and Labels in LangHelp.ahk are helpercode.

License

  • Version 0.0.0.1 by haichen