From 4f36978f217cbd5db65499c23d27a1631b12af42 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 3 Mar 2019 19:07:38 +0100 Subject: [PATCH] gui: add translation strings --- modules/gui.lua | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/gui.lua b/modules/gui.lua index 4863e217..0a316abd 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -670,7 +670,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui.unlock:SetPoint("TOPLEFT", pfUI.gui.frames.area.backdrop, "BOTTOMLEFT", 0, -5) pfUI.gui.unlock:SetWidth(110) pfUI.gui.unlock:SetHeight(25) - pfUI.gui.unlock:SetText("Unlock") + pfUI.gui.unlock:SetText(T["Unlock"]) pfUI.gui.unlock:SetScript("OnClick", function() if pfUI.unlock then pfUI.unlock:Show() end end) @@ -681,7 +681,7 @@ pfUI:RegisterModule("gui", function () pfUI.gui.hoverbind:SetPoint("LEFT", pfUI.gui.unlock, "RIGHT", 5, 0) pfUI.gui.hoverbind:SetWidth(110) pfUI.gui.hoverbind:SetHeight(25) - pfUI.gui.hoverbind:SetText("Hoverbind") + pfUI.gui.hoverbind:SetText(T["Hoverbind"]) pfUI.gui.hoverbind:SetScript("OnClick", function() if pfUI.hoverbind then pfUI.hoverbind:Show() end end) @@ -693,12 +693,11 @@ pfUI:RegisterModule("gui", function () pfUI.gui.share:SetPoint("LEFT", pfUI.gui.hoverbind, "RIGHT", 5, 0) pfUI.gui.share:SetWidth(110) pfUI.gui.share:SetHeight(25) - pfUI.gui.share:SetText("Share") + pfUI.gui.share:SetText(T["Share"]) pfUI.gui.share:SetScript("OnClick", function() if pfShare then pfShare:Show() pfShareExport:Click() - pfUI.gui:Hide() end end) SkinButton(pfUI.gui.share) @@ -1061,7 +1060,7 @@ pfUI:RegisterModule("gui", function () do -- Generate Config UI CreateGUIEntry(T["About"], nil, function() -- read data - local lang = "Unknown" + local lang = T["Unknown"] for _, entry in pairs(pfUI.gui.dropdowns.languages) do local short, full = strsplit(":", entry) if short == C.global.language then @@ -1095,7 +1094,7 @@ pfUI:RegisterModule("gui", function () this.versionc:SetPoint("TOPLEFT", 200, -170) this.versionc:SetWidth(200) this.versionc:SetJustifyH("LEFT") - this.versionc:SetText("Version" .. ":") + this.versionc:SetText(T["Version"] .. ":") this.version = this:CreateFontString("Status", "LOW", "GameFontWhite") this.version:SetFont(pfUI.font_default, C.global.font_size) this.version:SetPoint("TOPRIGHT", 375, -170) @@ -1127,7 +1126,7 @@ pfUI:RegisterModule("gui", function () this.screenc:SetPoint("TOPLEFT", 200, -200) this.screenc:SetWidth(200) this.screenc:SetJustifyH("LEFT") - this.screenc:SetText("Resolution" .. ":") + this.screenc:SetText(T["Resolution"] .. ":") this.screen = this:CreateFontString("Status", "LOW", "GameFontWhite") this.screen:SetFont(pfUI.font_default, C.global.font_size) this.screen:SetPoint("TOPRIGHT", 375, -200) @@ -1140,7 +1139,7 @@ pfUI:RegisterModule("gui", function () this.scalec:SetPoint("TOPLEFT", 200, -220) this.scalec:SetWidth(200) this.scalec:SetJustifyH("LEFT") - this.scalec:SetText("Scaling" .. ":") + this.scalec:SetText(T["Scaling"] .. ":") this.scale = this:CreateFontString("Status", "LOW", "GameFontWhite") this.scale:SetFont(pfUI.font_default, C.global.font_size) this.scale:SetPoint("TOPRIGHT", 375, -220) @@ -1153,7 +1152,7 @@ pfUI:RegisterModule("gui", function () this.clientc:SetPoint("TOPLEFT", 200, -250) this.clientc:SetWidth(200) this.clientc:SetJustifyH("LEFT") - this.clientc:SetText("Gameclient" .. ":") + this.clientc:SetText(T["Gameclient"] .. ":") this.client = this:CreateFontString("Status", "LOW", "GameFontWhite") this.client:SetFont(pfUI.font_default, C.global.font_size) this.client:SetPoint("TOPRIGHT", 375, -250) @@ -1166,7 +1165,7 @@ pfUI:RegisterModule("gui", function () this.langc:SetPoint("TOPLEFT", 200, -270) this.langc:SetWidth(200) this.langc:SetJustifyH("LEFT") - this.langc:SetText("Language" .. ":") + this.langc:SetText(T["Language"] .. ":") this.lang = this:CreateFontString("Status", "LOW", "GameFontWhite") this.lang:SetFont(pfUI.font_default, C.global.font_size) this.lang:SetPoint("TOPRIGHT", 375, -270) @@ -1178,7 +1177,7 @@ pfUI:RegisterModule("gui", function () discord:SetPoint("TOPLEFT", 150, -335) discord:SetWidth(125) discord:SetHeight(20) - discord:SetText("Join Discord") + discord:SetText(T["Join Discord"]) discord:SetScript("OnClick", function() pfUI.chat.urlcopy.CopyText("https://discord.gg/QTRKanu") end) @@ -1188,7 +1187,7 @@ pfUI:RegisterModule("gui", function () website:SetPoint("TOPLEFT", 300, -335) website:SetWidth(125) website:SetHeight(20) - website:SetText("Website") + website:SetText(T["Website"]) website:SetScript("OnClick", function() pfUI.chat.urlcopy.CopyText("https://shagu.org/pfUI") end) @@ -1430,7 +1429,7 @@ pfUI:RegisterModule("gui", function () local c = data[1] local t = data[2] - CreateGUIEntry(label == "uf" and "Unit Frames" or "Group Frames", t, function() + CreateGUIEntry(label == "uf" and T["Unit Frames"] or T["Group Frames"], t, function() -- build config entries CreateConfig(U[c], T["Display Frame"] .. ": " .. t, C.unitframes[c], "visible", "checkbox") CreateConfig(U[c], T["Enable Mouseover Tooltip"], C.unitframes[c], "showtooltip", "checkbox")