diff --git a/classes/base.lua b/classes/base.lua index c51df53e9..ae3fb8ad8 100644 --- a/classes/base.lua +++ b/classes/base.lua @@ -45,6 +45,7 @@ class.packages = {} function class:_init (options) if self == options then options = {} end + SILE.languageSupport.loadLanguage('und') -- preload for unlocalized fallbacks self:declareOptions() self:registerRawHandlers() self:registerCommands() diff --git a/classes/book.lua b/classes/book.lua index b56a1e239..7539b897c 100644 --- a/classes/book.lua +++ b/classes/book.lua @@ -104,30 +104,16 @@ function class:registerCommands () if SU.boolean(options.toc, true) then SILE.call("tocentry", { level = level, number = number }, SU.subContent(content)) end - local lang = SILE.settings:get("document.language") if SU.boolean(options.numbering, true) then - if options.prenumber then - if SILE.Commands[options.prenumber .. ":" .. lang] then - options.prenumber = options.prenumber .. ":" .. lang - end - SILE.call(options.prenumber) - end - SILE.call("show-multilevel-counter", { id = "sectioning" }) - if options.postnumber then - if SILE.Commands[options.postnumber .. ":" .. lang] then - options.postnumber = options.postnumber .. ":" .. lang - end - SILE.call(options.postnumber) + if options.msg then + SILE.call("fluent", { number = number }, { options.msg }) + else + SILE.call("show-multilevel-counter", { id = "sectioning" }) end end end) - self:registerCommand("book:chapter:pre", function (_, _) - SILE.call("fluent", {}, { "book-chapter-title-pre" }) - end) - self:registerCommand("book:chapter:post", function (_, _) - SILE.call("fluent", {}, { "book-chapter-post" }) SILE.call("par") end) @@ -157,10 +143,15 @@ function class:registerCommands () numbering = options.numbering, toc = options.toc, level = 1, - prenumber = "book:chapter:pre", - postnumber = "book:chapter:post" + msg = "book-chapter-title" }, content) end) + local lang = SILE.settings:get("document.language") + local postcmd = "book:chapter:post" + if SILE.Commands[postcmd .. ":" .. lang] then + postcmd = postcmd .. ":" .. lang + end + SILE.call(postcmd) SILE.call("book:chapterfont", {}, content) SILE.call("left-running-head", {}, function () SILE.settings:temporarily(function () @@ -180,9 +171,14 @@ function class:registerCommands () SILE.call("book:sectioning", { numbering = options.numbering, toc = options.toc, - level = 2, - postnumber = "book:section:post" + level = 2 }, content) + local lang = SILE.settings:get("document.language") + local postcmd = "book:section:post" + if SILE.Commands[postcmd .. ":" .. lang] then + postcmd = postcmd .. ":" .. lang + end + SILE.call(postcmd) SILE.process(content) end) if not SILE.scratch.counters.folio.off then @@ -215,11 +211,16 @@ function class:registerCommands () SILE.call("book:sectioning", { numbering = options.numbering, toc = options.toc, - level = 3, - postnumber = "book:subsection:post" + level = 3 }, content) SILE.process(content) end) + local lang = SILE.settings:get("document.language") + local postcmd = "book:subsection:post" + if SILE.Commands[postcmd .. ":" .. lang] then + postcmd = postcmd .. ":" .. lang + end + SILE.call(postcmd) SILE.typesetter:leaveHmode() SILE.call("novbreak") SILE.call("medskip") diff --git a/core/languages.lua b/core/languages.lua index b90a9499a..fd084fdd1 100644 --- a/core/languages.lua +++ b/core/languages.lua @@ -65,8 +65,14 @@ SILE.registerCommand("fluent", function (options, content) message = entry:format(options) else SU.warn(string.format("No localized message for %s found in locale %s", key, locale)) + fluent:set_locale('und') + entry = fluent:get_message(key) + if entry then + message = entry:format(options) + end + fluent:set_locale(locale) end - SILE.process({ message }) + SILE.processString(("%s"):format(message), "xml") end, nil, nil, true) SILE.registerCommand("ftl", function (options, content) diff --git a/documentation/c08-language.sil b/documentation/c08-language.sil index 5f6df9ce7..bfa29dda3 100644 --- a/documentation/c08-language.sil +++ b/documentation/c08-language.sil @@ -154,7 +154,7 @@ A particularly common string to override might be the table of contents heading: \begin{verbatim} \line -\\ftl\{toc-heading = Table of Contents\} +\\ftl\{tableofcontents-title = Table of Contents\} \\tableofcontents \line \end{verbatim} diff --git a/i18n/af.ftl b/i18n/af.ftl new file mode 100644 index 000000000..09103c77b --- /dev/null +++ b/i18n/af.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Hoofstuk { $number } + +tableofcontents-title = Inhoudsopgawe diff --git a/i18n/am.ftl b/i18n/am.ftl new file mode 100644 index 000000000..44fd039da --- /dev/null +++ b/i18n/am.ftl @@ -0,0 +1,3 @@ +book-chapter-title = ክፍል { $number } + +tableofcontents-title = ይዘት diff --git a/i18n/ar.ftl b/i18n/ar.ftl new file mode 100644 index 000000000..fb549afb3 --- /dev/null +++ b/i18n/ar.ftl @@ -0,0 +1,3 @@ +book-chapter-title = باب { $number } + +tableofcontents-title = المحتويات diff --git a/i18n/as.ftl b/i18n/as.ftl new file mode 100644 index 000000000..1f2dd4954 --- /dev/null +++ b/i18n/as.ftl @@ -0,0 +1,3 @@ +book-chapter-title = অধ্যায় { $number } + +tableofcontents-title = সমল diff --git a/i18n/bg.ftl b/i18n/bg.ftl new file mode 100644 index 000000000..1a31bd0da --- /dev/null +++ b/i18n/bg.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Глава { $number } + +tableofcontents-title = Съдържание diff --git a/i18n/bn.ftl b/i18n/bn.ftl new file mode 100644 index 000000000..cf1aec593 --- /dev/null +++ b/i18n/bn.ftl @@ -0,0 +1,3 @@ +book-chapter-title = অধ্যায় { $number } + +tableofcontents-title = সূচীপত্র diff --git a/i18n/bo.ftl b/i18n/bo.ftl new file mode 100644 index 000000000..88402b8ac --- /dev/null +++ b/i18n/bo.ftl @@ -0,0 +1,3 @@ +book-chapter-title = ལེའུ་ { $number } + +tableofcontents-title = དཀར་ཆག། diff --git a/i18n/ca.ftl b/i18n/ca.ftl new file mode 100644 index 000000000..53e7b2b0d --- /dev/null +++ b/i18n/ca.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Capítol { $number } + +tableofcontents-title = Índex diff --git a/i18n/cs.ftl b/i18n/cs.ftl index d18f21a96..2d57fd617 100644 --- a/i18n/cs.ftl +++ b/i18n/cs.ftl @@ -1,3 +1,3 @@ -toc-title = Obsah +book-chapter-title = Kapitola { $number } -book-chapter-title-pre = Kapitola{" "} +tableofcontents-title = Obsah diff --git a/i18n/cy.ftl b/i18n/cy.ftl new file mode 100644 index 000000000..0b95d2b4b --- /dev/null +++ b/i18n/cy.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Pennod { $number } + +tableofcontents-title = Cynnwys diff --git a/i18n/da.ftl b/i18n/da.ftl new file mode 100644 index 000000000..eca350585 --- /dev/null +++ b/i18n/da.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Kapitel { $number } + +tableofcontents-title = Indhold diff --git a/i18n/de.ftl b/i18n/de.ftl new file mode 100644 index 000000000..e5c043279 --- /dev/null +++ b/i18n/de.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Kapitel { $number } + +tableofcontents-title = Inhaltsverzeichnis diff --git a/i18n/el-monoton.ftl b/i18n/el-monoton.ftl new file mode 100644 index 000000000..d80cfed81 --- /dev/null +++ b/i18n/el-monoton.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Κεφάλαιο { $number } + +tableofcontents-title = Περιεχόμενα diff --git a/i18n/el-polyton.ftl b/i18n/el-polyton.ftl new file mode 100644 index 000000000..d80cfed81 --- /dev/null +++ b/i18n/el-polyton.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Κεφάλαιο { $number } + +tableofcontents-title = Περιεχόμενα diff --git a/i18n/el.ftl b/i18n/el.ftl new file mode 100644 index 000000000..d80cfed81 --- /dev/null +++ b/i18n/el.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Κεφάλαιο { $number } + +tableofcontents-title = Περιεχόμενα diff --git a/i18n/en.ftl b/i18n/en.ftl index 65d69e6e4..ff55764b7 100644 --- a/i18n/en.ftl +++ b/i18n/en.ftl @@ -1,15 +1,15 @@ -hello = Hello { $name }! +bibliography-and = and -toc-not-generated = Rerun SILE to process the table of contents! +bibliography-edited-by = Edited by { $name } -toc-title = Table of Contents +bibliography-et-al = et al. -book-chapter-title-pre = Chapter{" "} +bibliography-translated-by = Translated by { $name } -bibliography-and = and +book-chapter-title = Chapter { $number } -bibliography-edited-by = Edited by { $name } +hello = Hello { $name }! -bibliography-et-al = et al. +tableofcontents-not-generated = Rerun SILE to process the table of contents! -bibliography-translated-by = Translated by { $name } +tableofcontents-title = Table of Contents diff --git a/i18n/eo.ftl b/i18n/eo.ftl index f2b61a85c..6820ec455 100644 --- a/i18n/eo.ftl +++ b/i18n/eo.ftl @@ -1,11 +1,3 @@ -hello = Saluton { $name }! - -toc-not-generated = Reruli na SILE por trakti la enhavan tabelon! - -toc-title = Enhavoj - -book-chapter-title-pre = Ĉapitro{" "} - bibliography-and = kaj bibliography-edited-by = Redaktita por { $name } @@ -13,3 +5,11 @@ bibliography-edited-by = Redaktita por { $name } bibliography-et-al = kaj aliaj bibliography-translated-by = Tradukita por { $name } + +book-chapter-title = Ĉapitro { $number } + +hello = Saluton { $name }! + +tableofcontents-not-generated = Reruli na SILE por trakti la enhavan tabelon! + +tableofcontents-title = Enhavoj diff --git a/i18n/es.ftl b/i18n/es.ftl new file mode 100644 index 000000000..93ad909a3 --- /dev/null +++ b/i18n/es.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Capítulo { $number } + +tableofcontents-title = Índice diff --git a/i18n/et.ftl b/i18n/et.ftl new file mode 100644 index 000000000..29e063a91 --- /dev/null +++ b/i18n/et.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Peatükk { $number } + +tableofcontents-title = Sisukord diff --git a/i18n/eu.ftl b/i18n/eu.ftl new file mode 100644 index 000000000..33164104f --- /dev/null +++ b/i18n/eu.ftl @@ -0,0 +1,3 @@ +book-chapter-title ={ $number }. Kapitulua + +tableofcontents-title = Gaien Aurkibidea diff --git a/i18n/fi.ftl b/i18n/fi.ftl new file mode 100644 index 000000000..b584078f9 --- /dev/null +++ b/i18n/fi.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Luku { $number } + +tableofcontents-title = Sisällys diff --git a/i18n/fr.ftl b/i18n/fr.ftl new file mode 100644 index 000000000..f11500f98 --- /dev/null +++ b/i18n/fr.ftl @@ -0,0 +1,11 @@ +bibliography-and = et + +bibliography-edited-by = Édité par { $name } + +bibliography-et-al = et al. + +bibliography-translated-by = Traduit par { $name } + +book-chapter-title = Chapitre { $number } + +tableofcontents-title = Table des matières diff --git a/i18n/ga.ftl b/i18n/ga.ftl new file mode 100644 index 000000000..f54b543c6 --- /dev/null +++ b/i18n/ga.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Caibidil { $number } + +tableofcontents-title = Clár Ábhair diff --git a/i18n/gu.ftl b/i18n/gu.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/hi.ftl b/i18n/hi.ftl new file mode 100644 index 000000000..63b9adba6 --- /dev/null +++ b/i18n/hi.ftl @@ -0,0 +1,3 @@ +book-chapter-title = अध्याय { $number } + +tableofcontents-title = अनुक्रम diff --git a/i18n/hr.ftl b/i18n/hr.ftl new file mode 100644 index 000000000..faf413693 --- /dev/null +++ b/i18n/hr.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Poglavlje { $number } + +tableofcontents-title = Sadržaj diff --git a/i18n/hu.ftl b/i18n/hu.ftl new file mode 100644 index 000000000..6499f0985 --- /dev/null +++ b/i18n/hu.ftl @@ -0,0 +1,3 @@ +book-chapter-title = { $number }. fejezet + +tableofcontents-title = Tartalomjegyzék diff --git a/i18n/hy.ftl b/i18n/hy.ftl new file mode 100644 index 000000000..9444e365f --- /dev/null +++ b/i18n/hy.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Գլուխ { $number } + +tableofcontents-title = Բովանդակություն diff --git a/i18n/id.ftl b/i18n/id.ftl new file mode 100644 index 000000000..03a2c85a2 --- /dev/null +++ b/i18n/id.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Bab { $number } + +tableofcontents-title = Daftar Isi diff --git a/i18n/is.ftl b/i18n/is.ftl new file mode 100644 index 000000000..2a3962b49 --- /dev/null +++ b/i18n/is.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Kafli { $number } + +tableofcontents-title = Efnisyfirlit diff --git a/i18n/it.ftl b/i18n/it.ftl new file mode 100644 index 000000000..5ca1c976f --- /dev/null +++ b/i18n/it.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Capitolo { $number } + +tableofcontents-title = Indice diff --git a/i18n/ja.ftl b/i18n/ja.ftl index 3d408f4bf..ba9e6cafb 100644 --- a/i18n/ja.ftl +++ b/i18n/ja.ftl @@ -1,4 +1,3 @@ -# End with thin nonbreaking space (U+202F) -book-chapter-title-pre = 第  +book-chapter-title = 第 { $number } 章 -book-chapter-post =  章 +tableofcontents-title = 目次 diff --git a/i18n/jv.ftl b/i18n/jv.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/ka.ftl b/i18n/ka.ftl new file mode 100644 index 000000000..8ba617b0f --- /dev/null +++ b/i18n/ka.ftl @@ -0,0 +1,3 @@ +book-chapter-title = თავი { $number } + +tableofcontents-title = შინაარსი diff --git a/i18n/kn.ftl b/i18n/kn.ftl new file mode 100644 index 000000000..d0f337f5d --- /dev/null +++ b/i18n/kn.ftl @@ -0,0 +1,3 @@ +book-chapter-title = ಅಧ್ಯಾಯ { $number } + +tableofcontents-title = ವಿಷಯಗಳು diff --git a/i18n/la.ftl b/i18n/la.ftl index 36cd742d4..3ef3a7c31 100644 --- a/i18n/la.ftl +++ b/i18n/la.ftl @@ -1,11 +1,3 @@ -hello = Salve { $name }! - -toc-not-generated = Curre SILE iterum ad mensam contentorum computetur! - -toc-title = Tabula contentorum - -book-chapter-title-pre = Caput{" "} - bibliography-and = et bibliography-edited-by = Conpositor erat { $name } @@ -13,3 +5,11 @@ bibliography-edited-by = Conpositor erat { $name } bibliography-et-al = et al. bibliography-translated-by = Interpres fuit { $name } + +book-chapter-title = Caput { $number } + +hello = Salve { $name }! + +tableofcontents-not-generated = Curre SILE iterum ad mensam contentorum computetur! + +tableofcontents-title = Tabula contentorum diff --git a/i18n/lt.ftl b/i18n/lt.ftl new file mode 100644 index 000000000..17b61fea3 --- /dev/null +++ b/i18n/lt.ftl @@ -0,0 +1,3 @@ +book-chapter-title = { $number } skyrius + +tableofcontents-title = Turinys diff --git a/i18n/lv.ftl b/i18n/lv.ftl new file mode 100644 index 000000000..099887bd1 --- /dev/null +++ b/i18n/lv.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Nodaļa { $number } + +tableofcontents-title = Saturs diff --git a/i18n/ml.ftl b/i18n/ml.ftl new file mode 100644 index 000000000..a43c3c57a --- /dev/null +++ b/i18n/ml.ftl @@ -0,0 +1,3 @@ +book-chapter-title = അദ്ധ്യായം { $number } + +tableofcontents-title = ഉള്ളടക്കം diff --git a/i18n/mr.ftl b/i18n/mr.ftl new file mode 100644 index 000000000..1ab462a65 --- /dev/null +++ b/i18n/mr.ftl @@ -0,0 +1,3 @@ +book-chapter-title = प्रकरण { $number } + +tableofcontents-title = अनुक्रमणिका diff --git a/i18n/my.ftl b/i18n/my.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/nb.ftl b/i18n/nb.ftl deleted file mode 120000 index 6d839d59a..000000000 --- a/i18n/nb.ftl +++ /dev/null @@ -1 +0,0 @@ -no.ftl \ No newline at end of file diff --git a/i18n/nb.ftl b/i18n/nb.ftl new file mode 100644 index 000000000..8f90bec3d --- /dev/null +++ b/i18n/nb.ftl @@ -0,0 +1,15 @@ +bibliography-and = og + +bibliography-edited-by = Redigert av { $name } + +bibliography-et-al = et al. + +bibliography-translated-by = Oversatt av { $name } + +book-chapter-title = Kapittel { $number } + +hello = Hei { $name }! + +tableofcontents-not-generated = Kjør SILE om igjen slik at innholdsfortegnelsen blir behandlet! + +tableofcontents-title = Innhold diff --git a/i18n/nl.ftl b/i18n/nl.ftl new file mode 100644 index 000000000..21e73c66f --- /dev/null +++ b/i18n/nl.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Hoofdstuk { $number } + +tableofcontents-title = Inhoudsopgave diff --git a/i18n/nn.ftl b/i18n/nn.ftl deleted file mode 120000 index 6d839d59a..000000000 --- a/i18n/nn.ftl +++ /dev/null @@ -1 +0,0 @@ -no.ftl \ No newline at end of file diff --git a/i18n/nn.ftl b/i18n/nn.ftl new file mode 100644 index 000000000..56396f588 --- /dev/null +++ b/i18n/nn.ftl @@ -0,0 +1,15 @@ +bibliography-and = og + +bibliography-edited-by = Redigert av { $name } + +bibliography-et-al = et al. + +bibliography-translated-by = Redigert av { $name } + +book-chapter-title = Kapittel { $number } + +hello = Hei { $name }! + +tableofcontents-not-generated = Kjør SILE om igjen slik at innholdsfortegnelsen blir behandlet! + +tableofcontents-title = Innhald diff --git a/i18n/no.ftl b/i18n/no.ftl index e04ba1c99..8f90bec3d 100644 --- a/i18n/no.ftl +++ b/i18n/no.ftl @@ -1,15 +1,15 @@ -hello = Hei { $name }! +bibliography-and = og -toc-not-generated = Kjør SILE om igjen slik at innholdsfortegnelsen blir behandlet! +bibliography-edited-by = Redigert av { $name } -toc-title = Innhold +bibliography-et-al = et al. -book-chapter-title-pre = Kapittel{" "} +bibliography-translated-by = Oversatt av { $name } -bibliography-and = og +book-chapter-title = Kapittel { $number } -bibliography-edited-by = Redigert av { $name } +hello = Hei { $name }! -bibliography-et-al = et al. +tableofcontents-not-generated = Kjør SILE om igjen slik at innholdsfortegnelsen blir behandlet! -bibliography-translated-by = Redigert av { $name } +tableofcontents-title = Innhold diff --git a/i18n/or.ftl b/i18n/or.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/pa.ftl b/i18n/pa.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/pl.ftl b/i18n/pl.ftl new file mode 100644 index 000000000..9ce301abc --- /dev/null +++ b/i18n/pl.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Rozdział { $number } + +tableofcontents-title = Spis treści diff --git a/i18n/pt.ftl b/i18n/pt.ftl new file mode 100644 index 000000000..8991d7c61 --- /dev/null +++ b/i18n/pt.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Capítulo { $number } + +tableofcontents-title = Conteúdo diff --git a/i18n/rm.ftl b/i18n/rm.ftl new file mode 100644 index 000000000..6b17877a9 --- /dev/null +++ b/i18n/rm.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Chapitel { $number } + +tableofcontents-title = Tavla dal cuntegn diff --git a/i18n/ro.ftl b/i18n/ro.ftl new file mode 100644 index 000000000..8c6f4ff4f --- /dev/null +++ b/i18n/ro.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Capitolul { $number } + +tableofcontents-title = Cuprins diff --git a/i18n/ru.ftl b/i18n/ru.ftl new file mode 100644 index 000000000..9dc233fd8 --- /dev/null +++ b/i18n/ru.ftl @@ -0,0 +1,15 @@ +bibliography-and = и + +bibliography-edited-by = Под редакцией { $name } + +bibliography-et-al = и др. + +bibliography-translated-by = Перевод { $name } + +book-chapter-title = Глава { $number } + +hello = Привет { $name }! + +tableofcontents-not-generated = Перезапустите SILE, чтобы обработать оглавление! + +tableofcontents-title = Оглавление diff --git a/i18n/sa.ftl b/i18n/sa.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/i18n/sk.ftl b/i18n/sk.ftl new file mode 100644 index 000000000..2d57fd617 --- /dev/null +++ b/i18n/sk.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Kapitola { $number } + +tableofcontents-title = Obsah diff --git a/i18n/sl.ftl b/i18n/sl.ftl new file mode 100644 index 000000000..9bddee654 --- /dev/null +++ b/i18n/sl.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Poglavje { $number } + +tableofcontents-title = Kazalo diff --git a/i18n/sr.ftl b/i18n/sr.ftl new file mode 100644 index 000000000..c7c0d27f8 --- /dev/null +++ b/i18n/sr.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Глава { $number } + +tableofcontents-title = Садржаj diff --git a/i18n/sv.ftl b/i18n/sv.ftl new file mode 100644 index 000000000..5dcce9c12 --- /dev/null +++ b/i18n/sv.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Kapitel { $number } + +tableofcontents-title = Innehåll diff --git a/i18n/ta.ftl b/i18n/ta.ftl new file mode 100644 index 000000000..8c8d46448 --- /dev/null +++ b/i18n/ta.ftl @@ -0,0 +1,3 @@ +book-chapter-title = அத்தியாயம் { $number } + +tableofcontents-title = உள்ளே diff --git a/i18n/th.ftl b/i18n/th.ftl new file mode 100644 index 000000000..15c0eb11f --- /dev/null +++ b/i18n/th.ftl @@ -0,0 +1,3 @@ +book-chapter-title = บทที่ { $number } + +tableofcontents-title = สารบัญ diff --git a/i18n/tk.ftl b/i18n/tk.ftl new file mode 100644 index 000000000..cb2973a7c --- /dev/null +++ b/i18n/tk.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Bap { $number } + +tableofcontents-title = Mazmuny diff --git a/i18n/tr.ftl b/i18n/tr.ftl index d762e5e32..596de94a6 100644 --- a/i18n/tr.ftl +++ b/i18n/tr.ftl @@ -1,5 +1,5 @@ -hello = Merhaba { $name }! +book-chapter-title = Bölüm { $number } -toc-title = İçindekiler +hello = Merhaba { $name }! -book-chapter-title-pre = Bölüm{" "} +tableofcontents-title = İçindekiler diff --git a/i18n/ug.ftl b/i18n/ug.ftl new file mode 100644 index 000000000..24ca67bf2 --- /dev/null +++ b/i18n/ug.ftl @@ -0,0 +1,3 @@ +book-chapter-title = باب { $number } + +tableofcontents-title = مۇندەرىجە diff --git a/i18n/uk.ftl b/i18n/uk.ftl new file mode 100644 index 000000000..d5af5f0f7 --- /dev/null +++ b/i18n/uk.ftl @@ -0,0 +1,3 @@ +book-chapter-title = Розділ { $number } + +tableofcontents-title = Зміст diff --git a/i18n/und.ftl b/i18n/und.ftl index 586351c8b..84e366897 100644 --- a/i18n/und.ftl +++ b/i18n/und.ftl @@ -1 +1,3 @@ -hello = Namárië { $name }! +hello = Namárië { $name }! + +tableofcontents-not-generated = Rerun SILE to process the table of contents! diff --git a/i18n/ur.ftl b/i18n/ur.ftl new file mode 100644 index 000000000..7b1204cf5 --- /dev/null +++ b/i18n/ur.ftl @@ -0,0 +1,3 @@ +book-chapter-title = باب { $number } + +tableofcontents-title = فہرست عنوانات diff --git a/languages/ja.lua b/languages/ja.lua index fc01df189..4e670e653 100644 --- a/languages/ja.lua +++ b/languages/ja.lua @@ -179,7 +179,6 @@ return { SILE.hyphenator.languages.ja = { patterns={} } SILE.registerCommand("book:chapter:post:ja", function (_, _) - SILE.call("fluent", {}, { "book-chapter-post" }) SILE.call("medskip") end, nil, nil, true) diff --git a/packages/bibtex/bibliography.lua b/packages/bibtex/bibliography.lua index a207135b8..9bf2f686a 100644 --- a/packages/bibtex/bibliography.lua +++ b/packages/bibtex/bibliography.lua @@ -381,7 +381,7 @@ Bibliography = { italic = function (...) local t = {...} return function(item) - return Bibliography._process(item, t, "\\em{", "}") + return Bibliography._process(item, t, "", "") end end, parens = function (...) diff --git a/packages/bibtex/init.lua b/packages/bibtex/init.lua index a682a7cb4..933ad5c78 100644 --- a/packages/bibtex/init.lua +++ b/packages/bibtex/init.lua @@ -96,7 +96,7 @@ function package:registerCommands () SU.warn("Unknown reference in citation "..options.key) return end - SILE.processString(cite, "sil") + SILE.processString(("%s"):format(cite), "xml") end) self:registerCommand("reference", function (options, content) @@ -112,7 +112,7 @@ function package:registerCommands () SU.warn("Unknown type @"..err.." in citation for reference "..options.key) return end - SILE.processString(cite, "sil") + SILE.processString(("%s"):format(cite), "xml") end) end diff --git a/packages/tableofcontents/init.lua b/packages/tableofcontents/init.lua index 816c25528..c80b18f28 100644 --- a/packages/tableofcontents/init.lua +++ b/packages/tableofcontents/init.lua @@ -155,12 +155,12 @@ function package:registerCommands () end) self:registerCommand("tableofcontents:title", function (_, _) - SU.deprecated("\\tableofcontents:title", "\\fluent{toc-title}", "0.13.0", "0.14.0") + SU.deprecated("\\tableofcontents:title", "\\fluent{tableofcontents-title}", "0.13.0", "0.14.0") end, "Deprecated") self:registerCommand("tableofcontents:notocmessage", function (_, _) SILE.call("tableofcontents:headerfont", {}, function () - SILE.call("fluent", {}, { "toc-not-generated" }) + SILE.call("fluent", {}, { "tableofcontents-not-generated" }) end) end) @@ -172,7 +172,7 @@ function package:registerCommands () SILE.call("par") SILE.call("noindent") SILE.call("tableofcontents:headerfont", {}, function () - SILE.call("fluent", {}, { "toc-title" }) + SILE.call("fluent", {}, { "tableofcontents-title" }) end) SILE.call("medskip") end) diff --git a/spec/languages_spec.lua b/spec/languages_spec.lua index e4df4505c..93112bbdb 100644 --- a/spec/languages_spec.lua +++ b/spec/languages_spec.lua @@ -17,7 +17,7 @@ describe("Language module", function () it("should have localizations", function () fluent:set_locale("no") local hello = fluent:get_message("hello")({ name = "Busted" }) - assert.is.equal("Hei Busted!", hello) + assert.is.equal("Hei Busted!", hello) end) describe("Norwegian Bokmål", function () @@ -32,7 +32,7 @@ describe("Language module", function () it("should have localizations", function () local hello = fluent:get_message("hello")({ name = "Busted" }) - assert.is.equal("Hei Busted!", hello) + assert.is.equal("Hei Busted!", hello) end) end) @@ -49,7 +49,7 @@ describe("Language module", function () it("should have localizations", function () local hello = fluent:get_message("hello")({ name = "Busted" }) - assert.is.equal("Hei Busted!", hello) + assert.is.equal("Hei Busted!", hello) end) end) diff --git a/tests/bug-990.expected b/tests/bug-990.expected index abe5010fc..79c7bc9b7 100644 --- a/tests/bug-990.expected +++ b/tests/bug-990.expected @@ -12,20 +12,21 @@ T 36 75 82 77 w=41.9912 (Ahoj) Mx 72.5418 T 86 89 629 87 72 w=47.2441 (světe) Mx 24.7039 -My 126.5222 +My 124.9953 Set font Noto Sans CJK JP;22;800;;normal;;LTR T 29804 w=22.0000 (第) -Mx 46.7326 +Mx 46.7327 Mx 2.4640 T 1 a=4.9280 ( ) +Mx 49.2254 T 19 w=12.2100 (2) -Mx 61.4066 +Mx 61.4641 Mx 4.4000 T 1 a=4.9280 ( ) -Mx 65.8354 +Mx 65.8928 T 29653 w=22.0000 (章) Mx 24.7039 -My 152.7062 +My 151.1793 Mx 14.0360 T 44 a=14.2120 (K) Mx 38.7475 @@ -58,23 +59,23 @@ T 66 w=12.4080 (a) Mx 205.6188 T 74 w=6.0500 (i) Mx 24.7039 -My 191.1062 +My 181.1157 Set font Gentium Plus;22;800;;normal;;LTR T 37 124 79 129 80 w=58.4482 (Bölüm) Mx 89.0038 T 22 w=10.3232 (3) Mx 24.7039 -My 209.0789 +My 199.0884 T 54 72 79 68 80 w=54.3662 (Selam) Mx 84.9113 T 39 129 81 92 68 w=57.7822 (Dünya) Mx 24.7039 -My 247.4789 +My 234.1099 T 38 75 68 83 87 72 85 w=72.1338 (Chapter) Mx 102.6860 T 23 w=10.3232 (4) Mx 24.7039 -My 270.2855 +My 256.9165 T 43 72 79 79 82 w=47.5342 (Hello) Mx 78.0813 T 58 82 85 79 71 w=55.8809 (World) diff --git a/tests/fluent.expected b/tests/fluent.expected index e9131e156..3270159ae 100644 --- a/tests/fluent.expected +++ b/tests/fluent.expected @@ -4,23 +4,33 @@ Mx 14.8819 My 28.5447 Set font Gentium Plus;10;400;;normal;;LTR T 43 72 79 79 82 w=21.6064 (Hello) -Mx 39.1546 -T 58 82 85 79 71 w=25.4004 (World) -Mx 64.5550 +Mx 39.1550 +Set font Gentium Plus;10;400;Italic;normal;;LTR +T 58 82 85 79 71 w=22.5195 (World) +Mx 61.6745 +Set font Gentium Plus;10;400;;normal;;LTR T 4 w=2.7197 (!) Mx 14.8819 My 40.5447 T 48 72 85 75 68 69 68 w=36.4160 (Merhaba) -Mx 53.9625 -T 39 129 81 92 68 w=26.2646 (Dünya) -Mx 80.2271 +Mx 53.9627 +Set font Gentium Plus;10;400;Italic;normal;;LTR +T 39 129 81 92 68 w=24.4141 (Dünya) +Mx 78.3768 +Set font Gentium Plus;10;400;;normal;;LTR T 4 w=2.7197 (!) Mx 14.8819 My 52.5447 -T 39 129 81 92 68 183 92 68 w=38.0762 (Dünya’ya) -Mx 55.6226 +Set font Gentium Plus;10;400;Italic;normal;;LTR +T 39 129 81 92 68 w=24.4141 (Dünya) +Mx 39.2960 +Set font Gentium Plus;10;400;;normal;;LTR +T 183 w=2.2900 (’) +Mx 41.5860 +T 92 68 w=9.5215 (ya) +Mx 53.7722 T 54 72 79 68 80 w=24.7119 (Selam) -Mx 80.3345 +Mx 78.4842 T 4 w=2.7197 (!) End page Finish diff --git a/tests/fluent.sil b/tests/fluent.sil index 5843fdc50..f78935f53 100644 --- a/tests/fluent.sil +++ b/tests/fluent.sil @@ -10,6 +10,6 @@ \fluent[name=Dünya]{hello} % Override the default messages and use the same command -\ftl{hello = { $name }’ya Selam!} +\ftl{hello = { $name }’ya Selam!} \fluent[name=Dünya]{hello} \end{document}