From 681c7638e1a326e69ef6b4a11fcb3b9f745de6ee Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Fri, 10 Nov 2023 11:37:12 -0500 Subject: [PATCH] i18n: Set up "All messages" page title for translation --- assets/l10n/app_en.arb | 4 ++++ lib/widgets/app.dart | 2 +- lib/widgets/message_list.dart | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/l10n/app_en.arb b/assets/l10n/app_en.arb index 505b7ae2d3..edb01af23d 100644 --- a/assets/l10n/app_en.arb +++ b/assets/l10n/app_en.arb @@ -420,5 +420,9 @@ "recentDmConversationsPageTitle": "Direct messages", "@recentDmConversationsPageTitle": { "description": "Title for the page of recent DM conversations" + }, + "allMessagesPageTitle": "All messages", + "@allMessagesPageTitle": { + "description": "Title for the page of all messages" } } diff --git a/lib/widgets/app.dart b/lib/widgets/app.dart index b57c779c13..92ed8cb6a4 100644 --- a/lib/widgets/app.dart +++ b/lib/widgets/app.dart @@ -250,7 +250,7 @@ class HomePage extends StatelessWidget { onPressed: () => Navigator.push(context, MessageListPage.buildRoute(context: context, narrow: const AllMessagesNarrow())), - child: const Text("All messages")), + child: Text(zulipLocalizations.allMessagesPageTitle)), const SizedBox(height: 16), ElevatedButton( onPressed: () => Navigator.push(context, diff --git a/lib/widgets/message_list.dart b/lib/widgets/message_list.dart index 625dd393c2..e2dc307209 100644 --- a/lib/widgets/message_list.dart +++ b/lib/widgets/message_list.dart @@ -124,9 +124,11 @@ class MessageListAppBarTitle extends StatelessWidget { @override Widget build(BuildContext context) { + final zulipLocalizations = ZulipLocalizations.of(context); + switch (narrow) { case AllMessagesNarrow(): - return const Text("All messages"); + return Text(zulipLocalizations.allMessagesPageTitle); case StreamNarrow(:var streamId): final store = PerAccountStoreWidget.of(context);