From 98560d192c6129395616e92a76a671217ba9c16d Mon Sep 17 00:00:00 2001 From: Road-block Date: Sat, 23 Dec 2017 18:14:33 +0200 Subject: [PATCH] Add a translation system. Add zhCN localization by Qcat. If you want to help with localizing shootyepgp in other languages, create a fork and update the localization.lua file. --- bids.lua | 19 +-- localization.lua | 349 +++++++++++++++++++++++++++++++++++++++++++++++ logs.lua | 17 +-- loot.lua | 23 ++-- migrations.lua | 5 +- reserves.lua | 17 +-- shootyepgp.lua | 241 ++++++++++++++++---------------- shootyepgp.toc | 7 +- standings.lua | 50 ++++--- 9 files changed, 538 insertions(+), 190 deletions(-) create mode 100644 localization.lua diff --git a/bids.lua b/bids.lua index bd5e95a..0228c0e 100644 --- a/bids.lua +++ b/bids.lua @@ -3,6 +3,7 @@ local D = AceLibrary("Dewdrop-2.0") local C = AceLibrary("Crayon-2.0") local BC = AceLibrary("Babble-Class-2.2") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp_bids = sepgp:NewModule("sepgp_bids", "AceDB-2.0", "AceEvent-2.0") @@ -10,7 +11,7 @@ function sepgp_bids:OnEnable() if not T:IsRegistered("sepgp_bids") then T:Register("sepgp_bids", "children", function() - T:SetTitle("shootyepgp bids") + T:SetTitle(L["shootyepgp bids"]) self:OnTooltipUpdate() end, "showTitleWhenDetached", true, @@ -18,8 +19,8 @@ function sepgp_bids:OnEnable() "cantAttach", true, "menu", function() D:AddLine( - "text", "Refresh", - "tooltipText", "Refresh window", + "text", L["Refresh"], + "tooltipText", L["Refresh window"], "func", function() sepgp_bids:Refresh() end ) end @@ -77,17 +78,11 @@ function sepgp_bids:Toggle(forceShow) end function sepgp_bids:announceWinnerMS(name, pr) - --if GetNumRaidMembers()>0 then - sepgp:widestAudience(string.format("Winning Mainspec Bid: %s (%.03f PR)",name,pr)) - --SendChatMessage(string.format("Winning Mainspec Bid: %s (%.03f PR)",name,pr),"RAID") - --end + sepgp:widestAudience(string.format(L["Winning Mainspec Bid: %s (%.03f PR)"],name,pr)) end function sepgp_bids:announceWinnerOS(name, pr) - --if GetNumRaidMembers()>0 then - sepgp:widestAudience(string.format("Winning Offspec Bid: %s (%.03f PR)",name,pr)) - --SendChatMessage(string.format("Winning Offspec Bid: %s (%.03f PR)",name,pr),"RAID") - --end + sepgp:widestAudience(string.format(L["Winning Offspec Bid: %s (%.03f PR)"],name,pr)) end function sepgp_bids:countdownCounter() @@ -214,4 +209,4 @@ function sepgp_bids:OnTooltipUpdate() end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs diff --git a/localization.lua b/localization.lua new file mode 100644 index 0000000..0d7ec1f --- /dev/null +++ b/localization.lua @@ -0,0 +1,349 @@ +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") + +L:RegisterTranslations("enUS", function() return { + --["Term"] = true, -- Example + -- common + ["Refresh"] = true, + ["Refresh window"] = true, + ["Clear"] = true, + ["Name"] = true, + ["Raid Only"] = true, + ["Only show members in raid."] = true, + -- bids + ["shootyepgp bids"] = true, + ["Winning Mainspec Bid: %s (%.03f PR)"] = true, + ["Winning Offspec Bid: %s (%.03f PR)"] = true, + -- logs + ["shootyepgp logs"] = true, + ["Clear Logs."] = true, + ["Time"] = true, + ["Action"] = true, + -- loot + ["shootyepgp loot info"] = true, + ["Clear Loot."] = true, + ["Item"] = true, + ["Binds"] = true, + ["Looter"] = true, + ["GP Action"] = true, + -- migrations + ["Updated %d members to v3 storage."] = true, + -- reserves + ["shootyepgp reserves"] = true, + ["Countdown"] = true, + ["Rank"] = true, + ["OnAlt"] = true, + -- standings + ["Ctrl-C to copy. Esc to close."] = true, + ["Ctrl-V to paste data. Esc to close."] = true, + ["Imported %d members."] = true, + ["Imported %d members.\n"] = true, + ["%s\nFailed to import:"] = true, + ["shootyepgp standings"] = true, + ["Group by class"] = true, + ["Group members by class."] = true, + ["Export"] = true, + ["Export standings to csv."] = true, + ["Import"] = true, + ["Import standings from csv."] = true, + ["ep"] = true, + ["gp"] = true, + ["pr"] = true, + IMPORT_WARNING = [[Warning: +Import overwrites all existing EPGP values. + +Paste all the csv data here replacing this text, +then hit Import. +Results will print here when done.]], + -- shootyepgp + ["{shootyepgp}Type \"+\" if on main, or \"+\" (without quotes) if on alt within %dsec."] = true, + ["|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r"] = true, + ["|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r"] = true, + ["Bids"] = true, + ["Show Bids Table."] = true, + ["ClearLoot"] = true, + ["Clear Loot Table."] = true, + ["ClearLogs"] = true, + ["Clear Logs Table."] = true, + ["Standings"] = true, + ["Show Standings Table."] = true, + ["Restart"] = true, + ["Restart shootyepgp if having startup problems."] = true, + ["Standings"] = true, + ["Show Standings Table."] = true, + ["v%s Loaded."] = true, + ["Alt Click/RClick/MClick"] = true, + ["Call for: MS/OS/Both"] = true, + ["gp:|cff32cd32%d|r gp_os:|cff20b2aa%d|r"] = true, + ["pr:|cffff0000%.02f|r(%.02f) pr_os:|cffff0000%.02f|r(%.02f)"] = true, + ["|cffff0000Finished|r"] = true, + ["|cff00ff00%02d|r|cffffffffsec|r"] = true, + ["Manually modified %s\'s note. EPGP was %s"] = true, + ["|cffff0000Manually modified %s\'s note. EPGP was %s|r"] = true, + ["Whisper me + for %s (mainspec)"] = true, + ["Whisper me - for %s (offspec)"] = true, + ["Whisper me + or - for %s (mainspec or offspec)"] = true, + ["Click $MS or $OS for %s"] = true, + ["or $OS "] = true, + ["$MS or "] = true, + ["You have received a %d EP penalty."] = true, + ["You have been awarded %d EP."] = true, + ["You have gained %d GP."] = true, + ["%s%% decay to EP and GP."] = true, + ["%d EP awarded to Raid."] = true, + ["%d EP awarded to Reserves."] = true, + ["New %s version available: |cff00ff00%s|r"] = true, + ["Visit %s to update."] = true, + ["New raid progress"] = true, + [", offspec price %"] = true, + ["New offspec price %"] = true, + [", decay %"] = true, + ["New decay %"] = true, + [" settings accepted from %s"] = true, + ["Giving %d ep to all raidmembers"] = true, + ["You aren't in a raid dummy"] = true, + ["Giving %d ep to active reserves"] = true, + ["Giving %d ep to %s"] = true, + ["%s EP Penalty to %s."] = true, + ["Giving %d gp to %s"] = true, + ["Awarding %d GP to %s. (Previous: %d, New: %d)"] = true, + ["%s\'s officernote is broken:%q"] = true, + ["All EP and GP decayed by %d%%"] = true, + ["All EP and GP decayed by %s%%"] = true, + ["All GP has been reset to %d."] = true, + ["All EP and GP has been reset to 0/%d."] = true, + ["You now have: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r."] = true, + ["Close to EPGP Cap. Next Decay will change your |cffff7f00PR|r by |cffff0000%.4g|r."] = true, + ["|cffffff00Click|r to toggle Standings.%s \n|cffffff00Right-Click|r for Options."] = true, + [" \n|cffffff00Ctrl+Click|r to toggle Reserves. \n|cffffff00Alt+Click|r to toggle Bids. \n|cffffff00Shift+Click|r to toggle Loot. \n|cffffff00Ctrl+Shift+Click|r to toggle Logs."] = true, + ["Account EPs to %s."] = true, + ["Account GPs to %s."] = true, + ["shootyepgp options"] = true, + ["+EPs to Member"] = true, + ["Account EPs for member."] = true, + ["+EPs to Raid"] = true, + ["Award EPs to all raid members."] = true, + ["+GPs to Member"] = true, + ["Account GPs for member."] = true, + ["+EPs to Reserves"] = true, + ["Award EPs to all active Reserves."] = true, + ["Enable Reserves"] = true, + ["Participate in Standby Raiders List.\n|cffff0000Requires Main Character Name.|r"] = true, + ["AFK Check Reserves"] = true, + ["AFK Check Reserves List"] = true, + ["Set Main"] = true, + ["Set your Main Character for Reserve List."] = true, + ["Raid Progress"] = true, + ["Highest Tier the Guild is raiding.\nUsed to adjust GP Prices.\nUsed for suggested EP awards."] = true, + ["4.Naxxramas"] = true, + ["3.Temple of Ahn\'Qiraj"] = true, + ["2.Blackwing Lair"] = true, + ["1.Molten Core"] = true, + ["Reporting channel"] = true, + ["Channel used by reporting functions."] = true, + ["Decay EPGP"] = true, + ["Decays all EPGP by %s%%"] = true, + ["Set Decay %"] = true, + ["Set Decay percentage (Admin only)."] = true, + ["Offspec Price %"] = true, + ["Set Offspec Items GP Percent."] = true, + ["Reset EPGP"] = true, + ["Resets everyone\'s EPGP to 0/%d (Admin only)."] = true, + ["Scanning %d members for EP/GP data. (%s)"] = true, + ["|cffff0000%s|r trying to add %s to Reserves, but has already added a member. Discarding!"] = true, + ["|cffff0000%s|r has already been added to Reserves. Discarding!"] = true, + ["^{shootyepgp}Type"] = true, + ["Clearing old Bids"] = true, + ["%s not found in the guild or not max level!"] = true, + ["Molten Core"] = true, + ["Onyxia\'s Lair"] = true, + ["Blackwing Lair"] = true, + ["Ahn\'Qiraj"] = true, + ["Naxxramas"] = true, + ["There are %d loot drops stored. It is recommended to clear loot info before a new raid. Do you want to clear it now?"] = true, + ["Show me"] = true, + ["Loot info cleared"] = true, + ["Loot info can be cleared at any time from the Tablet context menu or '/shooty clearloot' command"] = true, + ["Set your main to be able to participate in Reserve List EPGP Checks."] = true, + ["Reserves AFKCheck. Are you available? |cff00ff00%0d|rsec."] = true, + ["|cffff0000Are you sure you want to Reset ALL EPGP?|r"] = true, + ["Add MainSpec GP"] = true, + ["Add OffSpec GP"] = true, + ["Bank or D/E"] = true, + ["%s looted %s. What do you want to do?"] = true, + ["GP Actions"] = true, + ["Remind me Later"] = true, +} end) + +L:RegisterTranslations("zhCN", function() return { + --["Term"] = "术语", -- Example + -- common + ["Refresh"] = "刷新", + ["Refresh window"] = "刷新窗口", + ["Clear"] = "清除", + ["Name"] = "名字", + ["Raid Only"] = "只显示团队", + ["Only show members in raid."] = "只显示在团队里的成员.", + -- bids + ["shootyepgp bids"] = "shootyepgp 竞拍", + ["Winning Mainspec Bid: %s (%.03f PR)"] = "副天赋竞标获胜: %s (%.03f PR)", + ["Winning Offspec Bid: %s (%.03f PR)"] = "副天赋竞标获胜: %s (%.03f PR)", + -- logs + ["shootyepgp logs"] = "shootyepgp 日志", + ["Clear Logs."] = "清除日志.", + ["Time"] = "时间", + ["Action"] = "行为", + -- loot + ["shootyepgp loot info"] = "shootyepgp 拾取信息", + ["Clear Loot."] = "清除拾取.", + ["Item"] = "物品", + ["Binds"] = "竞拍", + ["Looter"] = "拾取人", + ["GP Action"] = "GP 行为", + -- migrations + ["Updated %d members to v3 storage."] = "更新 %d 成员到v3存储区.", + -- reserves + ["shootyepgp reserves"] = "shootyepgp 替补成员", + ["Countdown"] = "倒计时", + ["Rank"] = "Rank", + ["OnAlt"] = "OnAlt", + -- standings + ["Ctrl-C to copy. Esc to close."] = "Ctrl-C 复制. Esc 退出.", + ["Ctrl-V to paste data. Esc to close."] = "Ctrl-V 粘贴数据. Esc 退出.", + ["Imported %d members."] = "导入 %d 成员.", + ["Imported %d members.\n"] = "导入 %d 成员.\n", + ["%s\nFailed to import:"] = "%s\n未能导入:", + ["shootyepgp standings"] = "shootyepgp 名单列表", + ["Group by class"] = "职业分组", + ["Group members by class."] = "按职业分组.", + ["Export"] = "导出", + ["Export standings to csv."] = "导出排名到CSV文本.", + ["Import"] = "导入", + ["Import standings from csv."] = "从CSV文本里导入数据.", + ["ep"] = "ep(贡献点)", + ["gp"] = "gp(装备点)", + ["pr"] = "pr(优先)", + IMPORT_WARNING = [[警告: +导入会覆盖所有现有的EPGP值. + +粘贴这里的所有CSV数据替换文本, +然后再导入. +完成后打印结果.]], + -- shootyepgp + ["{shootyepgp}Type \"+\" if on main, or \"+\" (without quotes) if on alt within %dsec."] = "{shootyepgp}使用 \"+\" 如果你在大号上, 或者 \"+\" (没有引号) 如果在小号 %d秒.", + ["|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r"] = "|cffFF3333|Hshootybid:1:$ML|h[主天赋/需求]|h|r", + ["|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r"] = "|cff009900|Hshootybid:2:$ML|h[副天赋/贪婪]|h|r", + ["Bids"] = "竞标", + ["Show Bids Table."] = "显示竞标表.", + ["ClearLoot"] = "清除拾取", + ["Clear Loot Table."] = "清除拾取表.", + ["ClearLogs"] = "清除日志", + ["Clear Logs Table."] = "清除日志表.", + ["Standings"] = "排名", + ["Show Standings Table."] = "显示排名表.", + ["Restart"] = "重新开始", + ["Restart shootyepgp if having startup problems."] = "重新开始 shootyepgp,如果有启动问题.", + ["Standings"] = "排名", + ["Show Standings Table."] = "显示排名表.", + ["v%s Loaded."] = "v%s 加载.", + ["Alt Click/RClick/MClick"] = "Alt+左键/右键/中键", + ["Call for: MS/OS/Both"] = "要求: MS/OS/Both", + ["gp:|cff32cd32%d|r gp_os:|cff20b2aa%d|r"] = "gp:|cff32cd32%d|r 副天赋gp:|cff20b2aa%d|r", + ["pr:|cffff0000%.02f|r(%.02f) pr_os:|cffff0000%.02f|r(%.02f)"] = "pr:|cffff0000%.02f|r(%.02f) 副天赋pr:|cffff0000%.02f|r(%.02f)", + ["|cffff0000Finished|r"] = "|cffff0000完成|r", + ["|cff00ff00%02d|r|cffffffffsec|r"] = "|cff00ff00%02d|r|cffffffff秒|r", + ["Manually modified %s\'s note. EPGP was %s"] = "手动修改 %s\'s 记录. EPGP 是 %s", + ["|cffff0000Manually modified %s\'s note. EPGP was %s|r"] = "|cffff0000手动修改 %s\'s 记录. EPGP 是 %s|r", + ["Whisper me + for %s (mainspec)"] = "私聊我 + %s (主天赋)", + ["Whisper me - for %s (offspec)"] = "私聊我 - %s (副天赋)", + ["Whisper me + or - for %s (mainspec or offspec)"] = "私聊我 + 或者 - %s (主天赋或副天赋)", + ["Click $MS or $OS for %s"] = "Click $MS 或 $OS for %s", + ["or $OS "] = "或 $OS ", + ["$MS or "] = "$MS 或 ", + ["You have received a %d EP penalty."] = "你已经收到了 %d EP 处罚.", + ["You have been awarded %d EP."] = "你被授予 %d EP.", + ["You have gained %d GP."] = "你得到了 %d GP.", + ["%s%% decay to EP and GP."] = "%s%% 递减EP和GP.", + ["%d EP awarded to Raid."] = "%d EP 授予团队.", + ["%d EP awarded to Reserves."] = "%d EP 授予替补队员.", + ["New %s version available: |cff00ff00%s|r"] = "新的 %s 版本可用: |cff00ff00%s|r", + ["Visit %s to update."] = "访问 %s 升级.", + ["New raid progress"] = "新的RAID进度", + [", offspec price %"] = ", 副天赋价格 %", + ["New offspec price %"] = "新的副天赋价格 %", + [", decay %"] = ", 递减 %", + ["New decay %"] = "新的递减 %", + [" settings accepted from %s"] = " 设置接受从 %s", + ["Giving %d ep to all raidmembers"] = "给予 %d ep 到所有团员", + ["You aren't in a raid dummy"] = "你不在一个团队", + ["Giving %d ep to active reserves"] = "给予 %d ep 在线的替补队员", + ["Giving %d ep to %s"] = "给予 %d ep 给 %s", + ["%s EP Penalty to %s."] = "%s EP 惩罚 %s.", + ["Giving %d gp to %s"] = "给予 %d gp 给 %s", + ["Awarding %d GP to %s. (Previous: %d, New: %d)"] = "奖励 %d GP 给 %s. (以前: %d, 新: %d)", + ["%s\'s officernote is broken:%q"] = "%s\'s 官员备注无法执行:%q", + ["All EP and GP decayed by %d%%"] = "所有EP和GP递减 %d%%", + ["All EP and GP decayed by %s%%"] = "所有EP和GP递减 %s%%", + ["All GP has been reset to %d."] = "所有GP已重置为 %d.", + ["All EP and GP has been reset to 0/%d."] = "所有EP和GP已重置为 0/%d.", + ["You now have: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r."] = "你现在有: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r.", + ["Close to EPGP Cap. Next Decay will change your |cffff7f00PR|r by |cffff0000%.4g|r."] = "下次递减会改变你的 |cffff7f00PR|r 从 |cffff0000%.4g|r.", + ["|cffffff00Click|r to toggle Standings.%s \n|cffffff00Right-Click|r for Options."] = "|cffffff00点击|r 切换名单.%s \n|cffffff00右键|r 设置.", + [" \n|cffffff00Ctrl+Click|r to toggle Reserves. \n|cffffff00Alt+Click|r to toggle Bids. \n|cffffff00Shift+Click|r to toggle Loot. \n|cffffff00Ctrl+Shift+Click|r to toggle Logs."] = " \n|cffffff00Ctrl+点击|r 切换到替补队员. \n|cffffff00Alt+点击|r 切换到竞拍. \n|cffffff00Shift+点击|r 切换到拾取. \n|cffffff00Ctrl+Shift+点击|r 切换到日志.", + ["Account EPs to %s."] = "记账 EP 到 %s.", + ["Account GPs to %s."] = "记账 GP 到 %s.", + ["shootyepgp options"] = "shootyepgp 设置", + ["+EPs to Member"] = "+EP给成员", + ["Account EPs for member."] = "记账 EP 给成员.", + ["+EPs to Raid"] = "+EP给团队", + ["Award EPs to all raid members."] = "奖励 EP 给所有团队成员.", + ["+GPs to Member"] = "+GP给成员", + ["Account GPs for member."] = "记账 GP给成员.", + ["+EPs to Reserves"] = "+EP给替补队员", + ["Award EPs to all active Reserves."] = "奖励EP给所有在线的替补队员.", + ["Enable Reserves"] = "激活替补成员", + ["Participate in Standby Raiders List.\n|cffff0000Requires Main Character Name.|r"] = "参与在备用团队列表.\n|cffff0000要求大号名字.|r", + ["AFK Check Reserves"] = "替补队员AFK检查", + ["AFK Check Reserves List"] = "检查AFK的替补成员", + ["Set Main"] = "设置大号", + ["Set your Main Character for Reserve List."] = "设置你的大号人物为替补成员列表.", + ["Raid Progress"] = "公会raid进度", + ["Highest Tier the Guild is raiding.\nUsed to adjust GP Prices.\nUsed for suggested EP awards."] = "设置公会的最高raid进度.\n用于调整GP价格.\n用于自动调整推荐EP奖励值.", + ["4.Naxxramas"] = "4.纳克萨玛斯", + ["3.Temple of Ahn\'Qiraj"] = "3.安其拉神殿", + ["2.Blackwing Lair"] = "2.黑翼之巢", + ["1.Molten Core"] = "1.熔火之心", + ["Reporting channel"] = "报告频道", + ["Channel used by reporting functions."] = "报告功能使用的频道.", + ["Decay EPGP"] = "递减 EPGP", + ["Decays all EPGP by %s%%"] = "递减所有 EPGP 从 %s%%", + ["Set Decay %"] = "设置递减 %", + ["Set Decay percentage (Admin only)."] = "设置递减百分比 (只能管理员).", + ["Offspec Price %"] = "副天赋价值 %", + ["Set Offspec Items GP Percent."] = "设置副天赋物品 GP 百分比.", + ["Reset EPGP"] = "重置 EPGP", + ["Resets everyone\'s EPGP to 0/%d (Admin only)."] = "重置所有人的 EPGP 到 0/%d (只能管理员).", + ["Scanning %d members for EP/GP data. (%s)"] = "扫描 %d 成员 EP/GP 数据. (%s)", + ["|cffff0000%s|r trying to add %s to Reserves, but has already added a member. Discarding!"] = "|cffff0000%s|r 试图添加 %s 给替补成员, 但已经增加了一个成员。", + ["|cffff0000%s|r has already been added to Reserves. Discarding!"] = "|cffff0000%s|r 已经添加到替补成员.", + ["^{shootyepgp}Type"] = "^{shootyepgp}使用", + ["Clearing old Bids"] = "结算之前的竞拍", + ["%s not found in the guild or not max level!"] = "%s 没有在公会中找到或不是最高级别!", + ["Molten Core"] = "熔火之心", + ["Onyxia\'s Lair"] = "奥妮克希亚的巢穴", + ["Blackwing Lair"] = "黑翼之巢", + ["Ahn\'Qiraj"] = "安其拉", + ["Naxxramas"] = "纳克萨玛斯", + ["There are %d loot drops stored. It is recommended to clear loot info before a new raid. Do you want to clear it now?"] = "这个 %d 掉落是个战利品. 建议在新的RAID之前清除拾取物信息. 你现在想清除它吗?", + ["Show me"] = "秀出來", + ["Loot info cleared"] = "战利品信息清除", + ["Loot info can be cleared at any time from the Tablet context menu or '/shooty clearloot' command"] = "拾取信息可以随时从小地图上下文菜单中清除,或者用 '/shooty clearloot' 命令", + ["Set your main to be able to participate in Reserve List EPGP Checks."] = "设定你的主要人物到参与替补成员EPGP检查清单.", + ["Reserves AFKCheck. Are you available? |cff00ff00%0d|rsec."] = "替补成员AFK检查. 你在吗? |cff00ff00%0d|r秒.", + ["|cffff0000Are you sure you want to Reset ALL EPGP?|r"] = "|cffff0000您确定要重置全部 EPGP?|r", + ["Add MainSpec GP"] = "添加主天赋 GP", + ["Add OffSpec GP"] = "添加副天赋 GP", + ["Bank or D/E"] = "公会银行或分解师", + ["%s looted %s. What do you want to do?"] = "%s 拾取了 %s. 你想做什么?", + ["GP Actions"] = "GP 操作", + ["Remind me Later"] = "以后提醒我", +} end) \ No newline at end of file diff --git a/logs.lua b/logs.lua index 6d448d7..8369371 100644 --- a/logs.lua +++ b/logs.lua @@ -2,6 +2,7 @@ local T = AceLibrary("Tablet-2.0") local D = AceLibrary("Dewdrop-2.0") local C = AceLibrary("Crayon-2.0") local CP = AceLibrary("Compost-2.0") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp_logs = sepgp:NewModule("sepgp_logs", "AceDB-2.0") sepgp_logs.tmp = CP:Acquire() @@ -10,7 +11,7 @@ function sepgp_logs:OnEnable() if not T:IsRegistered("sepgp_logs") then T:Register("sepgp_logs", "children", function() - T:SetTitle("shootyepgp logs") + T:SetTitle(L["shootyepgp logs"]) self:OnTooltipUpdate() end, "showTitleWhenDetached", true, @@ -18,13 +19,13 @@ function sepgp_logs:OnEnable() "cantAttach", true, "menu", function() D:AddLine( - "text", "Refresh", - "tooltipText", "Refresh window", + "text", L["Refresh"], + "tooltipText", L["Refresh window"], "func", function() sepgp_logs:Refresh() end ) D:AddLine( - "text", "Clear", - "tooltipText", "Clear Logs.", + "text", L["Clear"], + "tooltipText", L["Clear Logs."], "func", function() sepgp_log = {} sepgp_logs:Refresh() end ) end @@ -103,8 +104,8 @@ end function sepgp_logs:OnTooltipUpdate() local cat = T:AddCategory( "columns", 2, - "text", C:Orange("Time"), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", - "text2", C:Orange("Action"), "child_text2R", 1, "child_text2G", 1, "child_text2B", 1, "child_justify2", "RIGHT" + "text", C:Orange(L["Time"]), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", + "text2", C:Orange(L["Action"]), "child_text2R", 1, "child_text2G", 1, "child_text2B", 1, "child_justify2", "RIGHT" ) local t = sepgp_logs:BuildLogsTable() for i = 1, table.getn(t) do @@ -117,4 +118,4 @@ function sepgp_logs:OnTooltipUpdate() end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs diff --git a/loot.lua b/loot.lua index f43d2a0..8c42e9d 100644 --- a/loot.lua +++ b/loot.lua @@ -3,6 +3,7 @@ local D = AceLibrary("Dewdrop-2.0") local C = AceLibrary("Crayon-2.0") local BC = AceLibrary("Babble-Class-2.2") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp_loot = sepgp:NewModule("sepgp_loot", "AceDB-2.0") @@ -10,7 +11,7 @@ function sepgp_loot:OnEnable() if not T:IsRegistered("sepgp_loot") then T:Register("sepgp_loot", "children", function() - T:SetTitle("shootyepgp loot info") + T:SetTitle(L["shootyepgp loot info"]) self:OnTooltipUpdate() end, "showTitleWhenDetached", true, @@ -18,13 +19,13 @@ function sepgp_loot:OnEnable() "cantAttach", true, "menu", function() D:AddLine( - "text", "Refresh", - "tooltipText", "Refresh window", + "text", L["Refresh"], + "tooltipText", L["Refresh window"], "func", function() sepgp_loot:Refresh() end ) D:AddLine( - "text", "Clear", - "tooltipText", "Clear Loot.", + "text", L["Clear"], + "tooltipText", L["Clear Loot."], "func", function() sepgp_looted = {} sepgp_loot:Refresh() end ) end @@ -96,11 +97,11 @@ end function sepgp_loot:OnTooltipUpdate() local cat = T:AddCategory( "columns", 5, - "text", C:Orange("Time"), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", - "text2", C:Orange("Item"), "child_text2R", 1, "child_text2G", 1, "child_text2B", 0, "child_justify2", "LEFT", - "text3", C:Orange("Binds"), "child_text3R", 0, "child_text3G", 1, "child_text3B", 0, "child_justify3", "CENTER", - "text4", C:Orange("Looter"), "child_text4R", 0, "child_text4G", 1, "child_text4B", 0, "child_justify4", "RIGHT", - "text5", C:Orange("GP Action"), "child_text5R", 0, "child_text5G", 1, "child_text5B", 0, "child_justify5", "RIGHT" + "text", C:Orange(L["Time"]), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", + "text2", C:Orange(L["Item"]), "child_text2R", 1, "child_text2G", 1, "child_text2B", 0, "child_justify2", "LEFT", + "text3", C:Orange(L["Binds"]), "child_text3R", 0, "child_text3G", 1, "child_text3B", 0, "child_justify3", "CENTER", + "text4", C:Orange(L["Looter"]), "child_text4R", 0, "child_text4G", 1, "child_text4B", 0, "child_justify4", "RIGHT", + "text5", C:Orange(L["GP Action"]), "child_text5R", 0, "child_text5G", 1, "child_text5B", 0, "child_justify5", "RIGHT" ) local t = self:BuildLootTable() for i = 1, table.getn(t) do @@ -117,4 +118,4 @@ function sepgp_loot:OnTooltipUpdate() end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs diff --git a/migrations.lua b/migrations.lua index c44ed70..c27a4ab 100644 --- a/migrations.lua +++ b/migrations.lua @@ -1,3 +1,4 @@ +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") function sepgp:v2tov3() local count = 0 for i = 1, GetNumGuildMembers(1) do @@ -14,9 +15,9 @@ function sepgp:v2tov3() sepgp:update_epgp_v3(epv2,gpv2,i,name,officernote) end end - self:defaultPrint(string.format("Updated %d members to v3 storage.",count)) + self:defaultPrint(string.format(L["Updated %d members to v3 storage."],count)) sepgp_dbver = 3 end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs diff --git a/reserves.lua b/reserves.lua index 43da50f..ad168c7 100644 --- a/reserves.lua +++ b/reserves.lua @@ -3,6 +3,7 @@ local D = AceLibrary("Dewdrop-2.0") local C = AceLibrary("Crayon-2.0") local BC = AceLibrary("Babble-Class-2.2") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp_reserves = sepgp:NewModule("sepgp_reserves", "AceDB-2.0") @@ -10,7 +11,7 @@ function sepgp_reserves:OnEnable() if not T:IsRegistered("sepgp_reserves") then T:Register("sepgp_reserves", "children", function() - T:SetTitle("shootyepgp reserves") + T:SetTitle(L["shootyepgp reserves"]) self:OnTooltipUpdate() end, "showTitleWhenDetached", true, @@ -18,8 +19,8 @@ function sepgp_reserves:OnEnable() "cantAttach", true, "menu", function() D:AddLine( - "text", "Refresh", - "tooltipText", "Refresh window", + "text", L["Refresh"], + "tooltipText", L["Refresh window"], "func", function() sepgp_reserves:Refresh() end ) end @@ -94,14 +95,14 @@ function sepgp_reserves:OnTooltipUpdate() "columns", 2 ) cdcat:AddLine( - "text", C:Orange("Countdown"), + "text", C:Orange(L["Countdown"]), "text2", sepgp.timer.cd_text ) local cat = T:AddCategory( "columns", 3, - "text", C:Orange("Name"), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", - "text2", C:Orange("Rank"), "child_text2R", 1, "child_text2G", 1, "child_text2B", 0, "child_justify2", "RIGHT", - "text3", C:Orange("OnAlt"), "child_text3R", 0, "child_text3G", 1, "child_text3B", 0, "child_justify3", "RIGHT" + "text", C:Orange(L["Name"]), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", + "text2", C:Orange(L["Rank"]), "child_text2R", 1, "child_text2G", 1, "child_text2B", 0, "child_justify2", "RIGHT", + "text3", C:Orange(L["OnAlt"]), "child_text3R", 0, "child_text3G", 1, "child_text3B", 0, "child_justify3", "RIGHT" ) local t = self:BuildReservesTable() for i = 1, table.getn(t) do @@ -116,4 +117,4 @@ function sepgp_reserves:OnTooltipUpdate() end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs diff --git a/shootyepgp.lua b/shootyepgp.lua index 0bd739d..b50220e 100644 --- a/shootyepgp.lua +++ b/shootyepgp.lua @@ -6,6 +6,7 @@ local C = AceLibrary("Crayon-2.0") local BC = AceLibrary("Babble-Class-2.2") local DF = AceLibrary("Deformat-2.0") local G = AceLibrary("Gratuity-2.0") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp.VARS = { basegp = 100, baseaward_ep = 100, @@ -24,7 +25,7 @@ sepgp.VARS = { bankde = "Bank-D/E", reminder = C:Red("Unassigned"), } -sepgp.VARS.reservecall = string.format("{shootyepgp}Type \"+\" if on main, or \"+\" (without quotes) if on alt within %dsec.",sepgp.VARS.timeout) +sepgp.VARS.reservecall = string.format(L["{shootyepgp}Type \"+\" if on main, or \"+\" (without quotes) if on alt within %dsec."],sepgp.VARS.timeout) sepgp._playerName = (UnitName("player")) local out = "|cff9664c8shootyepgp:|r %s" local raidStatus,lastRaidStatus @@ -37,8 +38,8 @@ local partyUnit,raidUnit = {},{} local hexColorQuality = {} local reserves_blacklist,bids_blacklist = {},{} local bidlink = { - ["ms"]="|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r", - ["os"]="|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r" + ["ms"]=L["|cffFF3333|Hshootybid:1:$ML|h[Mainspec/NEED]|h|r"], + ["os"]=L["|cff009900|Hshootybid:2:$ML|h[Offspec/GREED]|h|r"] } do for i=1,40 do @@ -54,40 +55,40 @@ end local admincmd, membercmd = {type = "group", handler = sepgp, args = { bids = { type = "execute", - name = "Bids", - desc = "Show Bids Table.", + name = L["Bids"], + desc = L["Show Bids Table."], func = function() sepgp_bids:Toggle() end, }, clearloot = { type = "execute", - name = "ClearLoot", - desc = "Clear Loot Table.", + name = L["ClearLoot"], + desc = L["Clear Loot Table."], func = function() sepgp_looted = {} end, }, clearlogs = { type = "execute", - name = "ClearLogs", - desc = "Clear Logs Table.", + name = L["ClearLogs"], + desc = L["Clear Logs Table."], func = function() sepgp_log = {} end, }, show = { type = "execute", - name = "Standings", - desc = "Show Standings Table.", + name = L["Standings"], + desc = L["Show Standings Table."], func = function() sepgp_standings:Toggle() end, }, restart = { type = "execute", - name = "Restart", - desc = "Restart shootyepgp if having startup problems.", + name = L["Restart"], + desc = L["Restart shootyepgp if having startup problems."], func = function() sepgp:OnEnable() end, @@ -96,8 +97,8 @@ local admincmd, membercmd = {type = "group", handler = sepgp, args = { {type = "group", handler = sepgp, args = { show = { type = "execute", - name = "Standings", - desc = "Show Standings Table.", + name = L["Standings"], + desc = L["Show Standings Table."], func = function() sepgp_standings:Toggle() end, @@ -308,7 +309,7 @@ function sepgp:delayedInit() if (IsInGuild()) then local guildName = (GetGuildInfo("player")) if (guildName) and guildName ~= "" then - sepgp_reservechannel = string.format("%sReserves",(string.gsub(guildName," ",""))) + sepgp_reservechannel = string.format("%sReserves",(string.gsub(guildName," ",""))) -- TODO: Check if channel names can have chinese characters end end if sepgp_reservechannel == nil then sepgp_reservechannel = sepgp.VARS.reservechan end @@ -336,7 +337,7 @@ function sepgp:delayedInit() self:Hook("GuildRosterSetOfficerNote") end end - self:defaultPrint(string.format("v%s Loaded.",sepgp._versionString)) + self:defaultPrint(string.format(L["v%s Loaded."],sepgp._versionString)) end function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master) @@ -350,7 +351,7 @@ function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master) local line_limit, left1,right1 if (is_master) then line_limit = 27 - left1,right1 = C:Yellow("Alt Click/RClick/MClick"), C:Orange("Call for: MS/OS/Both") + left1,right1 = C:Yellow(L["Alt Click/RClick/MClick"]), C:Orange(L["Call for: MS/OS/Both"]) else line_limit = 28 end @@ -359,8 +360,8 @@ function sepgp:AddDataToTooltip(tooltip,itemlink,itemstring,is_master) local pr,new_pr,new_pr_off = ep/gp, ep/(gp+price), ep/(gp+off_price) local pr_delta = new_pr - pr local pr_delta_off = new_pr_off - pr - local textRight = string.format("gp:|cff32cd32%d|r gp_os:|cff20b2aa%d|r",price,off_price) - local textRight2 = string.format("pr:|cffff0000%.02f|r(%.02f) pr_os:|cffff0000%.02f|r(%.02f)",pr_delta,new_pr,pr_delta_off,new_pr_off) + local textRight = string.format(L["gp:|cff32cd32%d|r gp_os:|cff20b2aa%d|r"],price,off_price) + local textRight2 = string.format(L["pr:|cffff0000%.02f|r(%.02f) pr_os:|cffff0000%.02f|r(%.02f)"],pr_delta,new_pr,pr_delta_off,new_pr_off) if (tooltip:NumLines() < line_limit) then tooltip:AddLine(" ") tooltip:AddDoubleLine("|cff9664c8shootyepgp|r",textRight) @@ -391,10 +392,10 @@ function sepgp:OnUpdate(elapsed) if sepgp.timer.count_down <= 0 then running_check = nil sepgp.timer:Hide() - sepgp.timer.cd_text = "|cffff0000Finished|r" + sepgp.timer.cd_text = L["|cffff0000Finished|r"] sepgp_reserves:Refresh() else - sepgp.timer.cd_text = string.format("|cff00ff00%02d|r|cffffffffsec|r",sepgp.timer.count_down) + sepgp.timer.cd_text = string.format(L["|cff00ff00%02d|r|cffffffffsec|r"],sepgp.timer.count_down) end if lastUpdate > 0.5 then lastUpdate = 0 @@ -411,8 +412,8 @@ function sepgp:GuildRosterSetOfficerNote(index,note,fromAddon) local _,_,_,epgp,_ = string.find(note or "","(.*)({%d+:%d+})(.*)") if oldepgp ~= nil then if epgp == nil or epgp ~= oldepgp then - self:adminSay(string.format("Manually modified %s\'s note. EPGP was %s",name,oldepgp)) - self:defaultPrint(string.format("|cffff0000Manually modified %s\'s note. EPGP was %s|r",name,oldepgp)) + self:adminSay(string.format(L["Manually modified %s\'s note. EPGP was %s"],name,oldepgp)) + self:defaultPrint(string.format(L["|cffff0000Manually modified %s\'s note. EPGP was %s|r"],name,oldepgp)) end end local safenote = string.gsub(note,"(.*)({%d+:%d+})(.*)",sanitizeNote) @@ -470,11 +471,11 @@ function sepgp:LootFrameItem_OnClick(button,data) local itemLink = GetLootSlotLink(slot) if (itemLink) then if button == "LeftButton" then - self:widestAudience(string.format("Whisper me + for %s (mainspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me + for %s (mainspec)"],itemLink)) elseif button == "RightButton" then - self:widestAudience(string.format("Whisper me - for %s (offspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me - for %s (offspec)"],itemLink)) elseif button == "MiddleButton" then - self:widestAudience(string.format("Whisper me + or - for %s (mainspec or offspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me + or - for %s (mainspec or offspec)"],itemLink)) end end end @@ -502,13 +503,13 @@ function sepgp:ContainerFrameItemButton_OnClick(button,ignoreModifiers) local bind = self:itemBinding(itemString) or "" if (bind == self.VARS.boe) then if button == "LeftButton" then - self:widestAudience(string.format("Whisper me + for %s (mainspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me + for %s (mainspec)"],itemLink)) return elseif button == "RightButton" then - self:widestAudience(string.format("Whisper me - for %s (offspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me - for %s (offspec)"],itemLink)) return elseif button == "MiddleButton" then - self:widestAudience(string.format("Whisper me + or - for %s (mainspec or offspec)",itemLink)) + self:widestAudience(string.format(L["Whisper me + or - for %s (mainspec or offspec)"],itemLink)) return end end @@ -560,16 +561,16 @@ end function sepgp:bidPrint(link,masterlooter,need,greed,bid) local mslink = string.gsub(bidlink["ms"],"$ML",masterlooter) local oslink = string.gsub(bidlink["os"],"$ML",masterlooter) - local msg = string.format("Click $MS or $OS for %s",link) + local msg = string.format(L["Click $MS or $OS for %s"],link) if (need and greed) then msg = string.gsub(msg,"$MS",mslink) msg = string.gsub(msg,"$OS",oslink) elseif (need) then msg = string.gsub(msg,"$MS",mslink) - msg = string.gsub(msg,"or $OS ","") + msg = string.gsub(msg,L["or $OS "],"") elseif (greed) then msg = string.gsub(msg,"$OS",oslink) - msg = string.gsub(msg,"$MS or ","") + msg = string.gsub(msg,L["$MS or "],"") elseif (bid) then msg = string.gsub(msg,"$MS",mslink) msg = string.gsub(msg,"$OS",oslink) @@ -637,25 +638,25 @@ function sepgp:addonComms(prefix,message,channel,sender) if who == self._playerName then if what == "EP" then if amount < 0 then - msg = string.format("You have received a %d EP penalty.",amount) + msg = string.format(L["You have received a %d EP penalty."],amount) else - msg = string.format("You have been awarded %d EP.",amount) + msg = string.format(L["You have been awarded %d EP."],amount) end elseif what == "GP" then - msg = string.format("You have gained %d GP.",amount) + msg = string.format(L["You have gained %d GP."],amount) end elseif who == "ALL" and what == "DECAY" then - msg = string.format("%s%% decay to EP and GP.",amount) + msg = string.format(L["%s%% decay to EP and GP."],amount) elseif who == "RAID" and what == "AWARD" then - msg = string.format("%d EP awarded to Raid.",amount) + msg = string.format(L["%d EP awarded to Raid."],amount) elseif who == "RESERVES" and what == "AWARD" then - msg = string.format("%d EP awarded to Reserves.",amount) + msg = string.format(L["%d EP awarded to Reserves."],amount) elseif who == "VERSION" then local out_of_date, version_type = self:parseVersion(self._versionString,what) if (out_of_date) and self._newVersionNotification == nil then self._newVersionNotification = true -- only inform once per session - self:defaultPrint(string.format("New %s version available: |cff00ff00%s|r",version_type,what)) - self:defaultPrint(string.format("Visit %s to update.",self._websiteString)) + self:defaultPrint(string.format(L["New %s version available: |cff00ff00%s|r"],version_type,what)) + self:defaultPrint(string.format(L["Visit %s to update."],self._websiteString)) end if (IsGuildLeader()) then self:shareSettings() @@ -667,29 +668,29 @@ function sepgp:addonComms(prefix,message,channel,sender) local settings_notice if progress and progress ~= sepgp_progress then sepgp_progress = progress - settings_notice = "New raid progress" + settings_notice = L["New raid progress"] end if discount and discount ~= sepgp_discount then sepgp_discount = discount if (settings_notice) then - settings_notice = settings_notice..", offspec price %" + settings_notice = settings_notice..L[", offspec price %"] else - settings_notice = "New offspec price %" + settings_notice = L["New offspec price %"] end end if decay and decay ~= sepgp_decay then sepgp_decay = decay if (admin()) then if (settings_notice) then - settings_notice = settings_notice..", decay %" + settings_notice = settings_notice..L[", decay %"] else - settings_notice = "New decay %" + settings_notice = L["New decay %"] end end end if (settings_notice) and settings_notice ~= "" then local sender_rank = string.format("%s(%s)",C:Colorize(BC:GetHexColor(class),sender),rank) - settings_notice = settings_notice..string.format(" settings accepted from %s",sender_rank) + settings_notice = settings_notice..string.format(L[" settings accepted from %s"],sender_rank) self:defaultPrint(settings_notice) end end @@ -856,11 +857,11 @@ function sepgp:award_raid_ep(ep) -- awards ep to raid members in zone local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(i) self:givename_ep(name,ep) end - self:simpleSay(string.format("Giving %d ep to all raidmembers",ep)) - self:addToLog(string.format("Giving %d ep to all raidmembers",ep)) + self:simpleSay(string.format(L["Giving %d ep to all raidmembers"],ep)) + self:addToLog(string.format(L["Giving %d ep to all raidmembers"],ep)) local addonMsg = string.format("RAID;AWARD;%s",ep) self:addonMessage(addonMsg,"RAID") - else UIErrorsFrame:AddMessage("You aren't in a raid dummy",1,0,0)end + else UIErrorsFrame:AddMessage(L["You aren't in a raid dummy"],1,0,0)end end function sepgp:award_reserve_ep(ep) -- awards ep to reserve list @@ -869,8 +870,8 @@ function sepgp:award_reserve_ep(ep) -- awards ep to reserve list local name, class, rank, alt = unpack(reserve) self:givename_ep(name,ep) end - self:simpleSay(string.format("Giving %d ep to active reserves",ep)) - self:addToLog(string.format("Giving %d ep to active reserves",ep)) + self:simpleSay(string.format(L["Giving %d ep to active reserves"],ep)) + self:addToLog(string.format(L["Giving %d ep to active reserves"],ep)) local addonMsg = string.format("RESERVES;AWARD;%s",ep) self:addonMessage(addonMsg,"GUILD") sepgp.reserves = {} @@ -883,9 +884,9 @@ function sepgp:givename_ep(getname,ep) -- awards ep to a single character if not (admin()) then return end local newep = ep + (self:get_ep_v3(getname) or 0) --DONE: update v3 self:update_ep_v3(getname,newep) --DONE: update v3 - self:debugPrint(string.format("Giving %d ep to %s",ep,getname)) + self:debugPrint(string.format(L["Giving %d ep to %s"],ep,getname)) if ep < 0 then -- inform admins and victim of penalties - local msg = string.format("%s EP Penalty to %s.",ep,getname) + local msg = string.format(L["%s EP Penalty to %s."],ep,getname) self:adminSay(msg) self:addToLog(msg) local addonMsg = string.format("%s;%s;%s",getname,"EP",ep) @@ -898,8 +899,8 @@ function sepgp:givename_gp(getname,gp) -- assigns gp to a single character local oldgp = (self:get_gp_v3(getname) or sepgp.VARS.basegp) --DONE: update v3 local newgp = gp + oldgp self:update_gp_v3(getname,newgp) --DONE: update v3 - self:debugPrint(string.format("Giving %d gp to %s",gp,getname)) - local msg = string.format("Awarding %d GP to %s. (Previous: %d, New: %d)",gp,getname,oldgp,math.max(sepgp.VARS.basegp,newgp)) + self:debugPrint(string.format(L["Giving %d gp to %s"],gp,getname)) + local msg = string.format(L["Awarding %d GP to %s. (Previous: %d, New: %d)"],gp,getname,oldgp,math.max(sepgp.VARS.basegp,newgp)) self:adminSay(msg) self:addToLog(msg) local addonMsg = string.format("%s;%s;%s",getname,"GP",gp) @@ -915,7 +916,7 @@ function sepgp:decay_epgp_v2() -- decays entire roster's ep and gp if ep == nil then else if gp == nil then - local msg = string.format("%s\'s officernote is broken:%q",name,tostring(gp)) + local msg = string.format(L["%s\'s officernote is broken:%q"],name,tostring(gp)) self:debugPrint(msg) self:adminSay(msg) else @@ -926,7 +927,7 @@ function sepgp:decay_epgp_v2() -- decays entire roster's ep and gp end end end - local msg = string.format("All EP and GP decayed by %d%%",(1-sepgp_decay)*100) + local msg = string.format(L["All EP and GP decayed by %d%%"],(1-sepgp_decay)*100) self:simpleSay(msg) if not (sepgp_saychannel=="OFFICER") then self:adminSay(msg) end self:addToLog(msg) @@ -943,7 +944,7 @@ function sepgp:decay_epgp_v3() self:update_epgp_v3(ep,gp,i,name,officernote) end end - local msg = string.format("All EP and GP decayed by %s%%",(1-sepgp_decay)*100) + local msg = string.format(L["All EP and GP decayed by %s%%"],(1-sepgp_decay)*100) self:simpleSay(msg) if not (sepgp_saychannel=="OFFICER") then self:adminSay(msg) end local addonMsg = string.format("ALL;DECAY;%s",(1-(sepgp_decay or sepgp.VARS.decay))*100) @@ -956,9 +957,9 @@ function sepgp:gp_reset_v2() for i = 1, GetNumGuildMembers(1) do GuildRosterSetOfficerNote(i, sepgp.VARS.basegp,true) end - self:debugPrint(string.format("All GP has been reset to %d.",sepgp.VARS.basegp)) - self:adminSay(string.format("All GP has been reset to %d.",sepgp.VARS.basegp)) - self:addToLog(string.format("All GP has been reset to %d.",sepgp.VARS.basegp)) + self:debugPrint(string.format(L["All GP has been reset to %d."],sepgp.VARS.basegp)) + self:adminSay(string.format(L["All GP has been reset to %d."],sepgp.VARS.basegp)) + self:addToLog(string.format(L["All GP has been reset to %d."],sepgp.VARS.basegp)) end end @@ -971,7 +972,7 @@ function sepgp:gp_reset_v3() self:update_epgp_v3(0,sepgp.VARS.basegp,i,name,officernote) end end - local msg = "All EP and GP has been reset to 0/%d." + local msg = L["All EP and GP has been reset to 0/%d."] self:debugPrint(string.format(msg,sepgp.VARS.basegp)) self:adminSay(string.format(msg,sepgp.VARS.basegp)) self:addToLog(string.format(msg,sepgp.VARS.basegp)) @@ -1001,11 +1002,11 @@ end function sepgp:my_epgp_announce() local ep,gp = (self:get_ep_v3(self._playerName) or 0), (self:get_gp_v3(self._playerName) or sepgp.VARS.basegp) local pr = ep/gp - local msg = string.format("You now have: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r.", ep,gp,pr) + local msg = string.format(L["You now have: %d EP %d GP |cffffff00%.03f|r|cffff7f00PR|r."], ep,gp,pr) self:defaultPrint(msg) local pr_decay, cap_ep, cap_pr = self:capcalc(ep,gp) if pr_decay < 0 then - msg = string.format("Close to EPGP Cap. Next Decay will change your |cffff7f00PR|r by |cffff0000%.4g|r.",pr_decay) + msg = string.format(L["Close to EPGP Cap. Next Decay will change your |cffff7f00PR|r by |cffff0000%.4g|r."],pr_decay) self:defaultPrint(msg) end end @@ -1026,9 +1027,9 @@ sepgp.tooltipHiddenWhenEmpty = false sepgp.hasIcon = "Interface\\Icons\\INV_Misc_Orb_04" function sepgp:OnTooltipUpdate() - local hint = "|cffffff00Click|r to toggle Standings.%s \n|cffffff00Right-Click|r for Options." + local hint = L["|cffffff00Click|r to toggle Standings.%s \n|cffffff00Right-Click|r for Options."] if (admin()) then - hint = string.format(hint," \n|cffffff00Ctrl+Click|r to toggle Reserves. \n|cffffff00Alt+Click|r to toggle Bids. \n|cffffff00Shift+Click|r to toggle Loot. \n|cffffff00Ctrl+Shift+Click|r to toggle Logs.") + hint = string.format(hint,L[" \n|cffffff00Ctrl+Click|r to toggle Reserves. \n|cffffff00Alt+Click|r to toggle Bids. \n|cffffff00Shift+Click|r to toggle Loot. \n|cffffff00Ctrl+Shift+Click|r to toggle Logs."]) else hint = string.format(hint,"") end @@ -1082,10 +1083,10 @@ end function sepgp:buildClassMemberTable(roster,epgp) local desc,usage if epgp == "ep" then - desc = "Account EPs to %s." + desc = L["Account EPs to %s."] usage = "" elseif epgp == "gp" then - desc = "Account GPs to %s." + desc = L["Account GPs to %s."] usage = "" end local c = { } @@ -1123,21 +1124,21 @@ function sepgp:buildMenu() if not (options) then options = { type = "group", - desc = "shootyepgp options", + desc = L["shootyepgp options"], handler = self, args = { } } options.args["ep"] = { type = "group", - name = "+EPs to Member", - desc = "Account EPs for member.", + name = L["+EPs to Member"], + desc = L["Account EPs for member."], order = 10, hidden = function() return not (admin()) end, } options.args["ep_raid"] = { type = "text", - name = "+EPs to Raid", - desc = "Award EPs to all raid members.", + name = L["+EPs to Raid"], + desc = L["Award EPs to all raid members."], order = 20, get = "suggestedAwardEP", set = function(v) sepgp:award_raid_ep(tonumber(v)) end, @@ -1150,15 +1151,15 @@ function sepgp:buildMenu() } options.args["gp"] = { type = "group", - name = "+GPs to Member", - desc = "Account GPs for member.", + name = L["+GPs to Member"], + desc = L["Account GPs for member."], order = 30, hidden = function() return not (admin()) end, } options.args["ep_reserves"] = { type = "text", - name = "+EPs to Reserves", - desc = "Award EPs to all active Reserves.", + name = L["+EPs to Reserves"], + desc = L["Award EPs to all active Reserves."], order = 40, get = "suggestedAwardEP", set = function(v) sepgp:award_reserve_ep(tonumber(v)) end, @@ -1171,8 +1172,8 @@ function sepgp:buildMenu() } options.args["reserves"] = { type = "toggle", - name = "Enable Reserves", - desc = "Participate in Standby Raiders List.\n|cffff0000Requires Main Character Name.|r", + name = L["Enable Reserves"], + desc = L["Participate in Standby Raiders List.\n|cffff0000Requires Main Character Name.|r"], order = 50, get = function() return (sepgp.reservesChannelID ~= nil) and (sepgp.reservesChannelID ~= 0) end, set = function(v) sepgp:reservesToggle(v) end, @@ -1180,16 +1181,16 @@ function sepgp:buildMenu() } options.args["afkcheck_reserves"] = { type = "execute", - name = "AFK Check Reserves", - desc = "AFK Check Reserves List", + name = L["AFK Check Reserves"], + desc = L["AFK Check Reserves List"], order = 60, hidden = function() return not (admin()) end, func = function() sepgp:afkcheck_reserves() end } options.args["set_main"] = { type = "text", - name = "Set Main", - desc = "Set your Main Character for Reserve List.", + name = L["Set Main"], + desc = L["Set your Main Character for Reserve List."], order = 70, usage = "", get = function() return sepgp_main end, @@ -1197,8 +1198,8 @@ function sepgp:buildMenu() } options.args["raid_only"] = { type = "toggle", - name = "Raid Only", - desc = "Only show members in raid.", + name = L["Raid Only"], + desc = L["Only show members in raid."], order = 80, get = function() return not not sepgp_raidonly end, set = function(v) @@ -1208,8 +1209,8 @@ function sepgp:buildMenu() } options.args["progress_tier"] = { type = "text", - name = "Raid Progress", - desc = "Highest Tier the Guild is raiding.\nUsed to adjust GP Prices.\nUsed for suggested EP awards.", + name = L["Raid Progress"], + desc = L["Highest Tier the Guild is raiding.\nUsed to adjust GP Prices.\nUsed for suggested EP awards."], order = 90, get = function() return sepgp_progress end, set = function(v) @@ -1219,12 +1220,12 @@ function sepgp:buildMenu() sepgp:shareSettings(true) end end, - validate = { ["T3"]="4.Naxxramas", ["T2.5"]="3.Temple of Ahn\'Qiraj", ["T2"]="2.Blackwing Lair", ["T1"]="1.Molten Core"}, + validate = { ["T3"]=L["4.Naxxramas"], ["T2.5"]=L["3.Temple of Ahn\'Qiraj"], ["T2"]=L["2.Blackwing Lair"], ["T1"]=L["1.Molten Core"]}, } options.args["report_channel"] = { type = "text", - name = "Reporting channel", - desc = "Channel used by reporting functions.", + name = L["Reporting channel"], + desc = L["Channel used by reporting functions."], order = 95, hidden = function() return not (admin()) end, get = function() return sepgp_saychannel end, @@ -1233,22 +1234,22 @@ function sepgp:buildMenu() } options.args["decay"] = { type = "execute", - name = "Decay EPGP", - desc = string.format("Decays all EPGP by %s%%",(1-(sepgp_decay or sepgp.VARS.decay))*100), + name = L["Decay EPGP"], + desc = string.format(L["Decays all EPGP by %s%%"],(1-(sepgp_decay or sepgp.VARS.decay))*100), order = 100, hidden = function() return not (admin()) end, func = function() sepgp:decay_epgp_v3() end --DONE: update v3 } options.args["set_decay"] = { type = "range", - name = "Set Decay %", - desc = "Set Decay percentage (Admin only).", + name = L["Set Decay %"], + desc = L["Set Decay percentage (Admin only)."], order = 110, usage = "", get = function() return (1.0-sepgp_decay) end, set = function(v) sepgp_decay = (1 - v) - options.args["decay"].desc = string.format("Decays all EPGP by %s%%",(1-sepgp_decay)*100) + options.args["decay"].desc = string.format(L["Decays all EPGP by %s%%"],(1-sepgp_decay)*100) if (IsGuildLeader()) then sepgp:shareSettings(true) end @@ -1262,8 +1263,8 @@ function sepgp:buildMenu() } options.args["set_discount"] = { type = "range", - name = "Offspec Price %", - desc = "Set Offspec Items GP Percent.", + name = L["Offspec Price %"], + desc = L["Set Offspec Items GP Percent."], order = 115, get = function() return sepgp_discount end, set = function(v) @@ -1279,8 +1280,8 @@ function sepgp:buildMenu() } options.args["reset"] = { type = "execute", - name = "Reset GP", - desc = string.format("Resets everyone\'s EPGP to 0/%d (Admin only).",sepgp.VARS.basegp), + name = L["Reset EPGP"], + desc = string.format(L["Resets everyone\'s EPGP to 0/%d (Admin only)."],sepgp.VARS.basegp), order = 120, hidden = function() return not (IsGuildLeader()) end, func = function() StaticPopup_Show("SHOOTY_EPGP_CONFIRM_RESET") end @@ -1288,7 +1289,7 @@ function sepgp:buildMenu() end if (needInit) or (needRefresh) then local members = sepgp:buildRosterTable() - self:debugPrint(string.format("Scanning %d members for EP/GP data. (%s)",table.getn(members),(sepgp_raidonly and "Raid" or "Full"))) + self:debugPrint(string.format(L["Scanning %d members for EP/GP data. (%s)"],table.getn(members),(sepgp_raidonly and "Raid" or "Full"))) options.args["ep"].args = sepgp:buildClassMemberTable(members,"ep") options.args["gp"].args = sepgp:buildClassMemberTable(members,"gp") if (needInit) then needInit = false end @@ -1394,21 +1395,21 @@ function sepgp:captureReserveChatter(text, sender, _, _, _, _, _, _, channel) reserves_blacklist[reserve_alt] = true table.insert(sepgp.reserves,{reserve,reserve_class,reserve_rank,reserve_alt}) else - self:defaultPrint(string.format("|cffff0000%s|r trying to add %s to Reserves, but has already added a member. Discarding!",reserve_alt,reserve)) + self:defaultPrint(string.format(L["|cffff0000%s|r trying to add %s to Reserves, but has already added a member. Discarding!"],reserve_alt,reserve)) end else if not reserves_blacklist[reserve] then reserves_blacklist[reserve] = true table.insert(sepgp.reserves,{reserve,reserve_class,reserve_rank}) else - self:defaultPrint(string.format("|cffff0000%s|r has already been added to Reserves. Discarding!",reserve)) + self:defaultPrint(string.format(L["|cffff0000%s|r has already been added to Reserves. Discarding!"],reserve)) end end end end return end - local q = string.find(text,"^{shootyepgp}Type") + local q = string.find(text,L["^{shootyepgp}Type"]) if (q) and not (running_check) then if (not UnitInRaid("player")) or (not self:inRaid(sender)) then StaticPopup_Show("SHOOTY_EPGP_RESERVE_AFKCHECK_RESPONCE") @@ -1528,7 +1529,7 @@ end function sepgp:clearBids(reset) if reset~=nil then - self:debugPrint("Clearing old Bids") + self:debugPrint(L["Clearing old Bids"]) end sepgp.bid_item = {} sepgp.bids_main = {} @@ -1741,7 +1742,7 @@ function sepgp:verifyGuildMember(name,silent) end end if (name) and name ~= "" and not (silent) then - self:defaultPrint(string.format("%s not found in the guild or not max level!",name)) + self:defaultPrint(string.format(L["%s not found in the guild or not max level!"],name)) end return end @@ -1764,7 +1765,7 @@ function sepgp:lootMaster() end end -local raidZones = {["Molten Core"]="T1",["Onyxia\'s Lair"]="T1.5",["Blackwing Lair"]="T2",["Ahn'Qiraj"]="T2.5",["Naxxramas"]="T3"} +local raidZones = {[L["Molten Core"]]="T1",[L["Onyxia\'s Lair"]]="T1.5",[L["Blackwing Lair"]]="T2",[L["Ahn\'Qiraj"]]="T2.5",[L["Naxxramas"]]="T3"} local zone_multipliers = { ["T3"] = {["T3"]=1,["T2.5"]=0.75,["T2"]=0.5,["T1.5"]=0.25,["T1"]=0.25}, ["T2.5"] = {["T3"]=1,["T2.5"]=1,["T2"]=0.7,["T1.5"]=0.4,["T1"]=0.4}, @@ -1859,17 +1860,17 @@ end -- Dialogs ------------- StaticPopupDialogs["SHOOTY_EPGP_CLEAR_LOOT"] = { - text = "There are %d loot drops stored. It is recommended to clear loot info before a new raid. Do you want to clear it now?", + text = L["There are %d loot drops stored. It is recommended to clear loot info before a new raid. Do you want to clear it now?"], button1 = TEXT(YES), - button2 = "Show me", + button2 = L["Show me"], OnAccept = function() sepgp_looted = {} - sepgp:defaultPrint("Loot info cleared") + sepgp:defaultPrint(L["Loot info cleared"]) end, OnCancel = function(_,reason) if reason == "clicked" then sepgp_loot:Toggle(true) - sepgp:defaultPrint("Loot info can be cleared at any time from the Tablet context menu or '/shooty clearloot' command") + sepgp:defaultPrint(L["Loot info can be cleared at any time from the Tablet context menu or '/shooty clearloot' command"]) end end, timeout = 0, @@ -1878,7 +1879,7 @@ StaticPopupDialogs["SHOOTY_EPGP_CLEAR_LOOT"] = { hideOnEscape = 1 } StaticPopupDialogs["SHOOTY_EPGP_SET_MAIN"] = { - text = "Set your main to be able to participate in Reserve List EPGP Checks.", + text = L["Set your main to be able to participate in Reserve List EPGP Checks."], button1 = TEXT(ACCEPT), button2 = TEXT(CANCEL), hasEditBox = 1, @@ -1919,7 +1920,7 @@ StaticPopupDialogs["SHOOTY_EPGP_RESERVE_AFKCHECK_RESPONCE"] = { end, OnUpdate = function(elapsed,dialog) this._timeout = this._timeout - elapsed - getglobal(dialog:GetName().."Text"):SetText(string.format("Reserves AFKCheck. Are you available? |cff00ff00%0d|rsec.",this._timeout)) + getglobal(dialog:GetName().."Text"):SetText(string.format(L["Reserves AFKCheck. Are you available? |cff00ff00%0d|rsec."],this._timeout)) if (this._timeout<=0) then this._timeout = 0 dialog:Hide() @@ -1936,7 +1937,7 @@ StaticPopupDialogs["SHOOTY_EPGP_RESERVE_AFKCHECK_RESPONCE"] = { hideOnEscape = 1 } StaticPopupDialogs["SHOOTY_EPGP_CONFIRM_RESET"] = { - text = "|cffff0000Are you sure you want to Reset ALL EPGP?|r", + text = L["|cffff0000Are you sure you want to Reset ALL EPGP?|r"], button1 = TEXT(OKAY), button2 = TEXT(CANCEL), OnAccept = function() @@ -1951,7 +1952,7 @@ StaticPopupDialogs["SHOOTY_EPGP_CONFIRM_RESET"] = { local sepgp_auto_gp_menu = { --{text = "Choose an Action", isTitle = true}, - {text = "Add MainSpec GP", func = function() + {text = L["Add MainSpec GP"], func = function() local dialog = StaticPopup_FindVisible("SHOOTY_EPGP_AUTO_GEARPOINTS") if (dialog) then local data = dialog.data @@ -1964,7 +1965,7 @@ local sepgp_auto_gp_menu = { sepgp_loot:Refresh() end end}, - {text = "Add OffSpec GP", func = function() + {text = L["Add OffSpec GP"], func = function() local dialog = StaticPopup_FindVisible("SHOOTY_EPGP_AUTO_GEARPOINTS") if (dialog) then local data = dialog.data @@ -1977,7 +1978,7 @@ local sepgp_auto_gp_menu = { sepgp_loot:Refresh() end end}, - {text = "Bank or D/E", func = function() + {text = L["Bank or D/E"], func = function() local dialog = StaticPopup_FindVisible("SHOOTY_EPGP_AUTO_GEARPOINTS") if (dialog) then local data = dialog.data @@ -1990,9 +1991,9 @@ local sepgp_auto_gp_menu = { end} } StaticPopupDialogs["SHOOTY_EPGP_AUTO_GEARPOINTS"] = { - text = "%s looted %s. What do you want to do?", - button1 = "GP Actions", - button2 = "Remind me Later", + text = L["%s looted %s. What do you want to do?"], + button1 = L["GP Actions"], + button2 = L["Remind me Later"], OnAccept = function() sepgp:EasyMenu(sepgp_auto_gp_menu, sepgp._menuFrame, this, 0, 0, "MENU") return true diff --git a/shootyepgp.toc b/shootyepgp.toc index 186db57..0710193 100644 --- a/shootyepgp.toc +++ b/shootyepgp.toc @@ -1,12 +1,14 @@ ## Interface: 11200 ## Title: shootyepgp +## Title-zhCN: shootyepgp EPGP插件 V2.1 ## Notes: Effort Points/Gear Points Loot System +## Notes-zhCN: 努力点/齿轮点拾取系统 ## Author: Roadblock ## X-Website: https://github.com/Road-block/shootyepgp/releases/latest ## X-Category: Guild -## X-Credits: shooty +## X-Credits: shooty,Qcat(zhCN) ## Version: 3.31 -## X-Alpha: +## X-Alpha: 3.31.1 ## OptionalDeps: Ace2 ## SavedVariables: sepgp_saychannel, sepgp_groupbyclass, sepgp_raidonly, sepgp_dbver, sepgp_debug ## SavedVariablesPerCharacter: sepgp_main, sepgp_log, sepgp_looted, sepgp_decay, sepgp_reservechannel, sepgp_progress, sepgp_discount @@ -32,6 +34,7 @@ Libs\Tablet-2.0\Tablet-2.0.lua Libs\Gratuity-2.0\Gratuity-2.0.lua Libs\FuBarPlugin-2.0\FuBarPlugin-2.0.lua +localization.lua shootyepgp.lua migrations.lua prices.lua diff --git a/standings.lua b/standings.lua index f7ac178..0861099 100644 --- a/standings.lua +++ b/standings.lua @@ -3,6 +3,7 @@ local D = AceLibrary("Dewdrop-2.0") local C = AceLibrary("Crayon-2.0") local BC = AceLibrary("Babble-Class-2.2") +local L = AceLibrary("AceLocale-2.2"):new("shootyepgp") sepgp_standings = sepgp:NewModule("sepgp_standings", "AceDB-2.0") local shooty_export = CreateFrame("Frame", "shooty_exportframe", UIParent) @@ -30,7 +31,7 @@ shooty_export.action:Hide() shooty_export.action:SetScript("OnClick",function() sepgp_standings.import() end) shooty_export.title = shooty_export:CreateFontString(nil,"OVERLAY") shooty_export.title:SetPoint("TOP",0,-5) -shooty_export.title:SetFont("Fonts\\FRIZQT__.TTF", 12) +shooty_export.title:SetFont("Fonts\\ARIALN.TTF", 12) shooty_export.title:SetWidth(200) shooty_export.title:SetJustifyH("LEFT") shooty_export.title:SetJustifyV("CENTER") @@ -66,7 +67,7 @@ table.insert(UISpecialFrames,"shooty_exportframe") function sepgp_standings:Export() shooty_export.action:Hide() - shooty_export.title:SetText(C:Gold("Ctrl-C to copy. Esc to close.")) + shooty_export.title:SetText(C:Gold(L["Ctrl-C to copy. Esc to close."])) local t = {} for i = 1, GetNumGuildMembers(1) do local name, _, _, _, class, _, note, officernote, _, _ = GetGuildRosterInfo(i) @@ -91,12 +92,7 @@ function sepgp_standings:Import() if not IsGuildLeader() then return end shooty_export.action:Show() shooty_export.title:SetText(C:Red("Ctrl-V to paste data. Esc to close.")) - shooty_export.AddSelectText([[Warning: -Import overwrites all existing EPGP values. - -Paste all the csv data here replacing this text, -then hit Import. -Results will print here when done.]]) + shooty_export.AddSelectText(L.IMPORT_WARNING) shooty_export:Show() end @@ -126,9 +122,9 @@ function sepgp_standings.import() t[name]=nil end end - sepgp:defaultPrint(string.format("Imported %d members.",count)) - local report = string.format("Imported %d members.\n",count) - report = string.format("%s\nFailed to import:",report) + sepgp:defaultPrint(string.format(L["Imported %d members."],count)) + local report = string.format(L["Imported %d members.\n"],count) + report = string.format(L["%s\nFailed to import:"],report) for name,epgp in pairs(t) do report = string.format("%s%s {%s:%s}\n",report,name,t[1],t[2]) end @@ -140,7 +136,7 @@ function sepgp_standings:OnEnable() if not T:IsRegistered("sepgp_standings") then T:Register("sepgp_standings", "children", function() - T:SetTitle("shootyepgp standings") + T:SetTitle(L["shootyepgp standings"]) self:OnTooltipUpdate() end, "showTitleWhenDetached", true, @@ -148,31 +144,31 @@ function sepgp_standings:OnEnable() "cantAttach", true, "menu", function() D:AddLine( - "text", "Raid Only", - "tooltipText", "Only show members in raid.", + "text", L["Raid Only"], + "tooltipText", L["Only show members in raid."], "checked", sepgp_raidonly, "func", function() sepgp_standings:ToggleRaidOnly() end ) D:AddLine( - "text", "Group by class", - "tooltipText", "Group members by class.", + "text", L["Group by class"], + "tooltipText", L["Group members by class."], "checked", sepgp_groupbyclass, "func", function() sepgp_standings:ToggleGroupByClass() end ) D:AddLine( - "text", "Refresh", - "tooltipText", "Refresh window", + "text", L["Refresh"], + "tooltipText", L["Refresh window"], "func", function() sepgp_standings:Refresh() end ) D:AddLine( - "text", "Export", - "tooltipText", "Export standings to csv.", + "text", L["Export"], + "tooltipText", L["Export standings to csv."], "func", function() sepgp_standings:Export() end ) if IsGuildLeader() then D:AddLine( - "text", "Import", - "tooltipText", "Import standings from csv.", + "text", L["Import"], + "tooltipText", L["Import standings from csv."], "func", function() sepgp_standings:Import() end ) end @@ -281,10 +277,10 @@ end function sepgp_standings:OnTooltipUpdate() local cat = T:AddCategory( "columns", 4, - "text", C:Orange("Name"), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", - "text2", C:Orange("ep"), "child_text2R", 1, "child_text2G", 1, "child_text2B", 1, "child_justify2", "RIGHT", - "text3", C:Orange("gp"), "child_text3R", 1, "child_text3G", 1, "child_text3B", 1, "child_justify3", "RIGHT", - "text4", C:Orange("pr"), "child_text4R", 1, "child_text4G", 1, "child_text4B", 0, "child_justify4", "RIGHT" + "text", C:Orange(L["Name"]), "child_textR", 1, "child_textG", 1, "child_textB", 1, "child_justify", "LEFT", + "text2", C:Orange(L["ep"]), "child_text2R", 1, "child_text2G", 1, "child_text2B", 1, "child_justify2", "RIGHT", + "text3", C:Orange(L["gp"]), "child_text3R", 1, "child_text3G", 1, "child_text3B", 1, "child_justify3", "RIGHT", + "text4", C:Orange(L["pr"]), "child_text4R", 1, "child_text4G", 1, "child_text4B", 0, "child_justify4", "RIGHT" ) local t = self:BuildStandingsTable() for i = 1, table.getn(t) do @@ -310,4 +306,4 @@ function sepgp_standings:OnTooltipUpdate() end -- GLOBALS: sepgp_saychannel,sepgp_groupbyclass,sepgp_raidonly,sepgp_decay,sepgp_reservechannel,sepgp_main,sepgp_progress,sepgp_discount,sepgp_log,sepgp_dbver,sepgp_looted --- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs \ No newline at end of file +-- GLOBALS: sepgp,sepgp_prices,sepgp_standings,sepgp_bids,sepgp_loot,sepgp_reserves,sepgp_logs