update `pandoc` data dir

master
urosm 2024-06-26 16:09:18 +02:00
parent fe30884f58
commit 8f8f05a200
1 changed files with 12 additions and 5 deletions

View File

@ -1,12 +1,19 @@
SCRIPT_NAME = "current_date.lua"
os.setlocale("C")
local utils = pandoc.utils
LOCALEMAP = {
de = "de_DE.UTF-8",
en = "en_US.UTF-8",
it = "it_IT.UTF-8",
sl = "sl_SI.UTF-8",
}
return {
{ Meta = function(m)
if m.date == nil then
os.setlocale(os.getenv("LANG"))
m.date = os.date("%c")
return m
end
os.setlocale(LOCALEMAP[utils.stringify(m.lang)])
m.date = os.date("%c")
return m
end }
}