dbtoepub book.xml -o $@
mekaniker-ordbok-nb.html: $(SOURCE_NB)
- xmlto html-nochunks book.xml
+ xmlto -m pdf.xsl html-nochunks book.xml
mv book.html $@
book-sme.xml: book.xml
-# dblatex do not understand lang="sme", use "nb" for now
-# sed -e 's/-nb/-sme/' -e 's/"nb"/"sme"/' < $^ >$@
- sed -e 's/-nb/-sme/' < $^ >$@
+# dblatex do not understand lang="sme", use "nn" with workarounds in pdf.xsl
+ sed -e 's/-nb/-sme/' -e 's/"nb"/"nn"/' < $^ >$@
mekaniker-ordbok-sme.pdf: $(SOURCE_SME)
dblatex $(DBLATEX_OPTS) -o $@ book-sme.xml
dbtoepub book-sme.xml -o $@
mekaniker-ordbok-sme.html: $(SOURCE_SME)
- xmlto html-nochunks book-sme.xml
+ xmlto -m pdf.xsl html-nochunks book-sme.xml
mv book-sme.html $@
<!-- disable chapter numbering for glossary -->
<xsl:param name="glossary.numbered">0</xsl:param>
+ <!-- disable chapter numbering for index -->
+ <xsl:param name="index.numbered">0</xsl:param>
+
+ <xsl:param name="local.l10n.xml" select="document('')"/>
+ <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
+ <l:l10n language="nb">
+ <!-- Fix bugs in default nb locale -->
+ <l:dingbat key="startquote" text="«"/>
+ <l:dingbat key="endquote" text="»"/>
+ <l:dingbat key="nestedstartquote" text="‘"/>
+ <l:dingbat key="nestedendquote" text="’"/>
+ </l:l10n>
+ <l:l10n language="nn">
+ <!-- Fix bugs in default nn locale -->
+ <l:dingbat key="startquote" text="«"/>
+ <l:dingbat key="endquote" text="»"/>
+ <l:dingbat key="nestedstartquote" text="‘"/>
+ <l:dingbat key="nestedendquote" text="’"/>
+
+ <!--
+Workaround for missing 'sme' support in dblatex/docbook, use 'nn' as
+replacement and rewrite the strings we use. Note PDF use some of
+these, while HTML uses others.
+
+A more future proof approach that would help others would be to submit
+a sme.xsl file to
+https://github.com/docbook/xslt10-stylesheets/tree/master/gentext/locale .
+ -->
+ <l:gentext key="Copyright" text="Opphavsrett (sme)"/>
+ <l:gentext key="Glossary" text="Ordliste (sme)"/>
+ <l:gentext key="glossary" text="ordliste (sme)"/>
+ <l:gentext key="glosssee" text="se (sme)"/>
+ <l:gentext key="GlossSee" text="Se (sme)"/>
+ <l:context name="glossary">
+ <l:template name="see" text="Se «%t». (sme)"/>
+ </l:context>
+ </l:l10n>
+ </l:i18n>
+
</xsl:stylesheet>