Quantcast

Localization cleanup

MilleXIV [09-05-16 - 15:36]
Localization cleanup
Filename
core.lua
locales/enUS.lua
modules/armor.lua
modules/clock.lua
modules/currency.lua
modules/gold.lua
modules/micromenu.lua
modules/system.lua
modules/talent.lua
modules/tradeskill.lua
diff --git a/core.lua b/core.lua
index ef118b4..8edf614 100644
--- a/core.lua
+++ b/core.lua
@@ -74,48 +74,13 @@ function XIVBar:OnInitialize()

   self.fontFlags = {'', 'OUTLINE', 'THICKOUTLINE', 'MONOCHROME'}

-  --[[local options = {
-    name = "XIV Bar",
-    handler = XIVBar,
-    type = 'group',
-    args = {
-      general = {
-        name = L['General'],
-        type = "group",
-        order = 3,
-        inline = true,
-        args = {
-          barPosition = {
-            name = L['Bar Position'],
-            type = "select",
-            order = 1,
-            values = {TOP = L['Top'], BOTTOM = L['Bottom']},
-            style = "dropdown",
-            get = function() return self.db.profile.general.barPosition; end,
-            set = function(info, value) self.db.profile.general.barPosition = value; self:Refresh(); end,
-          },
-          barColor = {
-            name = L['Bar Color'],
-            type = "color",
-            order = 2,
-            hasAlpha = true,
-            set = function(info, r, g, b, a)
-              XIVBar:SetColor('barColor', r, g, b, a)
-            end,
-            get = function() return XIVBar:GetColor('barColor') end
-          },
-        }
-      }
-    }
-  }]]--
-
   local options = {
     name = "XIV Bar",
     handler = XIVBar,
     type = 'group',
     args = {
       general = {
-        name = L['General'],
+        name = GENERAL_LABEL,
         type = "group",
         args = {
           general = self:GetGeneralOptions(),
@@ -311,7 +276,7 @@ end

 function XIVBar:GetGeneralOptions()
   return {
-    name = L['General'],
+    name = GENERAL_LABEL,
     type = "group",
     order = 3,
     inline = true,
@@ -375,7 +340,7 @@ function XIVBar:GetPositionOptions()
     inline = true,
     args = {
       fullScreen = {
-        name = L['Full Screen'],
+        name = VIDEO_OPTIONS_FULLSCREEN,
         type = 'toggle',
         order = 0,
         get = function() return self.db.profile.general.barFullscreen; end,
@@ -413,7 +378,7 @@ function XIVBar:GetTextOptions()
     fontList[v] = v;
   end
   return {
-    name = L['Text'],
+    name = LOCALE_TEXT_LABEL,
     type = "group",
     order = 3,
     inline = true,
@@ -428,7 +393,7 @@ function XIVBar:GetTextOptions()
         set = function(info, val) self.db.profile.text.font = val; self:Refresh(); end
       },
       fontSize = {
-        name = L['Font Size'],
+        name = FONT_SIZE,
         type = 'range',
         order = 2,
         min = 10,
diff --git a/locales/enUS.lua b/locales/enUS.lua
index 850b8ab..adc29a4 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -2,9 +2,6 @@ local AddOnName, Engine = ...;
 local AceLocale = LibStub:GetLibrary("AceLocale-3.0");
 local L = AceLocale:NewLocale(AddOnName, "enUS", true, false);

-L['General'] = true;
-L['Text'] = true;
-
 L['Modules'] = true;
 L['Left-Click'] = true;
 L['Right-Click'] = true;
@@ -20,7 +17,6 @@ L['Module Spacing'] = true;

 -- Positioning Options
 L['Positioning Options'] = true;
-L['Full Screen'] = true;
 L['Horizontal Position'] = true;
 L['Bar Width'] = true;
 L['Left'] = true;
@@ -29,7 +25,6 @@ L['Right'] = true;

 -- Media
 L['Font'] = true;
-L['Font Size'] = true;
 L['Small Font Size'] = true;
 L['Text Style'] = true;

@@ -46,22 +41,14 @@ L['Micromenu'] = true;
 L['Show Social Tooltips'] = true;
 L['Main Menu Icon Right Spacing'] = true;
 L['Icon Spacing'] = true;
-L['Guild'] = true;
-L['Online'] = true;
-L['AFK'] = true;
-L['DND'] = true;
 L['Open Guild Page'] = true;
-L['Social'] = true;
 L['No Tag'] = true;
-L['Level'] = true;
 L['Hide Social Text'] = true;

-L['Armor'] = true;
 L['Always Show Item Level'] = true;
 L['Minimum Durability to Become Active'] = true;
 L['Maximum Durability to Show Item Level'] = true;

-L['Clock'] = true;
 L['Time Format'] = true;
 L['Use Server Time'] = true;
 L['New Event!'] = true;
@@ -77,28 +64,21 @@ L['Ready'] = true;
 L['Travel Cooldowns'] = true;
 L['Change Port Option'] = true;

-L['Gold'] = true;
 L['Always Show Silver and Copper'] = true;
-L['Show Free Bag Space'] = true;
 L['Shorten Gold'] = true;
 L['Toggle Bags'] = true;
-L['Total'] = true;
 L['Session Total'] = true;

-L['Currency'] = true;
 L['Show XP Bar Below Max Level'] = true;
 L['Use Class Colors for XP Bar'] = true;
 L['Show Tooltips'] = true;
 L['Text on Right'] = true;
-L['Toggle Currency Frame'] = true;
 L['Currency Select'] = true;
 L['First Currency'] = true;
 L['Second Currency'] = true;
 L['Third Currency'] = true;
-L['XP'] = true;
 L['Rested'] = true;

-L['System'] = true;
 L['Show World Ping'] = true;
 L['Number of Addons To Show'] = true;
 L['Addons to Show in Tooltip'] = true;
diff --git a/modules/armor.lua b/modules/armor.lua
index 4b7b39c..0f641ae 100644
--- a/modules/armor.lua
+++ b/modules/armor.lua
@@ -6,7 +6,7 @@ local L = XIVBar.L;
 local ArmorModule = xb:NewModule("ArmorModule", 'AceEvent-3.0')

 function ArmorModule:GetName()
-  return L['Armor'];
+  return AUCTION_CATEGORY_ARMOR;
 end

 function ArmorModule:OnInitialize()
@@ -55,7 +55,7 @@ function ArmorModule:RegisterFrameEvents()
   self.armorButton:SetScript('OnEnter', function()
     ArmorModule:SetArmorColor()
     GameTooltip:SetOwner(ArmorModule.armorFrame, 'ANCHOR_'..xb.miniTextPosition)
-    GameTooltip:AddLine("[|cff6699FF"..L['Armor'].."|r]")
+    GameTooltip:AddLine("[|cff6699FF"..AUCTION_CATEGORY_ARMOR.."|r]")
     GameTooltip:AddLine(" ")
     for i,v in pairs(ArmorModule.durabilityList) do
       if v.max ~= nil and v.max > 0 then
diff --git a/modules/clock.lua b/modules/clock.lua
index b616608..206599e 100644
--- a/modules/clock.lua
+++ b/modules/clock.lua
@@ -6,7 +6,7 @@ local L = XIVBar.L;
 local ClockModule = xb:NewModule("ClockModule", 'AceEvent-3.0')

 function ClockModule:GetName()
-  return L['Clock'];
+  return TIMEMANAGER_TITLE;
 end

 function ClockModule:OnInitialize()
@@ -128,7 +128,7 @@ function ClockModule:RegisterFrameEvents()
     if InCombatLockdown() then return; end
     ClockModule:SetClockColor()
     GameTooltip:SetOwner(ClockModule.clockTextFrame, 'ANCHOR_'..xb.miniTextPosition)
-    GameTooltip:AddLine("[|cff6699FF"..L['Clock'].."|r]")
+    GameTooltip:AddLine("[|cff6699FF"..TIMEMANAGER_TITLE.."|r]")
     GameTooltip:AddLine(" ")
     local clockTime = nil
     local ttTimeText = ''
@@ -240,7 +240,7 @@ function ClockModule:GetConfig()
         set = function(info, val) xb.db.profile.modules.clock.timeFormat = val; self:Refresh(); end
       },
       fontSize = {
-        name = L['Font Size'],
+        name = FONT_SIZE,
         type = 'range',
         order = 4,
         min = 10,
diff --git a/modules/currency.lua b/modules/currency.lua
index 0bc514e..25b303d 100644
--- a/modules/currency.lua
+++ b/modules/currency.lua
@@ -6,7 +6,7 @@ local L = XIVBar.L;
 local CurrencyModule = xb:NewModule("CurrencyModule", 'AceEvent-3.0', 'AceHook-3.0')

 function CurrencyModule:GetName()
-  return L['Currency'];
+  return CURRENCY;
 end

 function CurrencyModule:OnInitialize()
@@ -271,18 +271,15 @@ function CurrencyModule:ShowTooltip()
     local maxXp = UnitXPMax('player')
     local rested = GetXPExhaustion()
     -- XP
-    GameTooltip:AddDoubleLine(L['XP']..':', string.format('%d / %d (%d%%)', curXp, maxXp, floor((curXp / maxXp) * 100)), 1, 1, 0, 1, 1, 1)
+    GameTooltip:AddDoubleLine(XP..':', string.format('%d / %d (%d%%)', curXp, maxXp, floor((curXp / maxXp) * 100)), 1, 1, 0, 1, 1, 1)
     -- Remaining
     GameTooltip:AddDoubleLine(L['Remaining']..':', string.format('%d (%d%%)', (maxXp - curXp), floor(((maxXp - curXp) / maxXp) * 100)), 1, 1, 0, 1, 1, 1)
     -- Rested
     if rested then
       GameTooltip:AddDoubleLine(L['Rested']..':', string.format('+%d (%d%%)', rested, floor((rested / maxXp) * 100)), 1, 1, 0, 1, 1, 1)
     end
-
-    --GameTooltip:AddLine(" ")
-    --GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', L['Toggle Currency Frame'], 1, 1, 0, 1, 1, 1)
   else
-    GameTooltip:AddLine("[|cff6699FF"..L['Currency'].."|r]")
+    GameTooltip:AddLine("[|cff6699FF"..CURRENCY.."|r]")
     GameTooltip:AddLine(" ")

     for i = 1, 3 do
@@ -294,7 +291,7 @@ function CurrencyModule:ShowTooltip()
     end

     GameTooltip:AddLine(" ")
-    GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', L['Toggle Currency Frame'], 1, 1, 0, 1, 1, 1)
+    GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', BINDING_NAME_TOGGLECURRENCY, 1, 1, 0, 1, 1, 1)
   end

   GameTooltip:Show()
diff --git a/modules/gold.lua b/modules/gold.lua
index 2031341..0726085 100644
--- a/modules/gold.lua
+++ b/modules/gold.lua
@@ -6,7 +6,7 @@ local L = XIVBar.L;
 local GoldModule = xb:NewModule("GoldModule", 'AceEvent-3.0')

 function GoldModule:GetName()
-  return L['Gold'];
+  return BONUS_ROLL_REWARD_MONEY;
 end

 function GoldModule:OnInitialize()
@@ -118,7 +118,7 @@ function GoldModule:RegisterFrameEvents()
     self.bagText:SetTextColor(unpack(xb:HoverColors()))

     GameTooltip:SetOwner(GoldModule.goldFrame, 'ANCHOR_'..xb.miniTextPosition)
-    GameTooltip:AddLine("[|cff6699FF"..L['Gold'].."|r - |cff82c5ff"..xb.constants.playerFactionLocal.." "..xb.constants.playerRealm.."|r]")
+    GameTooltip:AddLine("[|cff6699FF"..BONUS_ROLL_REWARD_MONEY.."|r - |cff82c5ff"..xb.constants.playerFactionLocal.." "..xb.constants.playerRealm.."|r]")
     GameTooltip:AddLine(" ")

     GameTooltip:AddDoubleLine(L['Session Total'], GoldModule:FormatCoinText(xb.db.factionrealm[xb.constants.playerName].sessionMoney), 1, 1, 0, 1, 1, 1)
@@ -130,7 +130,7 @@ function GoldModule:RegisterFrameEvents()
       totalGold = totalGold + goldData.currentMoney
     end
     GameTooltip:AddLine(" ")
-    GameTooltip:AddDoubleLine(L['Total'], GoldModule:FormatCoinText(totalGold), 1, 1, 0, 1, 1, 1)
+    GameTooltip:AddDoubleLine(TOTAL, GoldModule:FormatCoinText(totalGold), 1, 1, 0, 1, 1, 1)
     GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', L['Toggle Bags'], 1, 1, 0, 1, 1, 1)
     GameTooltip:Show()
   end)
@@ -252,7 +252,7 @@ function GoldModule:GetConfig()
         set = function(_, val) xb.db.profile.modules.gold.showSmallCoins = val; self:Refresh(); end
       },
       showFreeBagSpace = {
-        name = L['Show Free Bag Space'],
+        name = DISPLAY_FREE_BAG_SLOTS,
         order = 1,
         type = "toggle",
         get = function() return xb.db.profile.modules.gold.showFreeBagSpace; end,
diff --git a/modules/micromenu.lua b/modules/micromenu.lua
index 0bf8be8..c6c44b3 100644
--- a/modules/micromenu.lua
+++ b/modules/micromenu.lua
@@ -288,7 +288,7 @@ function MenuModule:SocialHover(hoverFunc)

     if (totalOnlineFriends + totalBNOnlineFriends) > 0 then
       GameTooltip:SetOwner(MenuModule.frames.social, 'ANCHOR_'..xb.miniTextPosition)
-      GameTooltip:AddLine('[|cff6699FF'..L['Social']..'|r]')
+      GameTooltip:AddLine('[|cff6699FF'..SOCIAL_LABEL..'|r]')
       GameTooltip:AddLine(' ')
     end

@@ -302,18 +302,18 @@ function MenuModule:SocialHover(hoverFunc)
           end

           local _, _, _, realmName, _ = BNGetGameAccountInfo(gameAccount)
-          local status = L['Online']
+          local status = FRIENDS_LIST_ONLINE
           local statusIcon = FRIENDS_TEXTURE_ONLINE
           local socialIcon = MenuModule.socialIcons[gameClient].icon
           local gameName = MenuModule.socialIcons[gameClient].text

           if isAfk then
             statusIcon = FRIENDS_TEXTURE_AFK
-            status = L['AFK']
+            status = DEFAULT_AFK_MESSAGE
           end
           if isDnd then
             statusIcon = FRIENDS_TEXTURE_DND
-            status = L['DND']
+            status = DEFAULT_DND_MESSAGE
           end

           if gameClient == BNET_CLIENT_WOW then
@@ -337,18 +337,18 @@ function MenuModule:SocialHover(hoverFunc)
       for i = 1, GetNumFriends() do
         local name, level, class, area, isOnline, status, note = GetFriendInfo(i)
         if online then
-          local status = L['Online']
+          local status = FRIENDS_LIST_ONLINE
           local statusIcon = FRIENDS_TEXTURE_ONLINE
           if isAfk then
             statusIcon = FRIENDS_TEXTURE_AFK
-            status = L['AFK']
+            status = DEFAULT_AFK_MESSAGE
           end
           if isDnd then
             statusIcon = FRIENDS_TEXTURE_DND
-            status = L['DND']
+            status = DEFAULT_DND_MESSAGE
           end

-          local lineLeft = string.format("|T%s:16|t %s, "..L['Level']..":%s %s", statusIcon, name, level, class)
+          local lineLeft = string.format("|T%s:16|t %s, "..LEVEL..":%s %s", statusIcon, name, level, class)
           local lineRight = string.format("%s", area)
           GameTooltip:AddDoubleLine(lineLeft, lineRight)
         end -- isOnline
@@ -374,10 +374,10 @@ function MenuModule:GuildHover(hoverFunc)
     end
     GuildRoster()
     GameTooltip:SetOwner(MenuModule.frames.guild, 'ANCHOR_'..xb.miniTextPosition)
-    GameTooltip:AddLine("[|cff6699FF"..L['Guild'].."|r]")
+    GameTooltip:AddLine("[|cff6699FF"..GUILD.."|r]")
     GameTooltip:AddLine(" ")
     local gName, _, _, _ = GetGuildInfo('player')
-    GameTooltip:AddDoubleLine(L['Guild']..':', gName, 1, 1, 0, 0, 1, 0)
+    GameTooltip:AddDoubleLine(GUILD..':', gName, 1, 1, 0, 0, 1, 0)

     local totalGuild, _ = GetNumGuildMembers()
     for i = 0, totalGuild do
@@ -385,9 +385,9 @@ function MenuModule:GuildHover(hoverFunc)
       if isOnline then
         local colorHex = RAID_CLASS_COLORS[class].colorStr
         if status == 1 then
-          status = L['AFK'];
+          status = DEFAULT_AFK_MESSAGE;
         elseif status == 2 then
-          status = L['DND'];
+          status = DEFAULT_DND_MESSAGE;
         else
           status = ''
         end
diff --git a/modules/system.lua b/modules/system.lua
index 425e433..7848688 100644
--- a/modules/system.lua
+++ b/modules/system.lua
@@ -6,7 +6,7 @@ local L = XIVBar.L;
 local SystemModule = xb:NewModule("SystemModule", 'AceEvent-3.0', 'AceHook-3.0')

 function SystemModule:GetName()
-  return L['System'];
+  return SYSTEMOPTIONS_MENU;
 end

 function SystemModule:OnInitialize()
diff --git a/modules/talent.lua b/modules/talent.lua
index f18fb7e..24d2b97 100644
--- a/modules/talent.lua
+++ b/modules/talent.lua
@@ -400,10 +400,14 @@ function TalentModule:CreateLootSpecPopup()
         if InCombatLockdown() then return; end
         if button == 'LeftButton' then
           local id = 0
+          local name = ''
           if self:GetID() ~= 0 then
-            id = GetSpecializationInfo(self:GetID())
+            id, name = GetSpecializationInfo(self:GetID())
+          else
+            name = GetSpecializationInfo(GetSpecialization())
           end
           SetLootSpecialization(id)
+          print(string.format("|cffffff00"..ERR_LOOT_SPEC_CHANGED_S.."|r", name))
         end
         TalentModule.lootSpecPopup:Hide()
       end)
diff --git a/modules/tradeskill.lua b/modules/tradeskill.lua
index 6149d20..4a481cc 100644
--- a/modules/tradeskill.lua
+++ b/modules/tradeskill.lua
@@ -256,7 +256,7 @@ function TradeskillModule:ShowTooltip()
   local recipeIds = C_TradeSkillUI.GetAllRecipeIDs()

   GameTooltip:AddLine(" ")
-  GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', L['Toggle Currency Frame'], 1, 1, 0, 1, 1, 1)
+  GameTooltip:AddDoubleLine('<'..L['Left-Click']..'>', BINDING_NAME_TOGGLECURRENCY, 1, 1, 0, 1, 1, 1)
   GameTooltip:Show()]]--
 end