Forum


Replies: 2   Views: 2386
Translating page of based on document language
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by Simco Nederland  · 09-01-2018 - 10:33

in this topic : https://www.phpdocx.com/en/forum/default/topic/1285 admin noted to chnge file
but that's absolutely not an option since we use multilanguage site wel yes we can create 20 files for each language we use on website but we have no way to include needed one 

so is it possible to set phpdocx to use translations from another inc file if it's exists otherwise use default.

so it will be something like this :

$docx->setLanguage('de-DE');

then phpdocx shall use OOXMLResources_de-DE.inc
and if it's not there then use default OOXMLResources.inc

Posted by admin  · 09-01-2018 - 11:46

Hello,

The current version of phpdocx doesn't support getting a translate OOXMLResources file based on the document language. 

The best approach is changing the variables of the OOXMLResources class. You don't need to change the class, as all variables are public static you can overwrite the values dynamically from any other script:

OOXMLResources::$pageNumber = '..';

so you can create a script that changes the value of this variable based on your needs.

Regards.

Posted by Simco Nederland  · 09-01-2018 - 12:02

thx. that seem to be working.