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

[LokaliseBridge] Fix push command --delete-missing options when there are no missing messages #47391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Filter by extension

Filter by extension

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