LimeSurvey API - Master branch

LSMessageSource extends CMessageSource
in package

LSMessageSource class file.

Tags
author

Denis Chenu

link
http://www.yiiframework.com/
copyright

2021 LimeSurvey License: GNU/GPL License v3 or later, see LICENSE.php

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.'

Properties

$basePath

public string $basePath

the base path for all translated messages. Defaults to null, meaning

Tags
see
CGettextMessageSource::basePath

$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
see
CDbMessageSource::cacheID
see
CGettextMessageSource::cacheID

$cachingDuration

public int $cachingDuration = 0

the time in seconds that the messages can remain valid in cache.

Tags
see
CDbMessageSource::cachingDuration
see
CGettextMessageSource::cachingDuration

$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
see
CGettextMessageSource::useMoFile

Methods

getDbConnection()

public getDbConnection() : CDbConnection
Tags
see
CDbMessageSource::getDbConnection
throws
CException

if application component is invalid

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
see
CGettextMessageSource::loadMessages
see
CDbMessageSource::loadMessages
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
see
CDbMessageSource::loadMessagesFromDb
Return values
array<string|int, mixed>

the messages loaded from database


        
On this page

Search results