Skip to content

Set the documents language #1179

@buhtz

Description

@buhtz

This issue was separated from #1177.

I would like to set the default language of the document. That language that is relevant for spell checking for example. By default it seems to be "en-US". First I thought it is in the file word/settings.xml where I find this tag <w:themeFontLang w:val="en-US" w:eastAsia="ja-JP"/>. But after some tests I would say that wasn't it.

Now after using grep on the xmlfiles I found <w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA"/> in word/styles.xml and word/stylesWithEffects.xml. This seems to be related to Document.styles.elements.

But investigating the existing elements I couldn't find the correct element. But for me that XML API is quite unusual and unpythonic. So It isn't easy for me investigating this. I can I find the correct element and modify it ?

I also tried doc.core_properties.language = 'de-DE' without effect on the documents language.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions