changeset 65:60871b43531d

Add localization
author contrebasse
date Fri, 13 May 2011 02:17:52 +0200
parents 4d0ec5b598d0
children 2ca04183f5f9
files ReagentMaker.lua ReagentMaker.toc SecureMenu.lua localization.lua utils.lua
diffstat 5 files changed, 31 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ReagentMaker.lua	Wed May 11 19:03:02 2011 +0200
+++ b/ReagentMaker.lua	Fri May 13 02:17:52 2011 +0200
@@ -129,7 +129,7 @@
 	if #(A.data[reagentID]) == 1 and not A.data[reagentID].spell then
 		local numMakable, reagentIndex = A.numMakable(reagentID)
 		if not numMakable then
-			A.Error("The recipe to make the reagent seems to be hidden, it is not makable.")
+			A.Error(L["The recipe to make the reagent seems to be hidden, it is not makable."])
 			return
 		end
 		if numMakable>0 then
@@ -142,7 +142,7 @@
 		if (not A.data[reagentID].manyReagents) and A.data[A.data[reagentID][1][1]] then
 			A.externalCraftWindow(A.data[reagentID][1][1],reagentID)
 		else
-			A.Error("You do not have enough reagents to craft ["..(GetItemInfo(reagentID) or "item #"..reagentID).."]")
+			A.Error(L["You do not have enough reagents to craft [%s]"]:format(GetItemInfo(reagentID) or "item #"..reagentID))
 		end
 		return
 	else
@@ -224,7 +224,7 @@
 		A.tooltipRecipe:SetPoint("BOTTOMLEFT",GameTooltip,"BOTTOMRIGHT")
 	else
 		-- Shouldn't happend, but just in case...
-		A.Error("Recipe link not found for "..reagentID)
+		A.Error(L["Recipe link not found for %s"]:format(reagentID))
 	end
 end
 
--- a/ReagentMaker.toc	Wed May 11 19:03:02 2011 +0200
+++ b/ReagentMaker.toc	Fri May 13 02:17:52 2011 +0200
@@ -4,6 +4,8 @@
 ## Version: @project-version@
 ## Notes: Creates reagents easily
 
+localization.lua
+
 utils.lua
 data.lua
 SecureMenu.lua
--- a/SecureMenu.lua	Wed May 11 19:03:02 2011 +0200
+++ b/SecureMenu.lua	Fri May 13 02:17:52 2011 +0200
@@ -195,7 +195,7 @@
 end
 
 local function WarnNotMakable(btn)
-	A.Error("You do not have enough ["..btn.itemNameString.."] to craft ["..TitleText:GetText().."]")
+	A.Error(L["You do not have enough [%s] to craft [%s]"]:format(btn.itemNameString,TitleText:GetText()))
 end
 
 -- Update counts and button actions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/localization.lua	Fri May 13 02:17:52 2011 +0200
@@ -0,0 +1,24 @@
+local addonName, A = ...
+
+local L = setmetatable({}, {
+	__index = function(self, key)
+		return tostring(key)
+	end,
+})
+A.L = L
+
+--@debug@
+L["Recipe link not found for %s"] = "Recipe link not found for %s"
+L["The recipe to make the reagent seems to be hidden, it is not makable."] = "The recipe to make the reagent seems to be hidden, it is not makable."
+L["You do not have enough [%s] to craft [%s]"] = "You do not have enough [%s] to craft [%s]"
+L["You do not have enough reagents to craft [%s]"] = "You do not have enough reagents to craft [%s]"
+--@end-debug@
+
+--@localization(locale="enUS", format="lua_additive_table", handle-unlocalized="english")@
+
+local locale = GetLocale()
+if locale == 'frFR' then
+
+--@localization(locale="frFR", format="lua_additive_table", handle-unlocalized="comment")@
+
+end
\ No newline at end of file
--- a/utils.lua	Wed May 11 19:03:02 2011 +0200
+++ b/utils.lua	Fri May 13 02:17:52 2011 +0200
@@ -67,7 +67,7 @@
 				end -- if
 			end -- if
 		end -- for
-		--A.Error("Tradeskill not found for "..itemID..", is the recipe hidden ?")
+		--A.Error(L["Tradeskill not found for %d, is the recipe hidden ?"]:format(itemID))
 	end -- function
 end -- do