/trunk/Libs/AceLocale-3.0
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings. |
-- @class file |
-- @name AceLocale-3.0 |
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $ |
-- @release $Id: AceLocale-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ |
local MAJOR,MINOR = "AceLocale-3.0", 6 |
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
local assert, tostring, error = assert, tostring, error |
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget |
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: GAME_LOCALE, geterrorhandler |
local gameLocale = GetLocale() |
if gameLocale == "enGB" then |
gameLocale = "enUS" |
function AceLocale:NewLocale(application, locale, isDefault, silent) |
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed |
local gameLocale = GAME_LOCALE or gameLocale |
local activeGameLocale = GAME_LOCALE or gameLocale |
local app = AceLocale.apps[application] |
AceLocale.appnames[app] = application |
end |
if locale ~= gameLocale and not isDefault then |
if locale ~= activeGameLocale and not isDefault then |
return -- nop, we don't need these translations |
end |