/php-i18n-example

Example for internationalization with PHP and the gettext() function

Primary LanguagePHP

PHP i18n example

Example project with internationalization with gettext() alias _().

Some references:

Commands

cd Locale

Create POT

xgettext --from-code=UTF-8 -o messages.pot ../index.php

This will overide the existing messages.pot. You should create a backup before.

Create PO

Create a copy of messages.pot and save it as Locale/de_DE/LC_MESSAGES/messages.po. Set translations (msgstr) for each msgid.

Create MO

msgfmt de_DE/LC_MESSAGES/messages.po -o de_DE/LC_MESSAGES/messages.mo