Skip to content

Multi-lingual Website with Dynamic Content

You have an online store with a listing of 100 products. The product information are pull out from a database and display on your website dynamically.

Now, you wish to have your website support more languages, how?

Usually, we use xgettext and poedit method. When you run xgettext command, it parses only static file, and not the database. We have written a script to call the data from the database and populated into a static file.

The xgettext command:

find /project/projectname -type f -iname “*.php” | xgettext -L PHP -o /home/projectname/web/pot/yyyymmdd.pot -f -

Note, NON ASCII code causes an error to xgettext. You need to remove them.

Send POT file to your translators. In their poedit program, choose from ‘Catalogue’ and ‘Update from POT file’. Good luck!

Updates: Poedit Add-on: Integration with Google’s Machine Translator

Categories: Ingredients.

Comment Feed

2 Responses

  1. Try this also

    ls -d /home/xxxx/web/*.php /home/xxxx/web/xx/*.php /home/xxxx/web/xx/*.php | xgettext -L PHP -o /home/xxxx/web/pot/20090316.pot -f -



Some HTML is OK

or, reply to this post via trackback.