Language HelpernoteYou
only need four functions, one label and a variable with the
Translations to make your script compatible with plenty languages. ExampleIniVar= ( [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 | | | | | | |
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| IniVar | Variable like an ini-file | | updatelabel | Label where you update your controls | | MyMenuBarName | If you want to set later a menubar |
Returnsnothing RemarksIniVar
must have the above format. You can easily load inifiles with
readfile updatelabel is a Label where you update your controls ExampleLangHelp_LoadLanguageVars(IniVar,"updatelabel") LangHelp_LoadLanguageVars(IniVar,"updatelabel","MyMenuBar")
LangHelp_showLangRadioMenu(possibleLangs,possibleLangs)Make a Bar from Radiobuttons Parameters| possibleLangs | Stringvar like de,en,fr, ... | | actualLang | one of the above: de or en or fr |
Remarksnothing ExampleLangHelp_showLangRadioMenu(possibleLangs,possibleLangs)
LangHelp_showLangMenu(possibleLangs,possibleLangs)Make a Languagemenu Parameters| possibleLangs | Stringvar like de,en,fr, ... | | actualLang | one of the above: de or en or fr |
Remarksnothing ExampleLangHelp_showLangMenu(possibleLangs,possibleLangs)
LangHelp_showLangTrayMenu(possibleLangs,possibleLangs)Make a Languagemenu Parameters| possibleLangs | Stringvar like de,en,fr, ... | | actualLang | one of the above: de or en or fr |
Remarksnothing ExampleLangHelp_showLangTrayMenu(possibleLangs,possibleLangs)
The other functions and Labels in LangHelp.ahk are helpercode.
License- Version 0.0.0.1 by haichen
|