Scan Php code looking for Gettext -


i need generate .po files php code of web application. large application needs translated several different languages. far, have been using poedit in order generate .po files. problem lies in many of files lack gettext notation echo _("message") , in past used echo "message".

this think best solution issue:

  1. create script scans php code , tells me of messages being , not being displayed using gettext. how this?

  2. replace string not using gettext appropriate gettext pattern.

can please advise me best aproach in order code using gettext should to?

you have 1 way how convert echoing messages without translation gettext echoing messages translation gettext:

if know messages represented 1 variable, example $message, following way made relatively fast, else have find used echoing of messages ... , manually (mostly if message 1 - , represented text, not variable holding text).

in editor start global search (in files) , then, go file file , use replacing - , set $message search , _($message) replacement ... unless editor allows replacing in more files @ same time. replacement @ 1 time.

i not suggest replacing directly in php.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -