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 committed Jan 31, 2025
1 parent 6e1e7a4 commit c731c83
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 @@ -754,6 +754,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 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 @@ -1107,6 +1107,12 @@ abstract class ZulipLocalizations {
/// **'MOVED'**
String get messageIsMovedLabel;

/// The list of people 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 @@ -591,6 +591,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 @@ -591,6 +591,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 @@ -591,6 +591,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 @@ -591,6 +591,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 @@ -591,6 +591,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 @@ -591,6 +591,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 @@ -591,6 +591,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 c731c83

Please sign in to comment.