From d607cdb3b629c3a971ff05b55822c6724080c022 Mon Sep 17 00:00:00 2001 From: atomaka Date: Fri, 23 Sep 2011 06:36:34 -0400 Subject: [PATCH] Add localization via AceLocale. --- .pkgmeta | 1 + ChoreTracker.lua | 38 ++++++++++++++++++++------------------ ChoreTracker.toc | 11 +++++++++++ Locale/deDE.lua | 4 ++++ Locale/enUS.lua | 3 +++ Locale/esES.lua | 4 ++++ Locale/esMX.lua | 4 ++++ Locale/frFR.lua | 4 ++++ Locale/koKR.lua | 4 ++++ Locale/ruRU.lua | 4 ++++ Locale/zhCN.lua | 4 ++++ Locale/zhTW.lua | 4 ++++ 12 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 Locale/deDE.lua create mode 100644 Locale/enUS.lua create mode 100644 Locale/esES.lua create mode 100644 Locale/esMX.lua create mode 100644 Locale/frFR.lua create mode 100644 Locale/koKR.lua create mode 100644 Locale/ruRU.lua create mode 100644 Locale/zhCN.lua create mode 100644 Locale/zhTW.lua diff --git a/.pkgmeta b/.pkgmeta index 1d42bc4..75de26d 100644 --- a/.pkgmeta +++ b/.pkgmeta @@ -8,6 +8,7 @@ externals: Libs/AceConfig-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk Libs/AceDB-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceDB-3.0 Libs/AceEvent-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceEvent-3.0 + Libs/AceLocale-3.0: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceLocale-3.0 Libs/LibBabble-Zone-3.0: svn://svn.wowace.com/wow/libbabble-zone-3-0/mainline/trunk Libs/LibQTip-1.0: svn://svn.wowace.com/wow/libqtip-1-0/mainline/trunk Libs/LibDBIcon-1.0: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0 \ No newline at end of file diff --git a/ChoreTracker.lua b/ChoreTracker.lua index 12c142d..3625330 100644 --- a/ChoreTracker.lua +++ b/ChoreTracker.lua @@ -3,6 +3,9 @@ local core = ChoreTracker local LQT, LDB, LDBIcon, LBZ local db, tooltip, Z, vpResetTime +-- Localization +local L = LibStub('AceLocale-3.0'):GetLocale('ChoreTracker') + -- Get localized instances LBZ = LibStub('LibBabble-Zone-3.0') Z = LBZ:GetLookupTable() @@ -17,7 +20,6 @@ local defaults = { sortDirection = 1, vertSortDirection = 1, vpPos = 1, - -- Change table? ['Baradin Hold'] = { abbreviation = 'BH', enable = true } instances = { [Z['Baradin Hold']] = { abbreviation = 'BH', enable = true, removed = false, }, [Z['Firelands']] = { abbreviation = 'FL', enable = true, removed = false, }, @@ -33,42 +35,42 @@ local options = { type = 'group', args = { general = { - name = 'Settings', + name = L['Settings'], type = 'group', order = 1, args = { minimap = { - name = 'Hide Minimap Icon', - desc = 'Removes the icon from your minimap.', + name = L['Hide Minimap Icon'], + desc = L['Removes the icon from your minimap.'], type = 'toggle', order = 1, get = function(info) return db.profile.minimap.hide end, set = function(info, value) db.profile.minimap.hide = value LDBIcon[value and 'Hide' or 'Show'](LDBIcon, 'ChoreTracker') end, }, verticalHeader = { - name = 'Vertical Sorting', + name = L['Vertical Sorting'], type = 'header', order = 2, }, sortType = { - name = 'Sort Field', - desc = 'Field to sort the tooltip by.', + name = L['Sort Field'], + desc = L['Field to sort the tooltip by.'], type = 'select', order = 3, - values = { 'Character', 'Valor Points', 'Class' }, + values = { L['Character'], L['Valor Points'], L['Class'] }, get = function(info) return db.profile.sortType end, set = function(info, value) db.profile.sortType = value end, }, sortingDirection = { - name = 'Sorting Direction', - desc = 'Which direction to sort.', + name = L['Sorting Direction'], + desc = L['Which direction to sort.'], type = 'select', order = 4, - values = { 'Ascending', 'Descending' }, + values = { L['Ascending'], L['Descending'] }, get = function(info) return db.profile.sortDirection end, set = function(info, value) db.profile.sortDirection = value end, }, - horizontalHeader = { + --[[horizontalHeader = { name = 'Horizontal Sorting', type = 'header', order = 5, @@ -90,11 +92,11 @@ local options = { values = { 'Ascending', 'Descending' }, get = function(info) return db.profile.vertSortDirection end, set = function(info, value) db.profile.vertSortDirection = value end, - }, + },]]-- }, }, instances = { - name = 'Instances', + name = L['Instances'], type = 'group', order = 2, args = { @@ -241,8 +243,8 @@ end function core:DrawInstanceOptions() options.args.instances.args = { instance = { - name = 'Add instance to track.', - desc = 'Enter an instance on a lockout that you would like ChoreTracker to track.', + name = L['Add instance to track.'], + desc = L['Enter an instance on a lockout that you would like ChoreTracker to track.'], type = 'input', order = 1, set = function(info, value) @@ -259,7 +261,7 @@ function core:DrawInstanceOptions() end, }, instancesHeader = { - name = 'Instances', + name = L['Instances'], type = 'header', order = 2, }, @@ -287,7 +289,7 @@ function core:DrawInstanceOptions() } options.args.instances.args[instance .. 'Remove'] = { type = 'execute', - name = 'Remove', + name = L['Remove'], order = 4 * i + 2, width = 'half', confirm = true, diff --git a/ChoreTracker.toc b/ChoreTracker.toc index 193ee82..9ee0e0b 100644 --- a/ChoreTracker.toc +++ b/ChoreTracker.toc @@ -14,9 +14,20 @@ Libs\AceConsole-3.0\AceConsole-3.0.xml Libs\AceConfig-3.0\AceConfig-3.0.xml Libs\AceDB-3.0\AceDB-3.0.xml Libs\AceEvent-3.0\AceEvent-3.0.xml +Libs\AceLocale-3.0\AceLocale-3.0.xml Libs\LibBabble-Zone-3.0\lib.xml Libs\LibDataBroker-1.1\LibDataBroker-1.1.lua Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua Libs\LibQTip-1.0\lib.xml +Locale\enUS.lua +Locale\deDE.lua +Locale\esES.lua +Locale\esMX.lua +Locale\frFR.lua +Locale\koKR.lua +Locale\ruRU.lua +Locale\zhCN.lua +Locale\zhTW.lua + ChoreTracker.lua \ No newline at end of file diff --git a/Locale/deDE.lua b/Locale/deDE.lua new file mode 100644 index 0000000..cb723c5 --- /dev/null +++ b/Locale/deDE.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "deDE") +if not L then return end + +--@localization(locale="deDE", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/enUS.lua b/Locale/enUS.lua new file mode 100644 index 0000000..1ba8948 --- /dev/null +++ b/Locale/enUS.lua @@ -0,0 +1,3 @@ +local L = LibStub('AceLocale-3.0'):NewLocale('ChoreTracker', 'enUS', true, true) + +--@localization(locale='enUS', format='lua_additive_table', same-key-is-true=true, handle-subnamespaces='concat')@ \ No newline at end of file diff --git a/Locale/esES.lua b/Locale/esES.lua new file mode 100644 index 0000000..98c45f3 --- /dev/null +++ b/Locale/esES.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "esES") +if not L then return end + +--@localization(locale="esES", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/esMX.lua b/Locale/esMX.lua new file mode 100644 index 0000000..f1b866f --- /dev/null +++ b/Locale/esMX.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "esMX") +if not L then return end + +--@localization(locale="esMX", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/frFR.lua b/Locale/frFR.lua new file mode 100644 index 0000000..1527dbc --- /dev/null +++ b/Locale/frFR.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "frFR") +if not L then return end + +--@localization(locale="frFR", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/koKR.lua b/Locale/koKR.lua new file mode 100644 index 0000000..1299b94 --- /dev/null +++ b/Locale/koKR.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "koKR") +if not L then return end + +--@localization(locale="koKR", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/ruRU.lua b/Locale/ruRU.lua new file mode 100644 index 0000000..50bf5d6 --- /dev/null +++ b/Locale/ruRU.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "ruRU") +if not L then return end + +--@localization(locale="ruRU", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/zhCN.lua b/Locale/zhCN.lua new file mode 100644 index 0000000..8a493e6 --- /dev/null +++ b/Locale/zhCN.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "zhCN") +if not L then return end + +--@localization(locale="zhCN", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file diff --git a/Locale/zhTW.lua b/Locale/zhTW.lua new file mode 100644 index 0000000..334f1be --- /dev/null +++ b/Locale/zhTW.lua @@ -0,0 +1,4 @@ +local L = LibStub("AceLocale-3.0"):NewLocale("BalerocHealers", "zhTW") +if not L then return end + +--@localization(locale="zhTW", format="lua_additive_table", handle-subnamespaces="concat")@ \ No newline at end of file