Skip to content

Commit d6d85e4

Browse files
committed
profile: Translate strings on _ProfileErrorPage
Signed-off-by: Zixuan James Li <[email protected]>
1 parent e4f48e2 commit d6d85e4

10 files changed

+38
-6
lines changed

assets/l10n/app_en.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
"@profileButtonSendDirectMessage": {
5757
"description": "Label for button in profile screen to navigate to DMs with the shown user."
5858
},
59+
"errorShowUserProfile": "Could not show user profile.",
60+
"@errorShowUserProfile": {
61+
"description": "Message that appears on the user profile page when the profile cannot be shown."
62+
},
5963
"permissionsNeededTitle": "Permissions needed",
6064
"@permissionsNeededTitle": {
6165
"description": "Title for dialog asking the user to grant additional permissions."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ abstract class ZulipLocalizations {
189189
/// **'Send direct message'**
190190
String get profileButtonSendDirectMessage;
191191

192+
/// Message that appears on the user profile page when the profile cannot be shown.
193+
///
194+
/// In en, this message translates to:
195+
/// **'Could not show user profile.'**
196+
String get errorShowUserProfile;
197+
192198
/// Title for dialog asking the user to grant additional permissions.
193199
///
194200
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Send direct message';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Permissions needed';
5760

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Send direct message';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Permissions needed';
5760

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'ダイレクトメッセージを送信';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Permissions needed';
5760

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Send direct message';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Permissions needed';
5760

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Wyślij wiadomość bezpośrednią';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Wymagane uprawnienia';
5760

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Отправить личное сообщение';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Требуются разрешения';
5760

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
5252
@override
5353
String get profileButtonSendDirectMessage => 'Poslať priamu správu';
5454

55+
@override
56+
String get errorShowUserProfile => 'Could not show user profile.';
57+
5558
@override
5659
String get permissionsNeededTitle => 'Permissions needed';
5760

lib/widgets/profile.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,18 @@ class _ProfileErrorPage extends StatelessWidget {
121121

122122
@override
123123
Widget build(BuildContext context) {
124+
final zulipLocalizations = ZulipLocalizations.of(context);
124125
return Scaffold(
125-
appBar: ZulipAppBar(title: const Text('Error')),
126-
body: const SingleChildScrollView(
126+
appBar: ZulipAppBar(title: Text(zulipLocalizations.errorDialogTitle)),
127+
body: SingleChildScrollView(
127128
child: Padding(
128-
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 32),
129+
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 32),
129130
child: Row(
130131
mainAxisAlignment: MainAxisAlignment.center,
131132
children: [
132-
Icon(Icons.error),
133-
SizedBox(width: 4),
134-
Text('Could not show user profile.'),
133+
const Icon(Icons.error),
134+
const SizedBox(width: 4),
135+
Text(zulipLocalizations.errorShowUserProfile),
135136
]))));
136137
}
137138
}

0 commit comments

Comments
 (0)