Skip to content

Commit

Permalink
change translation getMessages() to getCatalogue()
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Snoek authored and xabbuh committed Feb 5, 2016
1 parent 8e91949 commit 06ca405
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ In case you want to use the same translation catalogue outside your application
(e.g. use translation on the client side), it's possible to fetch raw translation
messages. Just specify the required locale::

$messages = $translator->getMessages('fr_FR');
$catalogue = $translator->getCatalogue('fr_FR');
$messages = $catalogue->all();
while ($catalogue = $catalogue->getFallbackCatalogue()) {
$messages = array_replace_recursive($catalogue->all(), $messages);
}

The ``$messages`` variable will have the following structure::

Expand Down

0 comments on commit 06ca405

Please sign in to comment.