]> pere.pagekite.me Git - homepage.git/blob - blog/data/2012-08-10-docbook-nb.txt
Generated.
[homepage.git] / blog / data / 2012-08-10-docbook-nb.txt
1 Title: Notes on language codes for Norwegian docbook processing...
2 Tags: english, docbook, freeculture
3 Date: 2012-08-10 21:00
4
5 <p>In <a href="http://www.docbook.org/">docbook</a> one can specify
6 the language used at the top, and the processing pipeline will use
7 this information to pick the correct translations for 'chapter', 'see
8 also', 'index' etc. And for most languages used with docbook, I guess
9 this work just fine. For example a German user can start the document
10 with &lt;book lang="de"&gt;, and the document will show up with the
11 correct content with any of the docbook processors. This is not the
12 case for the language
13 <a href="http://www.hungry.com/~pere/blog/Free_Culture_in_Norwegian___5_chapters_done__74_percent_left_to_do.html">I
14 am working with at the moment</a>, Norwegian Bokmål.</p>
15
16 <p>For a while, I was confused about which language code to use,
17 because I was unable to find any language code that would work across
18 all tools. I am currently testing dblatex, xmlto, docbook-xsl, and
19 dbtoepub, and they do not handle Norwegian Bokmål the same way. Some
20 of them do not handle it at all.</p>
21
22 <p>A bit of background information is probably needed to understand
23 this mess. Norwegian is not one, but two written variants. The
24 variants are Norwegian Nynorsk and Norwegian Bokmål. There are three
25 two letter language codes associated with these languages, Norwegian
26 is 'no', Norwegian Nynorsk is 'nn' and Norwegian Bokmål is 'nb'.
27 Historically the 'no' language code was used for Norwegian Bokmål, but
28 many years ago this was found to be å bad idea, and the recommendation
29 is to use the most specific language code instead, to avoid confusion.
30 In the transition period it is a good idea to make sure 'no' was an
31 alias for 'nb'.</p>
32
33 <p>Back to docbook processing tools in Debian. The dblatex tool only
34 understand 'nn'. There are translations for 'no', but not 'nb' (BTS
35 <a href="http://bugs.debian.org/684391">#684391</a>), but due to a bug
36 (BTS <a href="http://bugs.debian.org/682936">#682936</a>) the 'no'
37 language code is not recognised. The docbook-xsl tool chain only
38 recognise 'nn' and 'nb', but not 'no'. The xmlto tool only recognise
39 'nn' and 'nb', but not 'no'. The end result that there is no language
40 code I can use to get the docbook file working with all of these tools
41 at the same time. :(</p>
42
43 <p>The correct solution is to use &lt;book lang="nb"&gt;, but it will
44 take time before that will work with all the free software docbook
45 processors. :(</p>
46
47 <p>Oh, the joy of well integrated tools. :/</p>