From 06ca405628d24d74a1b89b84d1045580118d7b4a Mon Sep 17 00:00:00 2001 From: Henry Snoek Date: Tue, 19 Jan 2016 22:23:09 +0100 Subject: [PATCH] change translation getMessages() to getCatalogue() --- components/translation/usage.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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::