Skip to content

Commit 51402d2

Browse files
committed
poll: Translate voter names wrapped in parentheses
Fixes: zulip#277 Signed-off-by: Zixuan James Li <[email protected]>
1 parent 399835a commit 51402d2

10 files changed

+50
-2
lines changed

assets/l10n/app_en.arb

+7
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,13 @@
746746
"@messageIsMovedLabel": {
747747
"description": "Label for a moved message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
748748
},
749+
"pollVoterNames": "({voterNames})",
750+
"@pollVoterNames": {
751+
"description": "The list of people who voted for a poll option, wrapped in parentheses.",
752+
"placeholders": {
753+
"voterNames": {"type": "String", "example": "Alice, Bob, Chad"}
754+
}
755+
},
749756
"pollWidgetQuestionMissing": "No question.",
750757
"@pollWidgetQuestionMissing": {
751758
"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
@@ -1101,6 +1101,12 @@ abstract class ZulipLocalizations {
11011101
/// **'MOVED'**
11021102
String get messageIsMovedLabel;
11031103

1104+
/// The list of people who voted for a poll option, wrapped in parentheses.
1105+
///
1106+
/// In en, this message translates to:
1107+
/// **'({voterNames})'**
1108+
String pollVoterNames(String voterNames);
1109+
11041110
/// Text to display for a poll when the question is missing
11051111
///
11061112
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'MOVED';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'No question.';
591596

lib/generated/l10n/zulip_localizations_en.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'MOVED';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'No question.';
591596

lib/generated/l10n/zulip_localizations_ja.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'MOVED';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'No question.';
591596

lib/generated/l10n/zulip_localizations_nb.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'MOVED';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'No question.';
591596

lib/generated/l10n/zulip_localizations_pl.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'PRZENIESIONO';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'Brak pytania.';
591596

lib/generated/l10n/zulip_localizations_ru.dart

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

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'Нет вопроса.';
591596

lib/generated/l10n/zulip_localizations_sk.dart

+5
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
586586
@override
587587
String get messageIsMovedLabel => 'PRESUNUTÉ';
588588

589+
@override
590+
String pollVoterNames(String voterNames) {
591+
return '($voterNames)';
592+
}
593+
589594
@override
590595
String get pollWidgetQuestionMissing => 'Bez otázky.';
591596

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)