python-openxml / python-docx

Create and modify Word documents with Python
MIT License
4.64k stars 1.13k forks source link

feature-request: Ability to set text language #700

Open butuzov opened 5 years ago

butuzov commented 5 years ago

I would like to ask

Something like

document.add_paragraph('Привіт Жорстокий Світ').langauge="Ukrainian"

It would help to effectively use spell checkers for text written not in English.

Update: As far as I understand its possible to do via Styles editing (in Word), but it's only allowed to ParagraphFormat + font settings in python-docx.

winkelband commented 4 years ago

For a temporary fix by altering the properties in an oxml element object to set the language in the text you may have a look into this answer on Stack Overflow.