comparison Modules/BeanCounterSupport.lua @ 68:eadff31e61e8

Localization of all files. Testing packager settings (especially automatic locale exports), localization is not yet finished.
author Zerotorescue
date Wed, 15 Sep 2010 13:10:56 +0200
parents 90d58723ac0a
children f01e0184a275
comparison
equal deleted inserted replaced
67:4166a335ca81 68:eadff31e61e8
1 local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener"); 1 local MailOpener = LibStub("AceAddon-3.0"):GetAddon("MailOpener");
2 local mod = MailOpener:NewModule("BeanCounterSupport", "AceEvent-3.0", "AceHook-3.0"); 2 local mod = MailOpener:NewModule("BeanCounterSupport", "AceEvent-3.0", "AceHook-3.0");
3 3
4 mod.moduleDescription = "Prevents mail opening while BeanCounter is still scanning. Does nothing when BeanCounter is disabled."; 4 mod.moduleDescription = L["Prevents mail opening while BeanCounter is still scanning. Does nothing when BeanCounter is disabled."];
5 mod.moduleRequired = false; 5 mod.moduleRequired = false;
6 6
7 local MailAddonName = "BeanCounter"; -- what to fill the global MailAddonBusy with 7 local MailAddonName = "BeanCounter"; -- what to fill the global MailAddonBusy with
8 local refMonitoredFrame; -- reference to the frame we will be monitoring 8 local refMonitoredFrame; -- reference to the frame we will be monitoring
9 9
102 102
103 function mod:GetOptionsGroup() 103 function mod:GetOptionsGroup()
104 local configGroup = { 104 local configGroup = {
105 order = 0, 105 order = 0,
106 type = "modulesSubGroup", 106 type = "modulesSubGroup",
107 name = "BeanCounter Support", 107 name = L["BeanCounter Support"],
108 desc = "Change settings for the BeanCounter Support module.", 108 desc = L["Change settings for the BeanCounter Support module."],
109 args = { 109 args = {
110 General = { 110 General = {
111 order = 10, 111 order = 10,
112 type = "group", 112 type = "group",
113 inline = true, 113 inline = true,
114 name = "General", 114 name = L["General"],
115 args = { 115 args = {
116 description = { 116 description = {
117 order = 10, 117 order = 10,
118 type = "description", 118 type = "description",
119 name = function() 119 name = function()
120 local descText = "With this button you can completely toggle this module |cff00ff00on|r or |cffff0000off|r. This setting will be remembered and the module will be automatically toggled |cff00ff00on|r or |cffff0000off|r upon logon as it was last set.\n\n"; 120 local descText = L["With this button you can completely toggle this module |cff00ff00on|r or |cffff0000off|r. This setting will be remembered and the module will be automatically toggled |cff00ff00on|r or |cffff0000off|r upon logon as it was last set."] .. "\n\n";
121 121
122 -- Behavior info 122 -- Behavior info
123 descText = descText .. "|cfffed000Please note this module will only be enabled when the addon \"BeanCounter\" is enabled. This module will be disabled when BeanCounter could not be found and enabled when it can unless you manually disabled this module.|r\n\n"; 123 descText = descText .. L["|cfffed000Please note this module will only be enabled when the addon \"BeanCounter\" is enabled. This module will be disabled when BeanCounter could not be found and enabled when it can unless you manually disabled this module.|r"] .. "\n\n";
124 124
125 -- Final warning 125 -- Final warning
126 descText = descText .. "|cffff0000You are strongly adviced to leave this module enabled unless you have very good reasons not to.|r\n\n"; 126 descText = descText .. L["|cffff0000You are strongly adviced to leave this module enabled unless you have very good reasons not to.|r"] .. "\n\n";
127 127
128 if self:IsEnabled() then 128 if self:IsEnabled() then
129 descText = descText .. "Status: |cff00ff00Enabled|r"; 129 descText = descText .. L["Status: %s"]:format(L["|cff00ff00Enabled|r"]);
130 else 130 else
131 descText = descText .. "Status: |cffff0000Disabled|r"; 131 descText = descText .. L["Status: %s"]:format(L["|cffff0000Disabled|r"]);
132 end 132 end
133 133
134 return descText; 134 return descText;
135 end, 135 end,
136 }, 136 },
137 disable = { 137 disable = {
138 order = 20, 138 order = 20,
139 type = "execute", 139 type = "execute",
140 name = function() 140 name = function()
141 if self:IsEnabled() then 141 if self:IsEnabled() then
142 return "Disable Module"; 142 return L["Disable Module"];
143 else 143 else
144 return "Enable Module"; 144 return L["Enable Module"];
145 end 145 end
146 end, 146 end,
147 desc = "Click here to completely toggle this module on or off.", 147 desc = L["Click here to completely toggle this module on or off."],
148 width = "double", 148 width = "double",
149 func = function() 149 func = function()
150 if self:IsEnabled() then 150 if self:IsEnabled() then
151 self:Disable(); 151 self:Disable();
152 152
157 MailOpener.db.profile.modules[self:GetName()] = nil; 157 MailOpener.db.profile.modules[self:GetName()] = nil;
158 end 158 end
159 end, 159 end,
160 confirm = function() 160 confirm = function()
161 if self:IsEnabled() then 161 if self:IsEnabled() then
162 return "Are you sure you want to disable this module?\n\nIt will only be active when needed and disabling it may cause your BeanCounter data to become incomplete. Leaving it on causes no harm."; 162 return L["Are you sure you want to disable this module?\n\nIt will only be active when needed and disabling it may cause your BeanCounter data to become incomplete. Leaving it on causes no harm."];
163 else 163 else
164 return false; 164 return false;
165 end 165 end
166 end, 166 end,
167 }, 167 },