From db077c1f3b0a3517a75002a73dc327707ccaa490 Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Mon, 4 May 2015 21:22:52 +0000 Subject: [PATCH] [Translation] simplify getMessages. --- src/Symfony/Component/Translation/Translator.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 81ed9052964ca..e21c705fd700b 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -273,15 +273,10 @@ protected function getLoaders() */ public function getMessages($locale = null) { - $catalogues = array(); - $catalogues[] = $catalogue = $this->getCatalogue($locale); + $catalogue = $this->getCatalogue($locale); + $messages = $catalogue->all(); while ($catalogue = $catalogue->getFallbackCatalogue()) { - $catalogues[] = $catalogue; - } - $messages = array(); - for ($i = count($catalogues) - 1; $i >= 0; $i--) { - $localeMessages = $catalogues[$i]->all(); - $messages = array_replace_recursive($messages, $localeMessages); + $messages = array_replace_recursive($catalogue->all(), $messages); } return $messages; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy