Skip to content

Commit 652e9a6

Browse files
committed
poll: Translate voter names wrapped in parentheses
Signed-off-by: Zixuan James Li <[email protected]>
1 parent 3a10a68 commit 652e9a6

10 files changed

+50
-2
lines changed

assets/l10n/app_en.arb

+7
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,13 @@
714714
"@messageIsMovedLabel": {
715715
"description": "Label for a moved message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
716716
},
717+
"pollVoterNames": "({voterNames})",
718+
"@pollVoterNames": {
719+
"description": "The list of people voted for a poll option, wrapped in parentheses.",
720+
"placeholders": {
721+
"voterNames": {"type": "String", "example": "Alice, Bob, Chad"}
722+
}
723+
},
717724
"pollWidgetQuestionMissing": "No question.",
718725
"@pollWidgetQuestionMissing": {
719726
"description": "Text to display for a poll when the question is missing"

lib/generated/l10n/zulip_localizations.dart

+6
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,12 @@ abstract class ZulipLocalizations {
10471047
/// **'MOVED'**
10481048
String get messageIsMovedLabel;
10491049

1050+
/// The list of people voted for a poll option, wrapped in parentheses.
1051+
///
1052+
/// In en, this message translates to:
1053+
/// **'({voterNames})'**
1054+
String pollVoterNames(String voterNames);
1055+
10501056
/// Text to display for a poll when the question is missing
10511057
///
10521058
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'MOVED';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'No question.';
566571

lib/generated/l10n/zulip_localizations_en.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'MOVED';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'No question.';
566571

lib/generated/l10n/zulip_localizations_ja.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'MOVED';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'No question.';
566571

lib/generated/l10n/zulip_localizations_nb.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'MOVED';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'No question.';
566571

lib/generated/l10n/zulip_localizations_pl.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'PRZENIESIONO';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'Brak pytania.';
566571

lib/generated/l10n/zulip_localizations_ru.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'ПЕРЕМЕЩЕНО';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'Нет вопроса.';
566571

lib/generated/l10n/zulip_localizations_sk.dart

+5
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
561561
@override
562562
String get messageIsMovedLabel => 'PRESUNUTÉ';
563563

564+
@override
565+
String pollVoterNames(String voterNames) {
566+
return '($voterNames)';
567+
}
568+
564569
@override
565570
String get pollWidgetQuestionMissing => 'Bez otázky.';
566571

lib/widgets/poll.dart

+2-2
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)