Quantcast

Added some localization for deDE, zhCN and zhTW.

Salvatore Lopiparo [07-29-16 - 00:55]
Added some localization for deDE, zhCN and zhTW.
Filename
CanIMogIt.toc
code.lua
database.lua
localization.core.lua
localization.deDE.lua
localization.zhCN.lua
localization.zhTW.lua
options.lua
diff --git a/CanIMogIt.toc b/CanIMogIt.toc
index fbb39d6..58cfcaf 100644
--- a/CanIMogIt.toc
+++ b/CanIMogIt.toc
@@ -6,6 +6,10 @@
 ## X-Category: Transmogrify
 ## X-Website: http://mods.curse.com/addons/wow/can-i-mog-it
 ## SavedVariables: CanIMogItOptions, CanIMogItDatabase
+localization.core.lua
+localization.deDE.lua
+localization.zhCN.lua
+localization.zhTW.lua
 code.lua
 options.lua
 database.lua
diff --git a/code.lua b/code.lua
index c53998d..3179e75 100644
--- a/code.lua
+++ b/code.lua
@@ -1,5 +1,7 @@
 -- This file is loaded from "CanIMogIt.toc"

+local _, L = ...;
+
 CanIMogIt = {}

 CanIMogIt.DressUpModel = CreateFrame('DressUpModel')
@@ -147,18 +149,34 @@ local ORANGE = "|cffff9333"
 local YELLOW = "|cfff0e442"
 local GRAY =   "|cff888888"

