diff --git a/components/translation/usage.rst b/components/translation/usage.rst index 3cf13b9fb7d..4ad16abb4cd 100644 --- a/components/translation/usage.rst +++ b/components/translation/usage.rst @@ -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::