forked from 7plus/7plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Language.ahk
40 lines (39 loc) · 1011 Bytes
/
Language.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
This file contains language-related code
*/
Class CLanguages
{
Languages := {}
__New()
{
this.LoadLanguages()
}
LoadLanguages()
{
this.Languages.en := new CLanguage("en", "English", "")
this.Languages.fr := new CLanguage("fr", "Francais", "fr_")
}
GetCurrentLanguage()
{
return this.Languages[Settings.General.Language]
}
}
Class CLanguage
{
__New(ShortName, FullName, WikiPrefix)
{
this.ShortName := ShortName
this.FullName := FullName
this.WikiPrefix := WikiPrefix
this.Strings := Object()
}
LoadLocalizedStrings() ;Empty for now until localization kicks in
{
}
}
OpenWikiPage(Page, SkipTranslation = false)
{
global Languages
;run % "http://code.google.com/p/7plus/wiki/" (SkipTranslation ? "" : Languages.GetCurrentLanguage().WikiPrefix) Page, UseErrorLevel
run % "http://code.google.com/p/7plus/wiki/" Page, UseErrorLevel
}