forked from shadovvs/WotLK-Storyline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocales.lua
190 lines (173 loc) · 7.5 KB
/
locales.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
----------------------------------------------------------------------------------
-- Storyline
-- ---------------------------------------------------------------------------
-- Copyright 2015 Sylvain Cossement ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
----------------------------------------------------------------------------------
Storyline_API = {
lib = {},
};
Storyline_API.locale = {
--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-- LOCALE_EN
--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
["enUS"] = {
localeContent = {
SL_STORYLINE = "Storyline",
SL_SELECT_DIALOG_OPTION = "Select dialog option",
SL_SELECT_AVAILABLE_QUEST = "Select available quest",
SL_WELL = "Well ...",
SL_ACCEPTANCE = "I accept.",
SL_DECLINE = "I refuse.",
SL_NEXT = "Continue",
SL_CONTINUE = "Complete quest",
SL_NOT_YET = "Come back when it's done",
SL_CHECK_OBJ = "Check objectives",
SL_RESET = "Rewind",
SL_RESET_TT = "Rewind this dialogue.",
SL_REWARD_MORE = "You will also get",
SL_REWARD_MORE_SUB = "\nMoney: |cffffffff%s|r\nExperience: |cffffffff%s xp|r\n\n|cffffff00Click:|r Get your reward!",
SL_GET_REWARD = "Get your reward",
SL_SELECT_REWARD = "Select your reward",
SL_CONFIG = "Parameters",
SL_CONFIG_TEXTSPEED = "Text anim speed: %.1fx",
SL_CONFIG_TEXTSPEED_INSTANT = "No anim",
SL_CONFIG_TEXTSPEED_HIGH = "High",
SL_CONFIG_AUTOEQUIP = "Auto equip reward (experimental)",
SL_CONFIG_AUTOEQUIP_TT = "Auto equip rewards if it has a better item lvl.",
SL_CONFIG_FORCEGOSSIP = "Show flavor texts",
SL_CONFIG_FORCEGOSSIP_TT = "Show flavor texts on NPCs like merchants or fly masters.",
SL_CONFIG_HIDEORIGINALFRAMES = "Hide original frames",
SL_CONFIG_HIDEORIGINALFRAMES_TT = "Hide the original quest frame and NPC dialogs frame.",
SL_CONFIG_LOCKFRAME = "Lock frame",
SL_CONFIG_LOCKFRAME_TT = "Lock Storyline frame so it cannot be move by mistake.",
SL_RESIZE = "Resize",
SL_RESIZE_TT = "Drag and drop to resize",
}
},
--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-- LOCALE_FR
--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
["frFR"] = {
localeContent = {
SL_STORYLINE = "Storyline",
SL_SELECT_DIALOG_OPTION = "Sélectionnez une option",
SL_SELECT_AVAILABLE_QUEST = "Sélectionnez une quête",
SL_WELL = "Et bien ...",
SL_ACCEPTANCE = "J'accepte.",
SL_DECLINE = "Je refuse.",
SL_NEXT = "Continuer",
SL_CONTINUE = "Terminer la quête",
SL_NOT_YET = "Revenez quand cela sera fait",
SL_CHECK_OBJ = "Vérifier objectifs",
SL_RESET = "Début",
SL_RESET_TT = "Revenir au début du dialogue",
SL_REWARD_MORE = "Vous recevrez aussi",
SL_REWARD_MORE_SUB = "\nArgent: |cffffffff%s|r\nExpérience: |cffffffff%s xp|r\n\n|cffffff00Clic:|r Prenez votre récompense !",
SL_GET_REWARD = "Prenez votre récompense",
SL_SELECT_REWARD = "Choisissez votre récompense",
SL_CONFIG = "Configuration",
SL_CONFIG_TEXTSPEED = "Vitesse de défilement du texte: %.1fx",
SL_CONFIG_TEXTSPEED_INSTANT = "Pas de défilement",
SL_CONFIG_TEXTSPEED_HIGH = "Rapide",
SL_CONFIG_AUTOEQUIP = "Équipement automatique (expérimental)",
SL_CONFIG_AUTOEQUIP_TT = "Équipe automatiquement les récompense si elles ont un meilleur niveau d'équipement.",
SL_CONFIG_FORCEGOSSIP = "Afficher les textes d'introduction des PNJs",
SL_CONFIG_FORCEGOSSIP_TT = "Forcer l'affichage des textes d'introduction normalement masqués des PNJs, comme les marchands ou les maîtres de vol.",
SL_CONFIG_HIDEORIGINALFRAMES = "Cacher les fenêtres originales",
SL_CONFIG_HIDEORIGINALFRAMES_TT = "Cacher les fenêtres originales de quêtes et dialogues de PNJs.",
SL_RESIZE = "Redimensionner",
SL_RESIZE_TT = "Cliquer-glisser pour redimensionner",
}
},
}
local error, tostring = error, tostring;
local LOCALS = Storyline_API.locale;
local DEFAULT_LOCALE = GetLocale() == "frFR" and "frFR" or "enUS";
Storyline_API.locale.DEFAULT_LOCALE = DEFAULT_LOCALE;
local effectiveLocal = {};
local localeFont;
local current;
-- Initialize a locale for the addon.
function Storyline_API.locale.init()
-- Register config
current = Storyline_Data.config.locale or DEFAULT_LOCALE;
if not LOCALS[current] then
current = DEFAULT_LOCALE;
end
-- Pick the right font
if current == "zhCN" then
localeFont = "Fonts\\ZYKai_T.TTF";
elseif current == "ruRU" then
localeFont = "Fonts\\FRIZQT___CYR.TTF";
else
localeFont = "Fonts\\FRIZQT__.TTF";
end
effectiveLocal = LOCALS[current].localeContent;
Storyline_API.locale.localeFont = localeFont;
end
-- Return the localized text link to this key.
-- If the key isn't present in the current Locals table, then return the default localization.
-- If the key is totally unknown from TRP3, then an error will be lifted.
local function getText(key)
if effectiveLocal[key] or LOCALS[DEFAULT_LOCALE].localeContent[key] then
return effectiveLocal[key] or LOCALS[DEFAULT_LOCALE].localeContent[key];
end
error("Unknown localization key: ".. tostring(key));
end
Storyline_API.locale.getText = getText;
--CHANGE:Shadovv: SetClampedTextureRotation function was implemented in cataclysm
function SetClampedTextureRotation(texture, rotationDegrees)
if (rotationDegrees ~= 0 and rotationDegrees ~= 90 and rotationDegrees ~= 180 and rotationDegrees ~= 270) then
error("SetRotation: rotationDegrees must be 0, 90, 180, or 270");
return;
end
if not (texture.rotationDegrees) then
texture.origTexCoords = {texture:GetTexCoord()};
texture.origWidth = texture:GetWidth();
texture.origHeight = texture:GetHeight();
end
if (texture.rotationDegrees == rotationDegrees) then
return;
end
texture.rotationDegrees = rotationDegrees;
if (rotationDegrees == 0 or rotationDegrees == 180) then
texture:SetWidth(texture.origWidth);
texture:SetHeight(texture.origHeight);
else
texture:SetWidth(texture.origHeight);
texture:SetHeight(texture.origWidth);
end
if (rotationDegrees == 0) then
texture:SetTexCoord( texture.origTexCoords[1], texture.origTexCoords[2],
texture.origTexCoords[3], texture.origTexCoords[4],
texture.origTexCoords[5], texture.origTexCoords[6],
texture.origTexCoords[7], texture.origTexCoords[8] );
elseif (rotationDegrees == 90) then
texture:SetTexCoord( texture.origTexCoords[3], texture.origTexCoords[4],
texture.origTexCoords[7], texture.origTexCoords[8],
texture.origTexCoords[1], texture.origTexCoords[2],
texture.origTexCoords[5], texture.origTexCoords[6] );
elseif (rotationDegrees == 180) then
texture:SetTexCoord( texture.origTexCoords[7], texture.origTexCoords[8],
texture.origTexCoords[5], texture.origTexCoords[6],
texture.origTexCoords[3], texture.origTexCoords[4],
texture.origTexCoords[1], texture.origTexCoords[2] );
elseif (rotationDegrees == 270) then
texture:SetTexCoord( texture.origTexCoords[5], texture.origTexCoords[6],
texture.origTexCoords[1], texture.origTexCoords[2],
texture.origTexCoords[7], texture.origTexCoords[8],
texture.origTexCoords[3], texture.origTexCoords[4] );
end
end