Closed LordBaryhobal closed 4 months ago
It could also be a good idea to add some automatic values depending on the language. This could be done by setting the default value to auto
and using a dictionary of translatable words.
For example:
#let langs = (
fr: (
toc-title: "Table des matières"
),
en: (
toc-title: "Table of contents"
)
)
#let i18n(lang, key) = {
if not lang in langs {
lang = "fr"
}
let keys = langs.at(lang)
if not key in keys {
panic("I18n key " + key + "doesn't exist")
}
return keys.at(key)
}
#let project(
toc-title: auto
) = {
if toc-title == auto {
toc-title = i18n(language, "toc-title")
}
}
Accepted as a temporary fix, thank you ! A nicer solution will be implemented using your suggestion refered in #8.
added project parameter to change the default table of contents title (default: "Table des matières") fixes #4
Example: