#!/usr/bin/env texlua local ldl_texts = languages.data.labels.texts local u = utf local function localize_it (str, lang) local current_language = lang or languages.current(tex.language) return ldl_texts[u.lower(str)].labels[current_language] end local function modification_date (filename, format) local attr = lfs.attributes(filename) if type(attr) == "table" and attr.mode ~= "directory" then if format == "nice" then return os.date("%Y-%m-%dT%X",attr.modification) .. os.timezone(true) elseif format == "long" then local tmp = string.explode(os.date("%d %B %Y %H:%M",attr.modification), " ") local day, month, year, time = table.unpack(tmp) return day .. ". " .. localize_it(month) .. " " .. year .. " " .. time else local tmp = string.explode(os.date("%d %B %Y",attr.modification), " ") local day, month, year = table.unpack(tmp) return day .. ". " .. localize_it(month) .. " " .. year end end return "" end documentdata.modification_date = modification_date