Page 1 of 1

Automatically create POT file

Posted: 18 Nov 2011, 16:14
by kaotiko
Hi!

I was looking for a trick to automatically regenerate the translation file and finally I found a nice solution.
I'm using linux and don't know if a similar solution is available in windows, but I know that exists the gettext function for windows.... don't know....

Download and extract suffusion theme and In terminal you must go to the path of the extracted folder and execute the next command:

find . -iname "*.php" | xargs xgettext -L PHP --keyword=__ --keyword=_e --from-code=UTF-8 -o translation/suffusion.pot


.... and wuala!! here you have a clean, ordered and beautiful template to update your translated files. ;)

Hope this can help somebody :p . See you!!

Re: Automatically create POT file

Posted: 19 Nov 2011, 22:23
by sayontan
There is a file called suffusion.po included with the theme in the translation folder - that is always up to date with the latest version strings. There is an easy way to generate the file. You can zip the theme and upload it to http://www.icanlocalize.com/tools/php_scanner. It will generate the file for you.