This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

concrete5 uses the Gettext system for translation, and the Zend Translate library.

Displaying concrete5 in a language other than English

1. Download a translation file for concrete5. This will be a file that ends in .mo.

2. Create the directory "xx_XX" in the empty languages directory at the top level of your concrete5 site, where "xx_XX" = "language_COUNTRY".

3. Make another directory LC_MESSAGES under that.

4. Move "messages.mo" into that directory. At this point your filesystem should look like this: web languages xx_XX (en_US, fr_FR, etc...) LC_MESSAGES messages.mo

5. Add the line define('LOCALE', 'xx_XX'); in your config/site.php file.

Ensuring your addon can be translated.

In order for an addon to be translated, every string within the addon must be wrapped within the t() function. No further modifications are necessary.

Translating an Addon

Once every string for an addon is referenced within the t() function, run the following from the Linux or OS X command line:

	touch messages.po 	find packages/your_package/ -iname '*.php' -exec xgettext --default-domain=messages --keyword=t -l PHP -p /path/to/current/directory -j {}; 	

Then, edit the resulting .po file with your favorite PO Editor lik poEdit. When finished, use the following command from the terminal:

	msgfmt -o messages.mo messages.po 

Package Localization

Follow the instructions above, but instead of placing this addon in the root languages directory, create a languages directory with the same structure inside your package's directory.

Loading Conversation