Allow configurationg of a different base locale in Babelfish Script
This commit is contained in:
@@ -40,8 +40,14 @@ local files = {
|
||||
"Options/Options.lua",
|
||||
}
|
||||
|
||||
--[[
|
||||
The Language your addon was originally written in
|
||||
]]
|
||||
local baseLocale = "enUS"
|
||||
|
||||
--[[
|
||||
The supported Languages
|
||||
-- DO NOT INCLUDE the base locale here!
|
||||
]]
|
||||
local locale = {
|
||||
"deDE",
|
||||
@@ -94,10 +100,10 @@ for idx, lang in ipairs(locale) do
|
||||
end
|
||||
|
||||
-- Write enUS file
|
||||
local file = io.open("enUS.lua", "w")
|
||||
local file = io.open(string.format("%s.lua", baseLocale), "w")
|
||||
assert(file, "Could not open enUS.lua for writing")
|
||||
file:write("-- Generated by Babelfish script, do not edit directly.\n")
|
||||
file:write(string.format("local L = LibStub(\"AceLocale-3.0\"):NewLocale(\"%s\", \"enUS\", true)\n", localeName))
|
||||
file:write(string.format("local L = LibStub(\"AceLocale-3.0\"):NewLocale(\"%s\", \"%s\", true)\n", localeName, baseLocale))
|
||||
file:write("\n\n")
|
||||
for idx, match in ipairs(work) do
|
||||
file:write(string.format("L[\"%s\"] = true\n", match))
|
||||
|
||||
Reference in New Issue
Block a user