fix: Localize ok cancel alert dialogs

This commit is contained in:
Christian Pauly 2021-02-18 14:23:22 +01:00
parent d5aa6e102c
commit 9f9b833c68
13 changed files with 37 additions and 4 deletions

View File

@ -69,6 +69,8 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
var confirmed = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
);
if (confirmed == OkCancelResult.ok) {
final success = await showFutureLoadingDialog(

View File

@ -151,6 +151,8 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
context: context,
title: widget.l10n.securityKeyLost,
message: widget.l10n.wipeChatBackup,
okLabel: widget.l10n.ok,
cancelLabel: widget.l10n.cancel,
isDestructiveAction: true,
)) {
_createBootstrap(true);

View File

@ -39,6 +39,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
? L10n.of(context).warningEncryptionInBeta
: L10n.of(context).needPantalaimonWarning,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.ok) {
await showFutureLoadingDialog(

View File

@ -122,6 +122,8 @@ class ChatListItem extends StatelessWidget {
final confirmed = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).no,
);
if (confirmed == OkCancelResult.cancel) return;
await showFutureLoadingDialog(

View File

@ -321,6 +321,8 @@ class MatrixState extends State<Matrix> {
context: context,
title: L10n.of(context).newVerificationRequest,
message: L10n.of(context).askVerificationRequest(request.userId),
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.ok) {
request.onUpdate = null;

View File

@ -27,9 +27,13 @@ class UserBottomSheet extends StatelessWidget {
}) : super(key: key);
void participantAction(BuildContext context, String action) async {
final Function _askConfirmation = () async =>
(await showOkCancelAlertDialog(
context: context, title: l10n.areYouSure) ==
final Function _askConfirmation =
() async => (await showOkCancelAlertDialog(
context: context,
title: l10n.areYouSure,
okLabel: l10n.yes,
cancelLabel: l10n.no,
) ==
OkCancelResult.ok);
switch (action) {
case 'mention':

View File

@ -347,6 +347,7 @@ class _ChatState extends State<Chat> {
context: context,
title: L10n.of(context).messageWillBeRemovedWarning,
okLabel: L10n.of(context).remove,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.ok;
if (!confirmed) return;

View File

@ -46,6 +46,8 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
context: context,
title: L10n.of(context).isDeviceKeyCorrect,
message: key.ed25519Key.beautified,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.ok) {
await unblock();

View File

@ -185,6 +185,8 @@ class _ChatListState extends State<ChatList> {
final confirmed = await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.ok;
if (!confirmed) return;

View File

@ -64,6 +64,7 @@ class _DiscoverState extends State<Discover> {
okLabel: L10n.of(context).joinRoom,
title: '${room.name} (${room.numJoinedMembers ?? 0})',
message: room.topic ?? L10n.of(context).noDescription,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) {
return;

View File

@ -44,6 +44,8 @@ class _SettingsState extends State<Settings> {
if (await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSureYouWantToLogout,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) {
return;
@ -91,12 +93,18 @@ class _SettingsState extends State<Settings> {
context: context,
title: L10n.of(context).warning,
message: L10n.of(context).deactivateAccountWarning,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) {
return;
}
if (await showOkCancelAlertDialog(
context: context, title: L10n.of(context).areYouSure) ==
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) {
return;
}
@ -512,6 +520,8 @@ class _SettingsState extends State<Settings> {
title: L10n.of(context).keysCached,
message: L10n.of(context).wipeChatBackup,
isDestructiveAction: true,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
)) {
await BootstrapDialog(
l10n: L10n.of(context),

View File

@ -76,6 +76,8 @@ class _Settings3PidState extends State<Settings3Pid> {
if (await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) !=
OkCancelResult.ok) {
return;

View File

@ -29,6 +29,8 @@ class DevicesSettingsState extends State<DevicesSettings> {
if (await showOkCancelAlertDialog(
context: context,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) ==
OkCancelResult.cancel) return;
var matrix = Matrix.of(context);