Quantcast

Localizing played DT

Darthpred [11-17-13 - 23:40]
Localizing played DT
Filename
ElvUI_SLE/locales/english.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/datatexts/played.lua
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index f476377..82545bb 100755
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -155,6 +155,9 @@ L["Hide In Combat"] = true
 L["Will not show the tooltip while in combat."] = true
 L["World Loot"] = true
 L["Show/Hide the status of Key to the Palace of Lei Shen and Trove of the Thunder King."] = true
+L["Time Played"] = true
+L["Account Time Played"] = true
+L["D"] = true

 --Exp/Rep Bar--
 L["Xp-Rep Text"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index fcb7579..ab16c8c 100755
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -156,6 +156,9 @@ L["Hide In Combat"] = "Скрывать в бою"
 L["Will not show the tooltip while in combat."] = "Не отображать подсказки инфо-текста в бою."
 L["World Loot"] = "Мировая добыча"
 L["Show/Hide the status of Key to the Palace of Lei Shen and Trove of the Thunder King."] = "Показать/скрыть статус Ключа от дворца Лэй Шэня и Сокровищ Властелина Грома."
+L["Time Played"] = "Времени в игре"
+L["Account Time Played"] = "Время в игре на аккаунте"
+L["D"] = "Дн"

 --Exp/Rep Bar--
 L["Xp-Rep Text"] = "Текст Опыта/Репутации"
diff --git a/ElvUI_SLE/modules/datatexts/played.lua b/ElvUI_SLE/modules/datatexts/played.lua
index 2aa9b98..b79d0a6 100644
--- a/ElvUI_SLE/modules/datatexts/played.lua
+++ b/ElvUI_SLE/modules/datatexts/played.lua
@@ -2,12 +2,13 @@ local E, L, V, P, G, _ = unpack(ElvUI);
 local DT = E:GetModule('DataTexts')

 local format, GetTime, ChatFrame_TimeBreakDown, InCombatLockdown = format, GetTime, ChatFrame_TimeBreakDown, InCombatLockdown
-local PlayedTimeFormatFull = '%d D %02d:%02d:%02d'
+local PlayedTimeFormatFull = '%d '..L["D"]..' %02d:%02d:%02d'
 local PlayedTimeFormatNoDay = '%02d:%02d:%02d'
 local TotalPlayTime, LevelPlayTime, SessionPlayTime, LevelPlayedOffset, LastLevelTime
 local MyRealm = E.myrealm
 local MyName = E.myname
 local MyClass = E.myclass
+local AddLine, AddDoubleLine = AddLine, AddDoubleLine

 local OnEnter = function(self)
 	if not InCombatLockdown() and SessionPlayTime then
@@ -19,9 +20,9 @@ local OnEnter = function(self)
 		--local Panel, Anchor, xOff, yOff = self:GetTooltipAnchor()
 		--DT.tooltip:SetOwner(Panel, Anchor, xOff, yOff)
 		DT.tooltip:ClearLines()
-		DT.tooltip:AddLine('Time Played', 1, 1, 1)
+		DT.tooltip:AddLine(L["Time Played"], 1, 1, 1)
 		DT.tooltip:AddLine(' ')
-		DT.tooltip:AddDoubleLine("Session:", SessionDay > 0 and format(PlayedTimeFormatFull, SessionDay, SessionHour, SessionMinute, SessionSecond) or format(PlayedTimeFormatNoDay, SessionHour, SessionMinute, SessionSecond), 1, 1, 1, 1, 1, 1)
+		DT.tooltip:AddDoubleLine(L["Session:"], SessionDay > 0 and format(PlayedTimeFormatFull, SessionDay, SessionHour, SessionMinute, SessionSecond) or format(PlayedTimeFormatNoDay, SessionHour, SessionMinute, SessionSecond), 1, 1, 1, 1, 1, 1)
 		if LastLevelSecond > 0 then
 			DT.tooltip:AddDoubleLine(format('%s %s:', PREVIOUS, LEVEL), LastLevelDay > 0 and format(PlayedTimeFormatFull, LastLevelDay. LastLevelHour, LastLevelMinute, LastLevelSecond) or format(PlayedTimeFormatNoDay, LastLevelHour, LastLevelMinute, LastLevelSecond), 1, 1, 1, 1, 1, 1)
 		end
@@ -29,7 +30,7 @@ local OnEnter = function(self)
 		--DT.tooltip:AddDoubleLine(LEVEL..':', LevelDay > 0 and format(PlayedTimeFormatFull, LevelDay. LevelHour, LevelMinute, LevelSecond) or format(PlayedTimeFormatNoDay, LevelHour, LevelMinute, LevelSecond), 1, 1, 1, 1, 1, 1)
 		DT.tooltip:AddDoubleLine(TOTAL..':', TotalDay > 0 and format(PlayedTimeFormatFull, TotalDay, TotalHour, TotalMinute, TotalSecond) or format(PlayedTimeFormatNoDay, TotalHour, TotalMinute, TotalSecond), 1, 1, 1, 1, 1, 1)
 		DT.tooltip:AddLine(' ')
-		DT.tooltip:AddLine('Account Time Played', 1, 1, 1)
+		DT.tooltip:AddLine(L["Account Time Played"], 1, 1, 1)
 		DT.tooltip:AddLine(' ')
 		local Class, Level, AccountDay, AccountHour, AccountMinute, AccountSecond, TotalAccountTime
 		for player, subtable in pairs(ElvDB['sle']['TimePlayed'][MyRealm]) do
@@ -46,9 +47,9 @@ local OnEnter = function(self)
 		end
 		DT.tooltip:AddLine(' ')
 		local TotalAccountDay, TotalAccountHour, TotalAccountMinute, TotalAccountSecond = ChatFrame_TimeBreakDown(TotalAccountTime)
-		DT.tooltip:AddDoubleLine('Total', format(PlayedTimeFormatFull, TotalAccountDay, TotalAccountHour, TotalAccountMinute, TotalAccountSecond), 1, 0, 1, 1, 1, 1)
+		DT.tooltip:AddDoubleLine(TOTAL, format(PlayedTimeFormatFull, TotalAccountDay, TotalAccountHour, TotalAccountMinute, TotalAccountSecond), 1, 0, 1, 1, 1, 1)
 		DT.tooltip:AddLine(' ')
-		DT.tooltip:AddLine('|cFFAAAAAAReset Data: Hold Shift + Right Click|r')
+		DT.tooltip:AddLine(L["Reset Data: Hold Shift + Right Click"])
 		DT.tooltip:Show()
 	end
 end
@@ -71,7 +72,7 @@ local OnUpdate = function(self, elapsed)
 			Day, Hour, Minute, Second = ChatFrame_TimeBreakDown(TotalPlayTime + (GetTime() - SessionPlayTime))
 		end
 		if Day > 0 then
-			self.text:SetFormattedText('%d D %02d:%02d', Day, Hour, Minute)
+			self.text:SetFormattedText('%d '..L["D"]..' %02d:%02d', Day, Hour, Minute)
 		else
 			self.text:SetFormattedText('%02d:%02d', Hour, Minute)
 		end