8000 Fix Empty translations with Qt files · benji07/symfony@7eacc5a · GitHub
[go: up one dir, main page]

Skip to content

Commit 7eacc5a

Browse files
vlefortfabpot
authored andcommitted
Fix Empty translations with Qt files
1 parent 3ae496e commit 7eacc5a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Symfony/Component/Translation/Loader/QtFileLoader.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ public function load($resource, $locale, $domain = 'messages')
5353
if ($nodes->length == 1) {
5454
$translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message');
5555
foreach ($translations as $translation) {
56-
$catalogue->set(
57-
(string) $translation->getElementsByTagName('source')->item(0)->nodeValue,
58-
(string) $translation->getElementsByTagName('translation')->item(0)->nodeValue,
59-
$domain
60-
);
56+
$translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue;
57+
58+
if (!empty($translationValue)) {
59+
$catalogue->set(
60+
(string) $translation->getElementsByTagName('source')->item(0)->nodeValue,
61+
$translationValue,
62+
$domain
63+
);
64+
}
6165
$translation = $translation->nextSibling;
6266
}
6367
$catalogue->addResource(new FileResource($resource));

0 commit comments

Comments
 (0)
0