v1.2.2 - Official User Guide

Internationalization and .PO files

Bancha uses the gettext system as default for translating the labels of the website (and also the administration). For example, the translated labels (website) for the italian language are located here: application/language/it_IT.

When you create a new language (Adding a new language), just copy one of these folders changing the name to the new locale (es. en_GB) and that locale will be automatically used.

To update the translations, open the .PO file with an external software such as the open-source PO Edit.

On your theme view files, when a label that needs to be translated just use the default gettext function _(‘text’) as follows:

echo _('Hello');
//Now, the .PO files will find this label!

You can also use placeholders using the $this->lang->_trans() function like this:

$this->lang->_trans('Welcome back, %u! Today it is %d', array(
    'u' => 'Nicholas',
    'd' => date('l')

//The .PO files will now find the "Welcome back, %u! Today it is %d" label.</code></pre>

Content types translations

The labels contained inside the XML Schemes can also be translated: the core automatically generates a static file with the gettext functions here: core/views/admin/content/translations.php.

Use your favorite .PO files editor (such as PO Edit) and click on “Update” to auto-discover these translations.

Back to Languages

Bancha - Copyright 2011-2012(C) Squallstar Studio -