python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

[bug] ValueError: MSO_LANGUAGE_ID has no XML mapping for 'en-CN'

Open injet-zhou opened this issue 1 year ago • 2 comments

An error occurred while attempting to retrieve the language_id attribute of the font.

injet-zhou avatar Jan 08 '25 02:01 injet-zhou

Setting the Language ID in python-pptx

Try this:

from pptx.enum.lang import MSO_LANGUAGE_ID

# Set the font language to Polish
font.language_id = MSO_LANGUAGE_ID.POLISH

To find the appropriate language identifier for your specific case, refer to the documentation: python-pptx: MsoLanguageId Documentation

sashaKorovkina avatar Jan 08 '25 13:01 sashaKorovkina

Setting the Language ID in python-pptx

Try this:

from pptx.enum.lang import MSO_LANGUAGE_ID

# Set the font language to Polish
font.language_id = MSO_LANGUAGE_ID.POLISH

To find the appropriate language identifier for your specific case, refer to the documentation: python-pptx: MsoLanguageId Documentation

Thx, I will try that later.

injet-zhou avatar Jan 09 '25 03:01 injet-zhou