PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 1, 2022

[FIXED] How to make gettext and poedit recognize custom file types?

 September 01, 2022     gettext, php, poedit, smarty     No comments   

Issue

I'm trying to get Smarty and gettext to work together in a project of mine. Currently smarty uses .tpl files for its template system.
I use PoEdit for creating catalog files and I've added '*.tpl' to the file extensions under PHP but when I try to scan for gettext strings I get the following errors and it is not able to find my strings:

xgettext: warning: file ../libs/smarty/debug.tpl' extensiontpl' is unknown; will try C
xgettext: warning: file ../template/login.tpl' extensiontpl' is unknown; will try C
xgettext: warning: file ../template/index.tpl' extensiontpl' is unknown; will try C

Well how can I get it to work?


Solution

(What you have mentioned should work). Make sure it's saving correctly.

Edit > Preferences > Parsers

Select PHP

Enter in the allowed extensions...

.php;.tpl

enter image description here

Note: You also might need to update your parser command to include:

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



Answered By - Layke
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,204,508

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing