Elgg  Version 3.0
Public Member Functions | List of all members
Elgg\I18n\ArrayMessageBundle Class Reference

WARNING: API IN FLUX. More...

Inheritance diagram for Elgg\I18n\ArrayMessageBundle:
Elgg\I18n\MessageBundle

Public Member Functions

 __construct (array $messages)
 Constructor. More...
 
 get ($key, Locale $locale)
 Fetches the translatable message associated with the given key.
Parameters
string$keyString identifier for the message
Locale$localeLocale in which the message is written
Returns
?MessageTemplate The message object or null if not found.
More...
 

Detailed Description

WARNING: API IN FLUX.

DO NOT USE DIRECTLY.

Uses an array as a source for the message bundle.

This is mostly useful for testing so we can configure translators in-memory instead of going to the file system.

Since
1.11

Definition at line 16 of file ArrayMessageBundle.php.

Constructor & Destructor Documentation

Elgg\I18n\ArrayMessageBundle::__construct ( array  $messages)

Constructor.

Parameters
array$messagesMap of locales to maps of keys to message-templates

Definition at line 26 of file ArrayMessageBundle.php.

Member Function Documentation

Elgg\I18n\ArrayMessageBundle::get (   $key,
Locale  $locale 
)

Fetches the translatable message associated with the given key.

Parameters
string$keyString identifier for the message
Locale$localeLocale in which the message is written
Returns
?MessageTemplate The message object or null if not found.

Implements Elgg\I18n\MessageBundle.

Definition at line 33 of file ArrayMessageBundle.php.


The documentation for this class was generated from the following file: