Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Attributes | Protected Member Functions | List of all members
PhpMessageSource Class Reference

Public Attributes

 $customI18n

Protected Member Functions

 getMessageFile ($category, $language)

Detailed Description

/** Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

Definition at line 12 of file PhpMessageSource.php.

Member Function Documentation

PhpMessageSource::getMessageFile (   $category,
  $language 
)
protected

Determines the message file name based on the given category and language. If the category name contains a dot, it will be split into the module class name and the category name. In this case, the message file will be assumed to be located within the 'messages' subdirectory of the directory containing the module class file. Otherwise, the message file is assumed to be under the basePath.

Parameters
string$categorycategory name
string$languagelanguage ID
Returns
string the message file path

Definition at line 31 of file PhpMessageSource.php.

{
$file = realpath(parent::getMessageFile($category, $language));
if ($this->customI18n) {
$customSection = realpath(Yii::getPathOfAlias('site.custom'));
$commonSection = realpath(Yii::getPathOfAlias('site.common'));
$frontendSection = realpath(Yii::getPathOfAlias('site.frontend'));
$customFile = str_replace(array($commonSection, $frontendSection), $customSection, $file);
if (file_exists($customFile)) {
return $customFile;
}
}
return $file;
}

The documentation for this class was generated from the following file: