8000 [LokaliseBridge] Fix push command --delete-missing options when there… · symfony/symfony@1769094 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1769094

Browse files
committed
[LokaliseBridge] Fix push command --delete-missing options when there are no missing messages
1 parent 6dadb96 commit 1769094

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Symfony/Component/Translation/Bridge/Lokalise/LokaliseProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public function delete(TranslatorBagInterface $translatorBag): void
124124
foreach (array_keys($catalogue->all($domain)) as $key) {
125125
$keysToDelete[] = $key;
126126
}
127+
128+
if (!$keysToDelete) {
129+
continue;
130+
}
131+
127132
$keysIds += $this->getKeysIds($keysToDelete, $domain);
128133
}
129134

src/Symfony/Component/Translation/Bridge/Lokalise/Tests/LokaliseProviderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,12 @@ public function testDeleteProcess()
699699
$translatorBag->addCatalogue(new MessageCatalogue('en', [
700700
'messages' => ['a' => 'trans_en_a'],
701701
'validators' => ['post.num_comments' => '{count, plural, one {# comment} other {# comments}}'],
702+
'domain_without_missing_messages' => [],
702703
]));
703704
$translatorBag->addCatalogue(new MessageCatalogue('fr', [
704705
'messages' => ['a' => 'trans_fr_a'],
705706
'validators' => ['post.num_comments' => '{count, plural, one {# commentaire} other {# commentaires}}'],
707+
'domain_without_missing_messages' => [],
706708
]));
707709

708710
$provider = $this->createProvider(

0 commit comments

Comments
 (0)
0