I18N – Internationalization

1 I18N method

In Gentics Portal.Node PHP the specific method convention for I18N functionality is used.

All modules which need I18N should use the special method t().

Comments module example:


class CommentsModule extends CWebModule{
    ............................
    public static function t($str = '', $params = array(), $dic = 'core')
    {
        return Yii::t("CommentsModule." . $dic, $str, $params);
    }
    ............................
}

Translation dictionaries is placed in folder “messages” in each module directory.

For each locale there should be a separate folder.

Comments module example:


comments/messages/de/core.php

How the internationalization works in detail, you can read here

2 Using I18N

In any file inside a module, you should use this module t() method.

Example:


    <?php echo CommentsModule::t('Comments count')?>