-CanIMogIt.CAN_I_MOG_IT = 			"|cff00a3cc" .. " "
-CanIMogIt.KNOWN = 					KNOWN_ICON .. BLUE .. "Learned."
-CanIMogIt.KNOWN_FROM_ANOTHER_ITEM = KNOWN_ICON .. BLUE .. "Learned from another item."
-CanIMogIt.KNOWN_BY_ANOTHER_CHARACTER = KNOWN_BUT_ICON .. BLUE .. "Learned for a different class."
-CanIMogIt.KNOWN_BUT_TOO_LOW_LEVEL = KNOWN_BUT_ICON .. BLUE .. "Learned but cannot transmog yet."
-CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_BUT_TOO_LOW_LEVEL = KNOWN_BUT_ICON .. BLUE .. "Learned from another item but cannot transmog yet."
--- CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER = KNOWN_BUT_ICON .. BLUE .. "Learned for a different class and item."
-CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER = QUESTIONABLE_ICON .. YELLOW .. "Cannot determine status on other characters."
-CanIMogIt.UNKNOWN = 				UNKNOWN_ICON .. ORANGE .. "Not learned."
-CanIMogIt.UNKNOWABLE_BY_CHARACTER = UNKNOWABLE_BY_CHARACTER_ICON .. YELLOW .. "Another class can learn this item."
-CanIMogIt.UNKNOWABLE_BY_CHARACTER_SOULBOUND = UNKNOWABLE_BY_CHARACTER_ICON .. YELLOW .. "Cannot be learned by this character."
-CanIMogIt.NOT_TRANSMOGABLE = 		NOT_TRANSMOGABLE_ICON .. GRAY .. "Cannot be learned."
+
+local KNOWN = 										L["Learned."]
+local KNOWN_FROM_ANOTHER_ITEM = 					L["Learned from another item."]
+local KNOWN_BY_ANOTHER_CHARACTER = 					L["Learned for a different class."]
+local KNOWN_BUT_TOO_LOW_LEVEL = 					L["Learned but cannot transmog yet."]
+local KNOWN_FROM_ANOTHER_ITEM_BUT_TOO_LOW_LEVEL = 	L["Learned from another item but cannot transmog yet."]
+local KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER =       L["Learned for a different class and item."]
+local UNKNOWN = 									L["Not learned."]
+local UNKNOWABLE_BY_CHARACTER = 					L["Another class can learn this item."]
+local UNKNOWABLE_BY_CHARACTER_SOULBOUND = 			L["Cannot be learned by this character."]
+local CAN_BE_LEARNED_BY = 							L["Can be learned by:"] -- list of classes
+local NOT_TRANSMOGABLE = 							L["Cannot be learned."]
+local CANNOT_DETERMINE = 							L["Cannot determine status on other characters."]
+
+
+
+CanIMogIt.CAN_I_MOG_IT = 								"|cff00a3cc" .. " "
+CanIMogIt.KNOWN = 										KNOWN_ICON .. BLUE .. KNOWN
+CanIMogIt.KNOWN_FROM_ANOTHER_ITEM = 					KNOWN_ICON .. BLUE .. KNOWN_FROM_ANOTHER_ITEM
+CanIMogIt.KNOWN_BY_ANOTHER_CHARACTER = 					KNOWN_BUT_ICON .. BLUE .. KNOWN_BY_ANOTHER_CHARACTER
+CanIMogIt.KNOWN_BUT_TOO_LOW_LEVEL = 					KNOWN_BUT_ICON .. BLUE .. KNOWN_BUT_TOO_LOW_LEVEL
+CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_BUT_TOO_LOW_LEVEL = 	KNOWN_BUT_ICON .. BLUE .. KNOWN_FROM_ANOTHER_ITEM_BUT_TOO_LOW_LEVEL
+-- CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER = 	KNOWN_BUT_ICON .. BLUE .. KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER
+CanIMogIt.KNOWN_FROM_ANOTHER_ITEM_AND_CHARACTER = 		QUESTIONABLE_ICON .. YELLOW .. CANNOT_DETERMINE
+CanIMogIt.UNKNOWN = 									UNKNOWN_ICON .. ORANGE .. UNKNOWN
+CanIMogIt.UNKNOWABLE_BY_CHARACTER = 					UNKNOWABLE_BY_CHARACTER_ICON .. YELLOW .. UNKNOWABLE_BY_CHARACTER
+CanIMogIt.UNKNOWABLE_BY_CHARACTER_SOULBOUND = 			UNKNOWABLE_BY_CHARACTER_ICON .. YELLOW .. UNKNOWABLE_BY_CHARACTER_SOULBOUND
+CanIMogIt.NOT_TRANSMOGABLE = 							NOT_TRANSMOGABLE_ICON .. GRAY .. NOT_TRANSMOGABLE


 local knownTexts = {
diff --git a/database.lua b/database.lua
index a358f96..aaa3dc8 100644
--- a/database.lua
+++ b/database.lua
@@ -11,6 +11,7 @@
         The Transmog collection is updated.
 ]]

+local _, L = ...;

 local Database = {}
 CanIMogIt.Database = Database
