Browse Source

Merge pull request #15633 from nextcloud/backport/15629/stable31

[stable31] fix(l10n): Don't use "All 1 participant"
pull/15634/head
Joas Schilling 3 months ago
committed by GitHub
parent
commit
4e8826c46f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      lib/Chat/ChatManager.php
  2. 2
      tests/integration/features/chat-2/mentions.feature
  3. 2
      tests/php/Chat/ChatManagerTest.php

11
lib/Chat/ChatManager.php

@ -1030,13 +1030,20 @@ class ChatManager {
}
if ($search === '' || $this->searchIsPartOfConversationNameOrAtAll($search, $roomDisplayName)) {
$participantCount = $this->participantService->getNumberOfUsers($room);
$results[] = [
$atAllResult = [
'id' => 'all',
'label' => $roomDisplayName,
'details' => $this->l->n('All %n participant', 'All %n participants', $participantCount),
'source' => 'calls',
'mentionId' => 'all',
];
if ($participantCount > 1) {
// TRANSLATORS The string will only be used with more than 1 participant, so you can keep the "All" in all plural forms
$atAllResult['details'] = $this->l->n('All %n participant', 'All %n participants', $participantCount);
}
$results[] = $atAllResult;
}
return $results;
}

2
tests/integration/features/chat-2/mentions.feature

@ -61,7 +61,7 @@ Feature: chat/mentions
| roomName | room |
Then user "participant1" gets the following candidate mentions in room "group room" for "" with 200
| id | label | source | mentionId | details |
| all | room | calls | all | All 1 participant |
| all | room | calls | all | |
Scenario: get mentions in a group room
When user "participant1" creates room "group room" (v4)

2
tests/php/Chat/ChatManagerTest.php

@ -735,7 +735,7 @@ class ChatManagerTest extends TestCase {
'actor_id' => 'user',
])],
1,
[['id' => 'all', 'label' => 'test', 'source' => 'calls', 'mentionId' => 'all', 'details' => 'All 1 participant']],
[['id' => 'all', 'label' => 'test', 'source' => 'calls', 'mentionId' => 'all']],
],
[
'all',

Loading…
Cancel
Save