Skip to content

Commit af00879

Browse files
committed
msglist: Mostly translate remaining strings on message list page
Ideally we should implement #1080 for DMs title, but we might switch to showing avatars as the TODO indicated before we work on lists' proper translation. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 5f66ae1 commit af00879

10 files changed

+121
-7
lines changed

assets/l10n/app_en.arb

+15
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@
355355
"others": {"type": "String", "example": "Alice, Bob"}
356356
}
357357
},
358+
"messageListDMsWithOthers": "DMs with {others}",
359+
"@messageListDMsWithOthers": {
360+
"description": "Message list page title for a DM group with others.",
361+
"placeholders": {
362+
"others": {"type": "String", "example": "Alice, Bob"}
363+
}
364+
},
358365
"messageListGroupYouWithYourself": "You with yourself",
359366
"@messageListGroupYouWithYourself": {
360367
"description": "Message list recipient header for a DM group that only includes yourself."
@@ -716,5 +723,13 @@
716723
"emojiPickerSearchEmoji": "Search emoji",
717724
"@emojiPickerSearchEmoji": {
718725
"description": "Hint text for the emoji picker search text field."
726+
},
727+
"noEarlierMessages": "No earlier messages",
728+
"@noEarlierMessages": {
729+
"description": "Text to show at the start of a message list if there are no earlier messages."
730+
},
731+
"scrollToBottomTooltip": "Scroll to bottom",
732+
"@scrollToBottomTooltip": {
733+
"description": "Tooltip for button to scroll to bottom."
719734
}
720735
}

lib/generated/l10n/zulip_localizations.dart

+18
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,12 @@ abstract class ZulipLocalizations {
573573
/// **'You and {others}'**
574574
String messageListGroupYouAndOthers(String others);
575575

576+
/// Message list page title for a DM group with others.
577+
///
578+
/// In en, this message translates to:
579+
/// **'DMs with {others}'**
580+
String messageListDMsWithOthers(String others);
581+
576582
/// Message list recipient header for a DM group that only includes yourself.
577583
///
578584
/// In en, this message translates to:
@@ -1064,6 +1070,18 @@ abstract class ZulipLocalizations {
10641070
/// In en, this message translates to:
10651071
/// **'Search emoji'**
10661072
String get emojiPickerSearchEmoji;
1073+
1074+
/// Text to show at the start of a message list if there are no earlier messages.
1075+
///
1076+
/// In en, this message translates to:
1077+
/// **'No earlier messages'**
1078+
String get noEarlierMessages;
1079+
1080+
/// Tooltip for button to scroll to bottom.
1081+
///
1082+
/// In en, this message translates to:
1083+
/// **'Scroll to bottom'**
1084+
String get scrollToBottomTooltip;
10671085
}
10681086

10691087
class _ZulipLocalizationsDelegate extends LocalizationsDelegate<ZulipLocalizations> {

lib/generated/l10n/zulip_localizations_ar.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
280280
return 'You and $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Search emoji';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_en.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
280280
return 'You and $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Search emoji';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_ja.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
280280
return 'You and $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Search emoji';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_nb.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
280280
return 'You and $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Search emoji';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_pl.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
280280
return 'Ty i $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'Ty ze sobą';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Szukaj emoji';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_ru.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
280280
return 'Вы и $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'Вы с собой';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Поиск эмодзи';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/generated/l10n/zulip_localizations_sk.dart

+11
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
280280
return 'You and $others';
281281
}
282282

283+
@override
284+
String messageListDMsWithOthers(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -563,4 +568,10 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
563568

564569
@override
565570
String get emojiPickerSearchEmoji => 'Hľadať emotikon';
571+
572+
@override
573+
String get noEarlierMessages => 'No earlier messages';
574+
575+
@override
576+
String get scrollToBottomTooltip => 'Scroll to bottom';
566577
}

lib/widgets/message_list.dart

+11-7
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ class MessageListAppBarTitle extends StatelessWidget {
419419
} else {
420420
final names = otherRecipientIds.map(
421421
(id) => store.users[id]?.fullName ?? zulipLocalizations.unknownUserName);
422-
return Text("DMs with ${names.join(", ")}"); // TODO show avatars
422+
// TODO show avatars
423+
return Text(
424+
zulipLocalizations.messageListDMsWithOthers(names.join(', ')));
423425
}
424426
}
425427
}
@@ -571,6 +573,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
571573
Widget _buildListView(BuildContext context) {
572574
final length = model!.items.length;
573575
const centerSliverKey = ValueKey('center sliver');
576+
final zulipLocalizations = ZulipLocalizations.of(context);
574577

575578
Widget sliver = SliverStickyHeaderList(
576579
headerPlacement: HeaderPlacement.scrollingStart,
@@ -607,7 +610,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
607610
if (i == 2) return TypingStatusWidget(narrow: widget.narrow);
608611

609612
final data = model!.items[length - 1 - (i - 3)];
610-
return _buildItem(data, i);
613+
return _buildItem(zulipLocalizations, data, i);
611614
}));
612615

613616
if (!ComposeBox.hasComposeBox(widget.narrow)) {
@@ -643,13 +646,13 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
643646
]);
644647
}
645648

646-
Widget _buildItem(MessageListItem data, int i) {
649+
Widget _buildItem(ZulipLocalizations zulipLocalizations, MessageListItem data, int i) {
647650
switch (data) {
648651
case MessageListHistoryStartItem():
649-
return const Center(
652+
return Center(
650653
child: Padding(
651-
padding: EdgeInsets.symmetric(vertical: 16.0),
652-
child: Text("No earlier messages."))); // TODO use an icon
654+
padding: const EdgeInsets.symmetric(vertical: 16.0),
655+
child: Text(zulipLocalizations.noEarlierMessages))); // TODO use an icon
653656
case MessageListLoadingItem():
654657
return const Center(
655658
child: Padding(
@@ -693,14 +696,15 @@ class ScrollToBottomButton extends StatelessWidget {
693696

694697
@override
695698
Widget build(BuildContext context) {
699+
final zulipLocalizations = ZulipLocalizations.of(context);
696700
return ValueListenableBuilder<bool>(
697701
valueListenable: visibleValue,
698702
builder: (BuildContext context, bool value, Widget? child) {
699703
return (value && child != null) ? child : const SizedBox.shrink();
700704
},
701705
// TODO: fix hardcoded values for size and style here
702706
child: IconButton(
703-
tooltip: "Scroll to bottom",
707+
tooltip: zulipLocalizations.scrollToBottomTooltip,
704708
icon: const Icon(Icons.expand_circle_down_rounded),
705709
iconSize: 40,
706710
// Web has the same color in light and dark mode.

0 commit comments

Comments
 (0)