ms-wordlocalizationpandocculture

Pandoc: setting language of exported Word docx


I export Word docx from markdown using Pandoc.

By default, everything seems to be marked as English in the docx file. So I tried to override this, e.g. by command line option pandoc -s -S images.md -o images.docx -V lang=de or in the header YAML:

---
subtitle: <%= @report.name %>
toc-title: <%= t('.toc_title') %>
lang: de
---

But none seems to work, all content in the exported docx file is marked red by the language spelling feature, telling me that words are not found in English.

How can I override the language?

Update

I tried specifying the language in the docx-file, by simply selecting all text (Cmd+A, I'm on OSX) and clicking on the language button on the bottom left.

enter image description here

Also, I tried using Tools -> Language:

enter image description here

None of it did have an effect though.

Update

Interestingly, when exporting to HTML, the language is set correctly in the <html> attribute.


Solution

  • I have just checked again, and with Pandoc v 2.9.2.1 it seems to set the language correctly:

    english docx

    german docx

    Hooray!! Thanks, Pandoc community! <3

    Would be interesting though to know when exactly it was added (couldn't find a mention in the https://pandoc.org/changelog.txt).