8000 minor #14371 [2.7][Translation] remove duplicate code for loading cat… · symfony/symfony@03f6c04 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03f6c04

Browse files
committed
minor #14371 [2.7][Translation] remove duplicate code for loading catalogue. (aitboudad)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7][Translation] remove duplicate code for loading catalogue. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | ~ | Tests pass? | yes | License | MIT Commits ------- 9a9c83b [2.7][Translation] remove duplicate code for loading catalogue.
2 parents 995448c + 9a9c83b commit 03f6c04

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Symfony/Component/Translation/DataCollectorTranslator.php

Lines changed: 1 addition & 4 deletions
9562
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,13 @@ public function getCollectedMessages()
116116
*/
117117
private function collectMessage($locale, $domain, $id, $translation)
118118
{
119-
if (null === $locale) {
120-
$locale = $this->getLocale();
121-
}
122-
123119
if (null === $domain) {
124120
$domain = 'messages';
125121
}
126122

127123
$id = (string) $id;
128124
$catalogue = $this->translator->getCatalogue($locale);
125+
$locale = $catalogue->getLocale();
129126
if ($catalogue->defines($id, $domain)) {
130127
$state = self::MESSAGE_DEFINED;
131128
} elseif ($catalogue->has($id, $domain)) {

0 commit comments

Comments
 (0)
0