Sometimes it is useful to have access to the translation source data. Therefor the following two functions are provided.
The getMessageIds($locale = null) method returns all known
message IDs as array.
When you want to know the message ID for a given translation then you can use the
getMessageId() method.
The getMessages($locale = null) method returns the complete
translation source as an array. The message ID is used as key and the translation data
as value.
Both methods accept an optional parameter $locale which, if set,
returns the translation data for the specified language. If this parameter is not given,
the actual set language will be used. Keep in mind that normally all translations should
be available in all languages. Which means that in a normal situation you will not have
to set this parameter.
Additionally the getMessages() method can be used to return the
complete translation dictionary using the pseudo-locale 'all'. This will return all
available translation data for each added locale.
Note
Attention: the returned array can be very big, depending on the number of added locales and the amount of translation data.
Example 960. Handling languages with adapters
<?php
// returns all known message IDs
$messageIds = $translate->getMessageIds();
print_r($messageIds);
// or just for the specified language
$messageIds = $translate->getMessageIds('en_US');
print_r($messageIds);
// returns all the complete translation data
$source = $translate->getMessages();
print_r($source);




