Skip to content

Commit 058a684

Browse files
committed
poll: Translate voter names wrapped in parentheses
Signed-off-by: Zixuan James Li <[email protected]>
1 parent a9e96aa commit 058a684

10 files changed

+50
-2
lines changed

assets/l10n/app_en.arb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,13 @@
754754
"@messageIsMovedLabel": {
755755
"description": "Label for a moved message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
756756
},
757+
"pollVoterNames": "({voterNames})",
758+
"@pollVoterNames": {
759+
"description": "The list of people voted for a poll option, wrapped in parentheses.",
760+
"placeholders": {
761+
"voterNames": {"type": "String", "example": "Alice, Bob, Chad"}
762+
}
763+
},
757764
"pollWidgetQuestionMissing": "No question.",
758765
"@pollWidgetQuestionMissing": {
759766
"description": "Text to display for a poll when the question is missing"

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,12 @@ abstract class ZulipLocalizations {
11071107
/// **'MOVED'**
11081108
String get messageIsMovedLabel;
11091109

1110+
/// The list of people voted for a poll option, wrapped in parentheses.
1111+
///
1112+
/// In en, this message translates to:
1113+
/// **'({voterNames})'**
1114+
String pollVoterNames(String voterNames);
1115+
11101116
/// Text to display for a poll when the question is missing
11111117
///
11121118
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'MOVED';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'No question.';
596601

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'MOVED';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'No question.';
596601

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'MOVED';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'No question.';
596601

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'MOVED';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'No question.';
596601

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'PRZENIESIONO';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'Brak pytania.';
596601

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'ПЕРЕМЕЩЕНО';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'Нет вопроса.';
596601

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
591591
@override
592592
String get messageIsMovedLabel => 'PRESUNUTÉ';
593593

594+
@override
595+
String pollVoterNames(String voterNames) {
596+
return '($voterNames)';
597+
}
598+
594599
@override
595600
String get pollWidgetQuestionMissing => 'Bez otázky.';
596601

lib/widgets/poll.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class _PollWidgetState extends State<PollWidget> {
126126
children: [
127127
Text(option.text, style: textStyleBold.copyWith(fontSize: 16)),
128128
if (option.voters.isNotEmpty)
129-
// TODO(i18n): Localize parenthesis characters.
130-
Text('($voterNames)', style: textStyleVoterNames),
129+
Text(zulipLocalizations.pollVoterNames(voterNames),
130+
style: textStyleVoterNames),
131131
]))),
132132
]);
133133
}

0 commit comments

Comments
 (0)