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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
11 additions and
4 deletions
-
lib/Chat/ChatManager.php
-
tests/integration/features/chat-2/mentions.feature
-
tests/php/Chat/ChatManagerTest.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; |
|
|
|
} |
|
|
|
|
|
|
|
@ -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) |
|
|
|
|
|
|
|
@ -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', |
|
|
|
|