CPhpMessageSource
Name | messages |
---|---|
Class | CPhpMessageSource |
Location | /home/vhosts/app-manager.eu5.org/framework/i18n/CPhpMessageSource.php |
CPhpMessageSource represents a message source that stores translated messages in PHP scripts.
CPhpMessageSource uses PHP files and arrays to keep message translations.
CPhpMessageSource uses PHP files and arrays to keep message translations.
- All translations are saved under the {@link basePath} directory.
- Translations in one language are kept as PHP files under an individual subdirectory whose name is the same as the language ID. Each PHP file contains messages belonging to the same category, and the file name is the same as the category name.
- Within a PHP file, an array of (source, translation) pairs is returned.
For example:
return array( 'original message 1' => 'translated message 1', 'original message 2' => 'translated message 2', );
Options
Displaying 1-6 of 6 results.
Name | Value | Description | Type |
---|---|---|---|
cachingDuration | 0 | The time in seconds that the messages can remain valid in cache. Defaults to 0, meaning the caching is disabled. | integer |
cacheID | 'cache' | The ID of the cache application component that is used to cache the messages. Defaults to 'cache' which refers to the primary cache application component. Set this property to false if you want to disable caching the messages. | string |
basePath | null | The base path for all translated messages. Defaults to null, meaning the "messages" subdirectory of the application directory (e.g. "protected/messages"). | string |
forceTranslation | false | Whether to force message translation when the source and target languages are the same. Defaults to false, meaning translation is only performed when source and target languages are different. @since 1.1.4 | boolean |
behaviors | array() | The behaviors that should be attached to this component. The behaviors will be attached to the component when {@link init} is called. Please refer to {@link CModel::behaviors} on how to specify the value of this property. | array |
language | null | The language that the source messages are written in. | string |