the document, and one to be included at the end of the document. If you want
to specify the latex files separately, you can use <text:span text:style-name="Source_20_Text">latex leader</text:span>, <text:span text:style-name="Source_20_Text">latex<text:line-break/>begin</text:span>, and <text:span text:style-name="Source_20_Text">latex footer</text:span>.</text:p>
+<text:p text:style-name="Standard">There are new metadata keys for controlling internationalization:</text:p>
+
+<text:list text:style-name="L1">
+<text:list-item>
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">language</text:span> – specify the content language for a document, using the two
+letter code for the language (e.g. <text:span text:style-name="Source_20_Text">en</text:span> for English). Where possible, this
+will also set the default <text:span text:style-name="Source_20_Text">quotes language</text:span>.</text:p></text:list-item>
+
+<text:list-item>
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">quotes language</text:span> – specify which variant of smart quotes to use. Valid
+options are <text:span text:style-name="Source_20_Text">dutch</text:span>, <text:span text:style-name="Source_20_Text">french</text:span>, <text:span text:style-name="Source_20_Text">german</text:span>, <text:span text:style-name="Source_20_Text">germanguillemets</text:span>, <text:span text:style-name="Source_20_Text">swedish</text:span>, <text:span text:style-name="Source_20_Text">nl</text:span>,
+<text:span text:style-name="Source_20_Text">fr</text:span>, <text:span text:style-name="Source_20_Text">de</text:span>, <text:span text:style-name="Source_20_Text">sv</text:span>. Anything else defaults to English.</text:p></text:list-item>
+
+</text:list>
+
<text:h text:outline-level="4"><text:bookmark text:name="tableofcontents"/>Table of Contents </text:h>
<text:p text:style-name="Standard">By placing <text:span text:style-name="Source_20_Text">{{TOC}}</text:span> in your document, you can insert an automatically
to specify the latex files separately, you can use <code>latex leader</code>, <code>latex
begin</code>, and <code>latex footer</code>.</p>
+<p>There are new metadata keys for controlling internationalization:</p>
+
+<ul>
+<li><p><code>language</code> – specify the content language for a document, using the two
+letter code for the language (e.g. <code>en</code> for English). Where possible, this
+will also set the default <code>quotes language</code>.</p></li>
+<li><p><code>quotes language</code> – specify which variant of smart quotes to use. Valid
+options are <code>dutch</code>, <code>french</code>, <code>german</code>, <code>germanguillemets</code>, <code>swedish</code>, <code>nl</code>,
+<code>fr</code>, <code>de</code>, <code>sv</code>. Anything else defaults to English.</p></li>
+</ul>
+
<h4 id="tableofcontents">Table of Contents </h4>
<p>By placing <code>{{TOC}}</code> in your document, you can insert an automatically
to specify the latex files separately, you can use `latex leader`, `latex
begin`, and `latex footer`.
+There are new metadata keys for controlling internationalization:
+
+* `language` -- specify the content language for a document, using the two
+letter code for the language (e.g. `en` for English). Where possible, this
+will also set the default `quotes language`.
+
+* `quotes language` -- specify which variant of smart quotes to use. Valid
+options are `dutch`, `french`, `german`, `germanguillemets`, `swedish`, `nl`,
+`fr`, `de`, `sv`. Anything else defaults to English.
+
## Table of Contents ##
#include "d_string.h"
#include "epub.h"
#include "html.h"
+#include "i18n.h"
#include "miniz.h"
#include "mmd.h"
#include "transclude.h"
mmd_print_string_html(out, m->value, false);
print_const("</dc:language>\n");
} else {
- print_const("<dc:language>en</dc:language>\n");
+ switch(scratch->language) {
+ case LC_ES:
+ print_const("<dc:language>es</dc:language>\n");
+ break;
+ case LC_DE:
+ print_const("<dc:language>de</dc:language>\n");
+ break;
+ case LC_FR:
+ print_const("<dc:language>fr</dc:language>\n");
+ break;
+ case LC_NL:
+ print_const("<dc:language>nl</dc:language>\n");
+ break;
+ case LC_SV:
+ print_const("<dc:language>sv</dc:language>\n");
+ break;
+ default:
+ print_const("<dc:language>en</dc:language>\n");
+ }
}
// Date
if (m) {
printf(" lang=\"%s\"", m->value);
} else {
- print_const(" lang=\"en\"");
+ switch(scratch->language) {
+ case LC_ES:
+ print_const(" lang=\"es\"");
+ break;
+ case LC_DE:
+ print_const(" lang=\"de\"");
+ break;
+ case LC_FR:
+ print_const(" lang=\"fr\"");
+ break;
+ case LC_NL:
+ print_const(" lang=\"nl\"");
+ break;
+ case LC_SV:
+ print_const(" lang=\"sv\"");
+ break;
+ default:
+ print_const(" lang=\"en\"");
+ }
}
print_const(">\n<head>\n\t<meta charset=\"utf-8\"/>\n");
print(m->value);
print_char('\n');
} else if (strcmp(m->key, "htmlheaderlevel") == 0) {
- } else if (strcmp(m->key, "lang") == 0) {
+ } else if (strcmp(m->key, "language") == 0) {
} else if (strcmp(m->key, "latexbegin") == 0) {
} else if (strcmp(m->key, "latexconfig") == 0) {
} else if (strcmp(m->key, "latexfooter") == 0) {
} else if (strcmp(m->key, "htmlfooter") == 0) {
} else if (strcmp(m->key, "htmlheader") == 0) {
} else if (strcmp(m->key, "htmlheaderlevel") == 0) {
- } else if (strcmp(m->key, "lang") == 0) {
+ } else if (strcmp(m->key, "language") == 0) {
} else if (strcmp(m->key, "latexbegin") == 0) {
} else if (strcmp(m->key, "latexconfig") == 0) {
} else if (strcmp(m->key, "latexheader") == 0) {
} else if (strcmp(m->key, "htmlfooter") == 0) {
} else if (strcmp(m->key, "htmlheader") == 0) {
} else if (strcmp(m->key, "htmlheaderlevel") == 0) {
- } else if (strcmp(m->key, "lang") == 0) {
} else if (strcmp(m->key, "language") == 0) {
} else if (strcmp(m->key, "latexbegin") == 0) {
} else if (strcmp(m->key, "latexconfig") == 0) {