Message Interface Reference

Detailed Description

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

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']
ingo herwig

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 (   $message,
  $parameters = null,
  $lang = '' 

Get a localized string.

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.
$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: '')
The localized string

Implemented in FileMessage.

getAll (   $lang = '')

Get a list of all localized strings.

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

Implemented in FileMessage.