Quantcast

Localized the event strings for profession and reputation changes

Kevin Lyles [06-18-11 - 14:44]
Localized the event strings for profession and reputation changes
Filename
Locales/enUS/base.lua
WeightsWatcher.lua
diff --git a/Locales/enUS/base.lua b/Locales/enUS/base.lua
index ad27b5f..b4a8148 100644
--- a/Locales/enUS/base.lua
+++ b/Locales/enUS/base.lua
@@ -152,6 +152,9 @@ L["Quiver"] = "Quiver"
 L["Gem"] = "Gem"
 L["Consumable"] = "Consumable"
 L["Recipe"] = "Recipe"
+L["PROF_SKILL_UP"] = "^Your skill in ([A-Z][A-Za-z '-]+) has increased to (%d+)%.$"
+L["REP_CHANGE"] = "^Reputation with ([A-Z][A-Za-z '-]+) ([di][en]creased) by (%d+)%.$"
+L["increased"] = "increased"

 -- weights.lua
 L["Discard"] = "Discard"
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index 6d2551a..7d30ecd 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -327,7 +327,7 @@ function WeightsWatcher:eventHandler(event, message, ...)
 		WeightsWatcher.player.level = tonumber(message)
 	elseif event == "CHAT_MSG_SKILL" then
 		-- "Your skill in x has increased to y."
-		local skill, level = message:match("^Your skill in ([A-Z][A-Za-z '-]+) has increased to (%d+)%.$")
+		local skill, level = message:match(L["PROF_SKILL_UP"])
 		if skill then
 			if WeightsWatcher.player.professions[skill] then
 				WeightsWatcher.player.professions[skill] = tonumber(level)
@@ -339,7 +339,7 @@ function WeightsWatcher:eventHandler(event, message, ...)
 		end
 	elseif event == "CHAT_MSG_COMBAT_FACTION_CHANGE" then
 		-- "Reputation with X (in|de)creased by y."
-		local faction, direction, reputation = message:match("^Reputation with ([A-Z][A-Za-z '-]+) ([di][en]creased) by (%d+)%.$")
+		local faction, direction, reputation = message:match(L["REP_CHANGE"])
 		if faction then
 			if not WeightsWatcher.player.reputation then
 				populateReputations()
@@ -350,7 +350,7 @@ function WeightsWatcher:eventHandler(event, message, ...)
 				return
 			end
 			reputation = tonumber(reputation)
-			if direction == "increased" then
+			if direction == L["increased"] then
 				rep.value = rep.value + reputation
 				if rep.value > rep.max then
 					while rep.level < #(ww_reputations) and ww_reputations[rep.level] <= rep.value do