fix(libs): restore ElvUI-namespaced Ace3 stack clobbered by sweep

The coa-ace3 sweep (commits 0c130e0..5ea6e44, before coa-elvui was added to
EXCLUDED_FORKS in coa-ace3 tools/sweep.py) overwrote ElvUI's customized,
-ElvUI-namespaced Ace3 libs with plain canonical ones. ElvUI registers libs
as AceLocale-3.0-ElvUI and the AceConfig-3.0-ElvUI family (plus -ElvUI
widgets that don't exist in canonical), so the clobber left them
unregistered: ElvUI failed to init (16 locale 'L' errors) and /ec would not
open. Restores ElvUI/Libraries/Ace3/AceLocale-3.0 and the
ElvUI_OptionsUI/Libraries/Ace3 stack to their pre-sweep state (5021fd1).
coa-elvui is now in EXCLUDED_FORKS, so this won't be re-clobbered.
This commit is contained in:
2026-05-25 19:30:48 +02:00
parent 49a3d4c81c
commit 4a1cf548ef
28 changed files with 915 additions and 855 deletions
@@ -2,7 +2,7 @@
-- @class file
-- @name AceLocale-3.0
-- @release $Id$
local MAJOR,MINOR = "AceLocale-3.0", 6
local MAJOR,MINOR = "AceLocale-3.0-ElvUI", 6
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
@@ -12,6 +12,10 @@ if not AceLocale then return end -- no upgrade needed
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"
@@ -87,10 +91,6 @@ local writedefaultproxy = setmetatable({}, {
-- L["string1"] = "Zeichenkette1"
-- @return Locale Table to add localizations to, or nil if the current locale is not required.
function AceLocale:NewLocale(application, locale, isDefault, silent)
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
local activeGameLocale = GAME_LOCALE or gameLocale
local app = AceLocale.apps[application]
if silent and app and getmetatable(app) ~= readmetasilent then
@@ -107,11 +107,14 @@ function AceLocale:NewLocale(application, locale, isDefault, silent)
AceLocale.appnames[app] = application
end
if locale ~= activeGameLocale and not isDefault then
return -- nop, we don't need these translations
-- ElvUI block
if (not app[locale]) or (app[locale] and type(app[locale]) ~= 'table') then
-- app[locale] = setmetatable({}, silent and readmetasilent or readmeta) -- To find missing keys
app[locale] = setmetatable({}, readmetasilent)
end
registering = app -- remember globally for writeproxy and writedefaultproxy
registering = app[locale] -- remember globally for writeproxy and writedefaultproxy
-- end block
if isDefault then
return writedefaultproxy
@@ -125,9 +128,16 @@ end
-- @param application Unique name of addon / module
-- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
-- @return The locale table for the current language.
function AceLocale:GetLocale(application, silent)
if not silent and not AceLocale.apps[application] then
error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
--- Modified by ElvUI to add `locale` as second arg
function AceLocale:GetLocale(application, locale, silent)
if type(locale) == "boolean" then
silent = locale
locale = gameLocale
end
return AceLocale.apps[application]
if not silent and not AceLocale.apps[application] then
error("Usage: GetLocale(application[,locale[, silent]]): 'application' - No locales registered for '"..tostring(application).."'", 2)
end
return AceLocale.apps[application][locale] or AceLocale.apps[application][gameLocale] -- Just in case the table doesn't exist it reverts to default
end