8000 [LokaliseBridge] Fix push command --delete-missing options when there are no missing messages by rwionczek · Pull Request #47391 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ public function delete(TranslatorBagInterface $translatorBag): void
$keysIds = [];

foreach ($catalogue->getDomains() as $domain) {
$keysToDelete = [];
foreach (array_keys($catalogue->all($domain)) as $key) {
$keysToDelete[] = $key;
$keysToDelete = array_keys($catalogue->all($domain));

if (!$keysToDelete) {
continue;
}

$keysIds += $this->getKeysIds($keysToDelete, $domain);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,12 @@ public function testDeleteProcess()
$translatorBag->addCatalogue(new MessageCatalogue('en', [
'messages' => ['a' => 'trans_en_a'],
'validators' => ['post.num_comments' => '{count, plural, one {# comment} other {# comments}}'],
'domain_without_missing_messages' => [],
]));
$translatorBag->addCatalogue(new MessageCatalogue('fr', [
'messages' => ['a' => 'trans_fr_a'],
'validators' => ['post.num_comments' => '{count, plural, one {# commentaire} other {# commentaires}}'],
'domain_without_missing_messages' => [],
]));

$provider = $this->createProvider(
Expand Down
0