diff --git a/localization.core.lua b/localization.core.lua
new file mode 100644
index 0000000..2ad0121
--- /dev/null
+++ b/localization.core.lua
@@ -0,0 +1,13 @@
+--[[
+    Check http://wow.gamepedia.com/Localizing_an_addon for how this works.
+]]
+
+local addonName, L = ...; -- Let's use the private table passed to every .lua file to store our locale
+local function defaultFunc(L, key)
+    -- If this function was called, we have no localization for this key.
+    -- We could complain loudly to allow localizers to see the error of their ways,
+    -- but, for now, just return the key as its own localization.
+    -- This allows you to—avoid writing the default localization out explicitly.
+    return key;
+end
+setmetatable(L, {__index=defaultFunc});
\ No newline at end of file
diff --git a/localization.deDE.lua b/localization.deDE.lua
new file mode 100644
index 0000000..5e8fa1d
--- /dev/null
+++ b/localization.deDE.lua
@@ -0,0 +1,32 @@
+-- Thanks to BJockeyR
+
+local _, L = ...;
+if GetLocale() == "deDE" then
+    -- Tooltips
+    L["Learned."] = "Bereits erlernt."
+    L["Learned from another item."] =  "Von einem anderen Gegenstand erlernt."
+    L["Learned for a different class."] = "Von einer anderen Klasse erlernt."
+    L["Learned but cannot transmog yet."] = "Bereits erlernt, aber noch nicht zum transmogrifizieren verwendbar."
+    -- L["Learned from another item but cannot transmog yet."] = ""
+    L["Learned for a different class and item."] = "Von einer anderen Klasse oder einem anderen Gegenstand erlernt."
+    L["Not learned."] = "Nicht erlernt."
+    L["Another class can learn this item."] = "Eine andere Klasse kann diese Vorlage erlernen."
+    -- L["Cannot be learned by this character."] = ""
+    -- L["Can be learned by:"] = "" -- list of classes
+    L["Cannot be learned."] = "Kann nicht erlernt werden."
+    -- L["Cannot determine status on other characters."] = ""
+
+    -- Messages
+    -- L["CanIMogItOptions not found, loading defaults!"] = ""
+    -- L["Can I Mog It? Important Message: Please log into all of your characters to compile complete transmog appearance data."] = ""
+
+    -- Options
+    -- L["Debug Tooltip"] = ""
+    -- L["Detailed information for debug purposes. Use this when sending bug reports."] = ""
+    -- L["Equippable Items Only"] = ""
+    -- L["Only show on items that can be equipped."] = ""
+    -- L["Transmoggable Items Only"] = ""
+    -- L["Only show on items that can be transmoggrified."] = ""
+    -- L["Unknown Items Only"] = ""
+    -- L["Only show on items that you haven't learned."] = ""
+end
diff --git a/localization.zhCN.lua b/localization.zhCN.lua
new file mode 100644
index 0000000..206b2e5
--- /dev/null
+++ b/localization.zhCN.lua
@@ -0,0 +1,32 @@
+-- Thanks to missing2014
+
+local _, L = ...;
+if GetLocale() == "znCN" then
+    -- Tooltips
+    L["Learned."] = "已解锁."
+    L["Learned from another item."] =  "已解锁-来自同模型装备."
+    L["Learned for a different class."] = "其他角色已解锁."
+    L["Learned but cannot transmog yet."] = "已解锁但不能幻化."
+    -- L["Learned from another item but cannot transmog yet."] = ""
+    -- L["Learned for a different class and item."] = ""
+    L["Not learned."] = "未解锁."
+    -- L["Another class can learn this item."] = ""
+    L["Cannot be learned by this character."] = "使用其他角色解锁."
+    -- L["Can be learned by:"] = "" -- list of classes
+    L["Cannot be learned."] = "不能解锁."
+    L["Cannot determine status on other characters."] = "无法确认其他角色的状态."
+
+    -- Messages
+    -- L["CanIMogItOptions not found, loading defaults!"] = ""
+    -- L["Can I Mog It? Important Message: Please log into all of your characters to compile complete transmog appearance data."] = ""
+
+    -- Options
+    -- L["Debug Tooltip"] = ""
+    -- L["Detailed information for debug purposes. Use this when sending bug reports."] = ""
+    -- L["Equippable Items Only"] = ""
+    -- L["Only show on items that can be equipped."] = ""
+    -- L["Transmoggable Items Only"] = ""
+    -- L["Only show on items that can be transmoggrified."] = ""
+    -- L["Unknown Items Only"] = ""
+    -- L["Only show on items that you haven't learned."] = ""
+end
diff --git a/localization.zhTW.lua b/localization.zhTW.lua
new file mode 100644
index 0000000..3f9e70e
--- /dev/null
+++ b/localization.zhTW.lua
@@ -0,0 +1,32 @@
+-- Thanks to missing2014
+
+local _, L = ...;
+if GetLocale() == "znTW" then
+    -- Tooltips
+    L["Learned."] = "已解鎖."
+    L["Learned from another item."] =  "已解鎖-來自同模型裝備."
+    L["Learned for a different class."] = "其他角色已解鎖."
+    L["Learned but cannot transmog yet."] = "已解鎖但不能幻化."
+    -- L["Learned from another item but cannot transmog yet."] = ""
+    -- L["Learned for a different class and item."] = ""
+    L["Not learned."] = "未解鎖."
+    -- L["Another class can learn this item."] = ""
+    L["Cannot be learned by this character."] = "使用其他角色解鎖."
+    -- L["Can be learned by:"] = "" -- list of classes
+    L["Cannot be learned."] = "不能解鎖."
+    L["Cannot determine status on other characters."] = "無法確認其他角色的狀態."
+
+    -- Messages
+    -- L["CanIMogItOptions not found, loading defaults!"] = ""
+    -- L["Can I Mog It? Important Message: Please log into all of your characters to compile complete transmog appearance data."] = ""
+
+    -- Options
+    -- L["Debug Tooltip"] = ""
+    -- L["Detailed information for debug purposes. Use this when sending bug reports."] = ""
+    -- L["Equippable Items Only"] = ""
+    -- L["Only show on items that can be equipped."] = ""
+    -- L["Transmoggable Items Only"] = ""
+    -- L["Only show on items that can be transmoggrified."] = ""
+    -- L["Unknown Items Only"] = ""
+    -- L["Only show on items that you haven't learned."] = ""
+end
diff --git a/options.lua b/options.lua
index d922d62..91db761 100644
--- a/options.lua
+++ b/options.lua
@@ -3,9 +3,9 @@
 -- Thanks to Stanzilla and Semlar and their addon AdvancedInterfaceOptions, which I used as reference.

 local _G = _G
