Files
corner/resumé/localize.typ
Romain Paquet fd6a778d1f
All checks were successful
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
add typst resumé (without profile picture)
2025-10-25 18:26:58 +02:00

22 lines
471 B
Typst

#let is-translation-dict(d) = d.keys().first().len() == 2
#let localize(lang, s) = {
let localize-dict(s) = {
if is-translation-dict(s) {
localize(lang, s.at(lang))
} else {
let t = (:)
for (k, v) in s {
t.insert(k, localize(lang, v))
}
t
}
}
let localize-array(s) = s.map(localize.with(lang))
if type(s) == array { localize-array(s) }
else if type(s) == dictionary { localize-dict(s) }
else { s }
}