vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --[[ |
2 | Name: Babble-Class-2.2 |
||
3 | Revision: $Rev: 14410 $ |
||
4 | Author(s): ckknight (ckknight@gmail.com) |
||
5 | Website: http://ckknight.wowinterface.com/ |
||
6 | Documentation: http://wiki.wowace.com/index.php/Babble-Class-2.2 |
||
7 | SVN: http://svn.wowace.com/root/trunk/Babble-2.2/Babble-Class-2.2 |
||
8 | Description: A library to provide localizations for classes. |
||
9 | Dependencies: AceLibrary, AceLocale-2.2 |
||
10 | ]] |
||
11 | |||
12 | local MAJOR_VERSION = "Babble-Class-2.2" |
||
13 | local MINOR_VERSION = tonumber(string.sub("$Revision: 14410 $", 12, -3)) |
||
14 | |||
15 | if not AceLibrary then error(MAJOR_VERSION .. " requires AceLibrary") end |
||
16 | |||
17 | if not AceLibrary:HasInstance("AceLocale-2.2") then error(MAJOR_VERSION .. " requires AceLocale-2.2") end |
||
18 | |||
19 | local _, x = AceLibrary("AceLocale-2.2"):GetLibraryVersion() |
||
20 | MINOR_VERSION = MINOR_VERSION * 100000 + x |
||
21 | |||
22 | if not AceLibrary:IsNewVersion(MAJOR_VERSION, MINOR_VERSION) then return end |
||
23 | |||
24 | local BabbleClass = AceLibrary("AceLocale-2.2"):new(MAJOR_VERSION) |
||
25 | |||
26 | -- uncomment below for debug information |
||
27 | -- BabbleClass:EnableDebugging() |
||
28 | |||
29 | BabbleClass:RegisterTranslations("enUS", function() |
||
30 | return { |
||
31 | ["Warlock"] = true, |
||
32 | ["Warrior"] = true, |
||
33 | ["Hunter"] = true, |
||
34 | ["Mage"] = true, |
||
35 | ["Priest"] = true, |
||
36 | ["Druid"] = true, |
||
37 | ["Paladin"] = true, |
||
38 | ["Shaman"] = true, |
||
39 | ["Rogue"] = true, |
||
40 | } |
||
41 | end) |
||
42 | |||
43 | BabbleClass:RegisterTranslations("deDE", function() |
||
44 | return { |
||
45 | ["Warlock"] = "Hexenmeister", |
||
46 | ["Warrior"] = "Krieger", |
||
47 | ["Hunter"] = "Jäger", |
||
48 | ["Mage"] = "Magier", |
||
49 | ["Priest"] = "Priester", |
||
50 | ["Druid"] = "Druide", |
||
51 | ["Paladin"] = "Paladin", |
||
52 | ["Shaman"] = "Schamane", |
||
53 | ["Rogue"] = "Schurke", |
||
54 | } |
||
55 | end) |
||
56 | |||
57 | BabbleClass:RegisterTranslations("frFR", function() |
||
58 | return { |
||
59 | ["Warlock"] = "D\195\169moniste", |
||
60 | ["Warrior"] = "Guerrier", |
||
61 | ["Hunter"] = "Chasseur", |
||
62 | ["Mage"] = "Mage", |
||
63 | ["Priest"] = "Pr\195\170tre", |
||
64 | ["Druid"] = "Druide", |
||
65 | ["Paladin"] = "Paladin", |
||
66 | ["Shaman"] = "Chaman", |
||
67 | ["Rogue"] = "Voleur", |
||
68 | } |
||
69 | end) |
||
70 | |||
71 | BabbleClass:RegisterTranslations("zhCN", function() |
||
72 | return { |
||
73 | ["Warlock"] = "术士", |
||
74 | ["Warrior"] = "战士", |
||
75 | ["Hunter"] = "猎人", |
||
76 | ["Mage"] = "法师", |
||
77 | ["Priest"] = "牧师", |
||
78 | ["Druid"] = "德鲁伊", |
||
79 | ["Paladin"] = "圣骑士", |
||
80 | ["Shaman"] = "萨满祭司", |
||
81 | ["Rogue"] = "盗贼", |
||
82 | } |
||
83 | end) |
||
84 | |||
85 | BabbleClass:RegisterTranslations("zhTW", function() |
||
86 | return { |
||
87 | ["Warlock"] = "術士", |
||
88 | ["Warrior"] = "戰士", |
||
89 | ["Hunter"] = "獵人", |
||
90 | ["Mage"] = "法師", |
||
91 | ["Priest"] = "牧師", |
||
92 | ["Druid"] = "德魯伊", |
||
93 | ["Paladin"] = "聖騎士", |
||
94 | ["Shaman"] = "薩滿", |
||
95 | ["Rogue"] = "盜賊", |
||
96 | } |
||
97 | end) |
||
98 | |||
99 | BabbleClass:RegisterTranslations("koKR", function() |
||
100 | return { |
||
101 | ["Warlock"] = "흑마법사", |
||
102 | ["Warrior"] = "전사", |
||
103 | ["Hunter"] = "사냥꾼", |
||
104 | ["Mage"] = "마법사", |
||
105 | ["Priest"] = "사제", |
||
106 | ["Druid"] = "드루이드", |
||
107 | ["Paladin"] = "성기사", |
||
108 | ["Shaman"] = "주술사", |
||
109 | ["Rogue"] = "도적", |
||
110 | } |
||
111 | end) |
||
112 | |||
113 | BabbleClass:Debug() |
||
114 | BabbleClass:SetStrictness(true) |
||
115 | |||
116 | function BabbleClass:GetColor(class) |
||
117 | self:argCheck(class, 2, "string") |
||
118 | if self:HasReverseTranslation(class) then |
||
119 | class = string.upper(self:GetReverseTranslation(class)) |
||
120 | else |
||
121 | class = string.upper(class) |
||
122 | end |
||
123 | if RAID_CLASS_COLORS and RAID_CLASS_COLORS[class] then |
||
124 | return RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b |
||
125 | end |
||
126 | return 0.63, 0.63, 0.63 |
||
127 | end |
||
128 | |||
129 | function BabbleClass:GetHexColor(class) |
||
130 | self:argCheck(class, 2, "string") |
||
131 | local r, g, b = self:GetColor(class) |
||
132 | return string.format("%02x%02x%02x", r * 255, g * 255, b * 255) |
||
133 | end |
||
134 | |||
135 | AceLibrary:Register(BabbleClass, MAJOR_VERSION, MINOR_VERSION) |
||
136 | BabbleClass = nil |