+local _, L = ...;

-local CREATE_DATABASE_TEXT = [[|cff15abffCan I Mog It? |cffff9333Important Message:
-|cfff0e442Please log into all of your characters for about 30 seconds to compile complete transmog appearance data.]]
+local CREATE_DATABASE_TEXT = L["Can I Mog It? Important Message: Please log into all of your characters to compile complete transmog appearance data."]

 StaticPopupDialogs["CANIMOGIT_NEW_DATABASE"] = {
   text = CREATE_DATABASE_TEXT,
@@ -31,20 +31,20 @@ CanIMogItOptions_Defaults = {

 CanIMogItOptions_DisplayData = {
     ["debug"] = {
-        ["displayName"] = "Debug Tooltip",
-        ["description"] = "Detailed information for debug purposes. Use this when sending bug reports.",
+        ["displayName"] = L["Debug Tooltip"],
+        ["description"] = L["Detailed information for debug purposes. Use this when sending bug reports."],
     },
     ["showEquippableOnly"] = {
-        ["displayName"] = "Equippable Items Only",
-        ["description"] = "Only show on items that can be equipped."
+        ["displayName"] = L["Equippable Items Only"],
+        ["description"] = L["Only show on items that can be equipped."]
     },
     ["showTransmoggableOnly"] = {
-        ["displayName"] = "Transmoggable Items Only",
-        ["description"] = "Only show on items that can be transmoggrified."
+        ["displayName"] = L["Transmoggable Items Only"],
+        ["description"] = L["Only show on items that can be transmoggrified."]
     },
     ["showUnknownOnly"] = {
-        ["displayName"] = "Unknown Items Only",
-        ["description"] = "Only show on items that you haven't learned."
+        ["displayName"] = L["Unknown Items Only"],
+        ["description"] = L["Only show on items that you haven't learned."]
     },
 }

@@ -133,7 +133,7 @@ function CanIMogIt.frame.Loaded()
     -- Set the Options from defaults.
     if (not CanIMogItOptions) then
         CanIMogItOptions = CanIMogItOptions_Defaults.options
-        print("CanIMogItOptions not found, loading defaults!")
+        print(L["CanIMogItOptions not found, loading defaults!"])
     end
     -- if (not CanIMogItDatabase) then
     --     CanIMogItDatabase = {}