LSMessageSource
extends CMessageSource
in package
LSMessageSource class file.
Tags
Table of Contents
Constants
- CACHE_KEY_PREFIX = 'Yii.LSMessageSource.'
- MO_FILE_EXT = '.mo'
- PO_FILE_EXT = '.po'
Properties
- $basePath : string
- $cacheID : string
- $cachingDuration : int
- $useBigEndian : bool
- $useMoFile : bool
Methods
- getDbConnection() : CDbConnection
- loadMessages() : array<string|int, mixed>
- Loads the message translation for the specified language and category.
- loadMessagesFromDb() : array<string|int, mixed>
Constants
CACHE_KEY_PREFIX
public
mixed
CACHE_KEY_PREFIX
= 'Yii.LSMessageSource.'
MO_FILE_EXT
public
mixed
MO_FILE_EXT
= '.mo'
PO_FILE_EXT
public
mixed
PO_FILE_EXT
= '.po'
Properties
$basePath
public
string
$basePath
the base path for all translated messages. Defaults to null, meaning
Tags
$cacheID
public
string
$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.
Tags
$cachingDuration
public
int
$cachingDuration
= 0
the time in seconds that the messages can remain valid in cache.
Tags
$useBigEndian
public
bool
$useBigEndian
= \false
whether to use Big Endian to read MO files. Defaults to false. This property is only used when is true. see CGettextMessageSource::useBigEndian
$useMoFile
public
bool
$useMoFile
= \true
whether to load messages from MO files. Defaults to true.
Tags
Methods
getDbConnection()
public
getDbConnection() : CDbConnection
Tags
Return values
CDbConnection —the DB connection used for the message source.
loadMessages()
Loads the message translation for the specified language and category.
protected
loadMessages(string $category, string $language) : array<string|int, mixed>
Parameters
- $category : string
-
the message category, unused in LimeSurvey core (always '')
- $language : string
-
the target language
Tags
Return values
array<string|int, mixed> —the loaded messages
loadMessagesFromDb()
protected
loadMessagesFromDb(string $category, string $language) : array<string|int, mixed>
Parameters
- $category : string
-
the message category, unused in LimeSurvey core (always '')
- $language : string
-
the target language
Tags
Return values
array<string|int, mixed> —the messages loaded from database