Phpword: RTF writer defaults language to French

Created on 18 Jul 2017  路  2Comments  路  Source: PHPOffice/PHPWord

In vendor\phpoffice\phpword\src\PhpWord\Writer\RTF\Part\Document.php there is the line:

$content .= '\lang1036'; // Applies a language to a text run (1036 : French (France))

Which defaults the document language to French. I've updated it in my code to \lang2057 (UK) but is there a better way to set this language parameter?

Change Request

Most helpful comment

As you've seen it is currently hard coded in the writer.
I am planning on adding the ability to set the language for the docx writer, I'll also modify the rtf writer!

All 2 comments

As you've seen it is currently hard coded in the writer.
I am planning on adding the ability to set the language for the docx writer, I'll also modify the rtf writer!

you can check out #1108, it allows you to specify the default language of the document.

Was this page helpful?
0 / 5 - 0 ratings