Skip to content

Commit 08836f3

Browse files
PIG208github-actions[bot]
authored andcommitted
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 b2541b6 commit 08836f3

10 files changed

+121
-7
lines changed

assets/l10n/app_en.arb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@
355355
"others": {"type": "String", "example": "Alice, Bob"}
356356
}
357357
},
358+
"dmsWithOthersPageTitle": "DMs with {others}",
359+
"@dmsWithOthersPageTitle": {
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."
@@ -748,5 +755,13 @@
748755
"emojiPickerSearchEmoji": "Search emoji",
749756
"@emojiPickerSearchEmoji": {
750757
"description": "Hint text for the emoji picker search text field."
758+
},
759+
"noEarlierMessages": "No earlier messages",
760+
"@noEarlierMessages": {
761+
"description": "Text to show at the start of a message list if there are no earlier messages."
762+
},
763+
"scrollToBottomTooltip": "Scroll to bottom",
764+
"@scrollToBottomTooltip": {
765+
"description": "Tooltip for button to scroll to bottom."
751766
}
752767
}

lib/generated/l10n/zulip_localizations.dart

Lines changed: 18 additions & 0 deletions
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 dmsWithOthersPageTitle(String others);
581+
576582
/// Message list recipient header for a DM group that only includes yourself.
577583
///
578584
/// In en, this message translates to:
@@ -1118,6 +1124,18 @@ abstract class ZulipLocalizations {
11181124
/// In en, this message translates to:
11191125
/// **'Search emoji'**
11201126
String get emojiPickerSearchEmoji;
1127+
1128+
/// Text to show at the start of a message list if there are no earlier messages.
1129+
///
1130+
/// In en, this message translates to:
1131+
/// **'No earlier messages'**
1132+
String get noEarlierMessages;
1133+
1134+
/// Tooltip for button to scroll to bottom.
1135+
///
1136+
/// In en, this message translates to:
1137+
/// **'Scroll to bottom'**
1138+
String get scrollToBottomTooltip;
11211139
}
11221140

11231141
class _ZulipLocalizationsDelegate extends LocalizationsDelegate<ZulipLocalizations> {

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Search emoji';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Search emoji';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Search emoji';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Search emoji';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'Ty ze sobą';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Szukaj emoji';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'Вы с собой';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Поиск эмодзи';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 11 additions & 0 deletions
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 dmsWithOthersPageTitle(String others) {
285+
return 'DMs with $others';
286+
}
287+
283288
@override
284289
String get messageListGroupYouWithYourself => 'You with yourself';
285290

@@ -588,4 +593,10 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
588593

589594
@override
590595
String get emojiPickerSearchEmoji => 'Hľadať emotikon';
596+
597+
@override
598+
String get noEarlierMessages => 'No earlier messages';
599+
600+
@override
601+
String get scrollToBottomTooltip => 'Scroll to bottom';
591602
}

lib/widgets/message_list.dart

Lines changed: 11 additions & 7 deletions
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.dmsWithOthersPageTitle(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)