Skip to content

Commit

Permalink
poll: Translate voter names wrapped in parentheses
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan James Li <[email protected]>
  • Loading branch information
PIG208 authored and rishichirchi committed Feb 7, 2025
1 parent f71e036 commit d0269ee
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 2 deletions.
7 changes: 7 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,13 @@
"@messageIsMovedLabel": {
"description": "Label for a moved message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
},
"pollVoterNames": "({voterNames})",
"@pollVoterNames": {
"description": "The list of people who voted for a poll option, wrapped in parentheses.",
"placeholders": {
"voterNames": {"type": "String", "example": "Alice, Bob, Chad"}
}
},
"pollWidgetQuestionMissing": "No question.",
"@pollWidgetQuestionMissing": {
"description": "Text to display for a poll when the question is missing"
Expand Down
6 changes: 6 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,12 @@ abstract class ZulipLocalizations {
/// **'MOVED'**
String get messageIsMovedLabel;

/// The list of people who voted for a poll option, wrapped in parentheses.
///
/// In en, this message translates to:
/// **'({voterNames})'**
String pollVoterNames(String voterNames);

/// Text to display for a poll when the question is missing
///
/// In en, this message translates to:
Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'MOVED';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'MOVED';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'MOVED';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'MOVED';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'No question.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'PRZENIESIONO';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'Brak pytania.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'ПЕРЕМЕЩЕНО';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'Нет вопроса.';

Expand Down
5 changes: 5 additions & 0 deletions lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
@override
String get messageIsMovedLabel => 'PRESUNUTÉ';

@override
String pollVoterNames(String voterNames) {
return '($voterNames)';
}

@override
String get pollWidgetQuestionMissing => 'Bez otázky.';

Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/poll.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ class _PollWidgetState extends State<PollWidget> {
children: [
Text(option.text, style: textStyleBold.copyWith(fontSize: 16)),
if (option.voters.isNotEmpty)
// TODO(i18n): Localize parenthesis characters.
Text('($voterNames)', style: textStyleVoterNames),
Text(zulipLocalizations.pollVoterNames(voterNames),
style: textStyleVoterNames),
]))),
]);
}
Expand Down

0 comments on commit d0269ee

Please sign in to comment.