forked from fusionpit/WhatsTraining
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLocalization.lua
124 lines (117 loc) · 4.15 KB
/
Localization.lua
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
--[[ File meta info
@file Localization.lua
@brief Localization strings, translations and client locale check
--]]
--[[
@brief Accessing the addons private table
@var _ addonName, thrown away
@var wt Global addonTable
--]]
local _, wt = ...
-- Table of localized strings
local localeText = {
enUS = {
AVAILABLE_HEADER = "Available Now",
MISSINGREQS_HEADER = "Available but Missing Requirements",
NEXTLEVEL_HEADER = "Coming Soon",
NOTLEVEL_HEADER = "Not Yet Available",
MISSINGTALENT_HEADER = "Missing Required Talents",
KNOWN_HEADER = "Already Known",
COST_FORMAT = "Cost: %s",
TOTALCOST_FORMAT = "Total Cost: %s",
TOTALSAVINGS_FORMAT = "Total Savings: %s",
LEVEL_FORMAT = "Level %s",
TAB_TEXT = "What can I train?",
},
frFR = {
AVAILABLE_HEADER = "Disponible",
MISSINGREQS_HEADER = "Disponible mais pré-requis manquants",
NEXTLEVEL_HEADER = "Bientôt disponible",
NOTLEVEL_HEADER = "Pas encore disponible",
MISSINGTALENT_HEADER = "Talents requis manquants",
KNOWN_HEADER = "Déjà connu",
COST_FORMAT = "Coût : %s",
TOTALCOST_FORMAT = "Coût total : %s",
TOTALSAVINGS_FORMAT = "Coût économisé : %s",
LEVEL_FORMAT = "Niveau %s",
TAB_TEXT = "Que puis-je apprendre ?"
},
ruRU = {
AVAILABLE_HEADER = "Доступен сейчас",
MISSINGREQS_HEADER = "Доступно, но отсутствуют требования",
NEXTLEVEL_HEADER = "Скоро будет",
NOTLEVEL_HEADER = "Пока недоступно",
MISSINGTALENT_HEADER = "Отсутствующие необходимые таланты",
KNOWN_HEADER = "Уже известно",
COST_FORMAT = "Стоимость: %s",
TOTALCOST_FORMAT = "Общая стоимость: %s",
TOTALSAVINGS_FORMAT = "Все сбережения: %s",
LEVEL_FORMAT = "Уровень %s",
TAB_TEXT = "Что я могу изучить?"
},
zhCN = {
AVAILABLE_HEADER = "可学",
MISSINGREQS_HEADER = "满足条件方可学习",
NEXTLEVEL_HEADER = "即将学习",
NOTLEVEL_HEADER = "等级不够",
MISSINGTALENT_HEADER = "缺少相关天赋",
KNOWN_HEADER = "已学技能",
COST_FORMAT = "花费: %s",
TOTALCOST_FORMAT = "总花费: %s",
TOTALSAVINGS_FORMAT = "总共节省: %s",
LEVEL_FORMAT = "等级 %s",
TAB_TEXT = "我能学什么技能?"
},
zhTW = {
AVAILABLE_HEADER = "現在可以訓練",
MISSINGREQS_HEADER = "可以訓練但是缺少需求條件",
NEXTLEVEL_HEADER = "即將可以訓練",
NOTLEVEL_HEADER = "還不可以訓練",
MISSINGTALENT_HEADER = "缺少需要的天賦",
KNOWN_HEADER = "已學會",
COST_FORMAT = "花費: %s",
TOTALCOST_FORMAT = "總需花費: %s",
TOTALSAVINGS_FORMAT = "總共省下: %s",
LEVEL_FORMAT = "等級 %s",
TAB_TEXT = "我可以接受什麼訓練?"
},
deDE = {
AVAILABLE_HEADER = "Jetzt verfügbar",
MISSINGREQS_HEADER = "Verfügbar, aber fehlende Anforderungen",
NEXTLEVEL_HEADER = "Demnächst",
NOTLEVEL_HEADER = "Noch nicht verfügbar",
MISSINGTALENT_HEADER = "Fehlende Talente",
KNOWN_HEADER = "Bereits bekannt",
COST_FORMAT = "Kosten: %s",
TOTALCOST_FORMAT = "Gesamtkosten: %s",
TOTALSAVINGS_FORMAT = "Gesamtersparnis: %s",
LEVEL_FORMAT = "Level %s",
TAB_TEXT = "Was kann ich Lernen?"
},
koKR = {
AVAILABLE_HEADER = "지금 사용 가능",
MISSINGREQS_HEADER = "사용 가능하지만 누락된 요구 사항",
NEXTLEVEL_HEADER = "곧 사용 가능",
NOTLEVEL_HEADER = "아직 사용 불가",
MISSINGTALENT_HEADER = "필수 특성 누락",
KNOWN_HEADER = "이미 배움",
COST_FORMAT = "비용: %s",
TOTALCOST_FORMAT = "총 비용: %s",
TOTALSAVINGS_FORMAT = "총 절감: %s",
LEVEL_FORMAT = "레벨 %s",
TAB_TEXT = "무엇을 훈련할 수 있나요?"
}
}
-- Set "enUS" as default locale
wt.L = localeText["enUS"]
-- Get current locale from game client
local locale = GetLocale()
-- @brief Check if locale is enUS, enGB or nil
-- @return exit to skip localization if default locale
if (locale == "enUS" or locale == "enGB" or localeText[locale] == nil) then
return
end
-- @brief Localization of variables
for k, v in pairs(localeText[locale]) do
wt.L[k] = v
end