How do I get gettext and poedit to recognize custom file types?

I am trying to get Smarty and gettext to work together in my project. Smarty currently uses .tpl

files for its templating system.
I am using PoEdit to create directory files and I have added '* .tpl' to file extensions under PHP, but when I try to scan for gettext lines I get the following errors and cannot find my lines:

xgettext: warning: ../libs/smarty/debug.tpl' extension

tpl file 'unknown; will try C
xgettext: warning: ../template/login.tpl' extension

tpl file 'unknown; will try C
xgettext: warning: ../template/index.tpl' extension

tpl file 'unknown; will try C

Ok how can I make it work?

+3


source to share


2 answers


(What you mentioned should work). Make sure it is correct.

Edit > Preferences > Parsers

Please select PHP

Enter in allowed extensions ...



.php; .tpl

enter image description here

Note. You may also need to update your parser command to include:

xgettext --language=PHP --force-po -o %o %C %K %F

+2


source


After trying to install the parser without success, I edited Perl at

Edit> Preferences> Parsers

So, I added * .tpl to the list of extensions



* pl; .. * TPL

Now it parses all {_ ("text")} inside smarty tpl

+3


source







All Articles