@@ -539,23 +539,25 @@ Future<Iterable<_File>> _getFilePickerFiles(BuildContext context, FileType type)
539
539
.pickFiles (allowMultiple: true , withReadStream: true , type: type);
540
540
} catch (e) {
541
541
if (! context.mounted) return [];
542
+ final zulipLocalizations = ZulipLocalizations .of (context);
542
543
if (e is PlatformException && e.code == 'read_external_storage_denied' ) {
543
544
// Observed on Android. If Android's error message tells us whether the
544
545
// user has checked "Don't ask again", it seems the library doesn't pass
545
546
// that on to us. So just always prompt to check permissions in settings.
546
547
// If the user hasn't checked "Don't ask again", they can always dismiss
547
548
// our prompt and retry, and the permissions request will reappear,
548
549
// letting them grant permissions and complete the upload.
549
- showSuggestedActionDialog (context: context, // TODO(i18n)
550
- title: 'Permissions needed' ,
551
- message: 'To upload files, please grant Zulip additional permissions in Settings.' ,
552
- actionButtonText: 'Open settings' ,
550
+ showSuggestedActionDialog (context: context,
551
+ title: zulipLocalizations.permissionsNeededTitle ,
552
+ message: zulipLocalizations.permissionsDeniedReadExternalStorage ,
553
+ actionButtonText: zulipLocalizations.permissionsNeededOpenSettings ,
553
554
onActionButtonPress: () {
554
555
AppSettings .openAppSettings ();
555
556
});
556
557
} else {
557
- // TODO(i18n)
558
- showErrorDialog (context: context, title: 'Error' , message: e.toString ());
558
+ showErrorDialog (context: context,
559
+ title: zulipLocalizations.errorDialogTitle,
560
+ message: e.toString ());
559
561
}
560
562
return [];
561
563
}
@@ -626,15 +628,16 @@ class _AttachFromCameraButton extends _AttachUploadsButton {
626
628
// use a protected resource. After that, the only way the user can
627
629
// grant it is in Settings.
628
630
showSuggestedActionDialog (context: context,
629
- title: zulipLocalizations.cameraAccessDeniedTitle ,
630
- message: zulipLocalizations.cameraAccessDeniedMessage ,
631
- actionButtonText: zulipLocalizations.cameraAccessDeniedButtonText ,
631
+ title: zulipLocalizations.permissionsNeededTitle ,
632
+ message: zulipLocalizations.permissionsDeniedCameraAccess ,
633
+ actionButtonText: zulipLocalizations.permissionsNeededOpenSettings ,
632
634
onActionButtonPress: () {
633
635
AppSettings .openAppSettings ();
634
636
});
635
637
} else {
636
- // TODO(i18n)
637
- showErrorDialog (context: context, title: 'Error' , message: e.toString ());
638
+ showErrorDialog (context: context,
639
+ title: zulipLocalizations.errorDialogTitle,
640
+ message: e.toString ());
638
641
}
639
642
return [];
640
643
}
@@ -712,7 +715,7 @@ class _SendButtonState extends State<_SendButton> {
712
715
];
713
716
showErrorDialog (
714
717
context: context,
715
- title: 'Message not sent' ,
718
+ title: zulipLocalizations.errorMessageNotSent ,
716
719
message: validationErrorMessages.join ('\n\n ' ));
717
720
return ;
718
721
}
0 commit comments