How to convert .po to PHP array (Zend Framework) with Translate Toolkit? -
i trying use po2php convert .po file zend php translations array.
i trying this: $ po2php translations.po translations.php, results in error not understand: po2php: warning: couldn't handle input file translations.po: don't know input format .po, no template file.
i not know template file why should provide it?
update: tried $ po2php translations.po translations.php -t messages.pot, not me, shows pretty same error: po2php: warning: couldn't handle input file translations.po: don't know input format .po, template format .pot.
you try out pear package file_gettext. read more here: https://github.com/pear/file_gettext
the code (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 content of po file associative array. next need function output array in file. take @ second answer here: print array file
Comments
Post a Comment