57a5cdabdf
Imported from /srv/add01/wow-ascension/Interface/AddOns/Bartender4 — the build Ascension's WotLK 3.3.5 client ships. Single vendored drop: Ascension's build process bundles their custom patches with the standard CurseForge packager output (embedded libs), and the individual patches aren't published separately. Net delta vs Nevcairiel 4.4.2, excluding bundled libs and CRLF normalization: 21 files, 2213+/52- — the Ascension-specific adaptations for WotLK 3.3.5 hero classes / custom action systems. License: All rights reserved (per .toc).
71 lines
1.4 KiB
Lua
71 lines
1.4 KiB
Lua
#!/usr/local/bin/lua
|
|
|
|
-- CONFIG --
|
|
|
|
--[[
|
|
Prefix to all files if this script is run from a subdir, for example
|
|
]]
|
|
local filePrefix = "../"
|
|
|
|
--[[
|
|
List of all files to parse
|
|
]]
|
|
local files = {
|
|
"ActionBar.lua",
|
|
"ActionBars.lua",
|
|
"ActionButton.lua",
|
|
"BagBar.lua",
|
|
"Bar.lua",
|
|
"Bartender4.lua",
|
|
"ButtonBar.lua",
|
|
"MicroMenu.lua",
|
|
"MultiCastBar.lua",
|
|
"PetBar.lua",
|
|
"PetButton.lua",
|
|
"RepXPBar.lua",
|
|
"StanceBar.lua",
|
|
"StateBar.lua",
|
|
"VehicleBar.lua",
|
|
--
|
|
"Options/ActionBar.lua",
|
|
"Options/BagBar.lua",
|
|
"Options/Bar.lua",
|
|
"Options/ButtonBar.lua",
|
|
"Options/MicroMenu.lua",
|
|
"Options/MultiCastBar.lua",
|
|
"Options/Options.lua",
|
|
"Options/PetBar.lua",
|
|
"Options/RepXPBar.lua",
|
|
"Options/StanceBar.lua",
|
|
"Options/StateBar.lua",
|
|
"Options/VehicleBar.lua",
|
|
}
|
|
|
|
local out = "Strings.lua"
|
|
-- CODE --
|
|
|
|
local strings = {}
|
|
|
|
-- extract data from specified lua files
|
|
for idx,filename in pairs(files) do
|
|
local file = io.open(string.format("%s%s", filePrefix or "", filename), "r")
|
|
assert(file, "Could not open " .. filename)
|
|
local text = file:read("*all")
|
|
|
|
for match in string.gmatch(text, "L%[\"(.-)\"%]") do
|
|
strings[match] = true
|
|
end
|
|
end
|
|
|
|
local work = {}
|
|
|
|
for k,v in pairs(strings) do table.insert(work, k) end
|
|
table.sort(work)
|
|
|
|
-- Write locale files
|
|
local file = io.open(out, "w")
|
|
for idx, match in ipairs(work) do
|
|
file:write(string.format("L[\"%s\"] = true\n", match))
|
|
end
|
|
file:close()
|