Message Interface Reference

Detailed Description

Message is used to get localized messages to be used in the user interface.

Note
The language of a message is determined in one of 3 ways (in this order):
  1. use the value of the lang parameter passed to Message::getText()
  2. use the value of language from the Message configuration section
  3. use the value of the global variable $_SERVER['HTTP_ACCEPT_LANGUAGE']
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 23 of file Message.php.

+ Inheritance diagram for Message:

Public Member Functions

 getText ($message, $parameters=null, $lang='')
 
 getAll ($lang='')
 

Member Function Documentation

◆ getText()

getText (   $message,
  $parameters = null,
  $lang = '' 
)

Get a localized string.

Note
It is not recommended to use this method with concatenated strings because this restricts the positions of words in translations. E.g. 'She was born in %0% on %1' translates to the german sentence 'Sie wurde am %1% in %0% geboren' with the variables flipped.
Implementations must return the original message, if no translation is found, or the translation string is empty.
Parameters
$messageThe message to translate (%0%, %1%, ... will be replaced by given parameters).
$parametersAn array of values for parameter substitution in the message.
$langThe language (optional, default: '')
Returns
The localized string

Implemented in FileMessage.

◆ getAll()

getAll (   $lang = '')

Get a list of all localized strings.

Parameters
$langThe language (optional, default: '')
Returns
An array of localized strings

Implemented in FileMessage.