Skip to content

Commit

Permalink
minor #6170 change translation getMessages() to getCatalogue() (snoek09)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.8 branch (closes #6170).

Discussion
----------

change translation getMessages() to getCatalogue()

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | no
| Applies to    | 2.8
| Fixed tickets | #6137

I'm assuming here that the structure of the ``$messages`` variable didn't change.

Commits
-------

06ca405 change translation getMessages() to getCatalogue()
  • Loading branch information
xabbuh committed Feb 5, 2016
2 parents 41e4f30 + 06ca405 commit ab57eed
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 ab57eed

Please sign in to comment.