How to convert .po to PHP array (Zend Framework) with Translate Toolkit?

我的梦境 提交于 2019-12-05 15:47:45
bitWorking

You could also try out the pear package File_Gettext. Read more here: https://github.com/pear/File_Gettext

The code would look like this (Not tested):

include_once 'File/Gettext/PO.php';

$poFile = new File_Gettext_PO();
$poFile->load('PATH_TO/translations.po');

print_r($poFile->strings);

$poFile->strings should contain the content of the po file as associative array. Next you need a function to output this array in a file. Take a look at the second answer here: Print array to a file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!