vendredi 8 mai 2015

CakePHP 1.2 cake i18n extract, generate files based on token/domain

I'm using CakePHP 1.2. I have defined all the strings for which I need localization in gettext function. e.g.

file app/views/posts/add.thtml

<?php echo __("Text1.","feature_one"); ?>
<?php echo __("Text2.","feature_two"); ?>

file app/views/posts/edit.thtml

<?php echo __("Text3.","feature_one"); ?>
<?php echo __("Text4.","feature_two"); ?>

While generating the pot files, I'm using the cake i18n extract command from the cake console folder

cake i18n extract

Using this command I'm able to extract pot files in 2 formats, one in which all the strings are extracted and merged to one single file say 'default.pot', or all the strings are extracted to independent files with file names as the relative file path e.g. "-posts-add.pot" & "-posts-edit.pot".

What I need is to generate pot files based on the tokens/domains defined in the gettext function. i.e. one file each for a token/domain defined containing all the strings in that domain. e.g. "feature_one.pot" & "feature_two.pot".

Aucun commentaire:

Enregistrer un commentaire