mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +01:00
fix: Localize ok cancel alert dialogs
This commit is contained in:
parent
d5aa6e102c
commit
9f9b833c68
@ -69,6 +69,8 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
|||||||
var confirmed = await showOkCancelAlertDialog(
|
var confirmed = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
);
|
);
|
||||||
if (confirmed == OkCancelResult.ok) {
|
if (confirmed == OkCancelResult.ok) {
|
||||||
final success = await showFutureLoadingDialog(
|
final success = await showFutureLoadingDialog(
|
||||||
|
@ -151,6 +151,8 @@ class _BootstrapDialogState extends State<BootstrapDialog> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: widget.l10n.securityKeyLost,
|
title: widget.l10n.securityKeyLost,
|
||||||
message: widget.l10n.wipeChatBackup,
|
message: widget.l10n.wipeChatBackup,
|
||||||
|
okLabel: widget.l10n.ok,
|
||||||
|
cancelLabel: widget.l10n.cancel,
|
||||||
isDestructiveAction: true,
|
isDestructiveAction: true,
|
||||||
)) {
|
)) {
|
||||||
_createBootstrap(true);
|
_createBootstrap(true);
|
||||||
|
@ -39,6 +39,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
|
|||||||
? L10n.of(context).warningEncryptionInBeta
|
? L10n.of(context).warningEncryptionInBeta
|
||||||
: L10n.of(context).needPantalaimonWarning,
|
: L10n.of(context).needPantalaimonWarning,
|
||||||
okLabel: L10n.of(context).yes,
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
|
@ -122,6 +122,8 @@ class ChatListItem extends StatelessWidget {
|
|||||||
final confirmed = await showOkCancelAlertDialog(
|
final confirmed = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).no,
|
||||||
);
|
);
|
||||||
if (confirmed == OkCancelResult.cancel) return;
|
if (confirmed == OkCancelResult.cancel) return;
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
|
@ -321,6 +321,8 @@ class MatrixState extends State<Matrix> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).newVerificationRequest,
|
title: L10n.of(context).newVerificationRequest,
|
||||||
message: L10n.of(context).askVerificationRequest(request.userId),
|
message: L10n.of(context).askVerificationRequest(request.userId),
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
request.onUpdate = null;
|
request.onUpdate = null;
|
||||||
|
@ -27,9 +27,13 @@ class UserBottomSheet extends StatelessWidget {
|
|||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
void participantAction(BuildContext context, String action) async {
|
void participantAction(BuildContext context, String action) async {
|
||||||
final Function _askConfirmation = () async =>
|
final Function _askConfirmation =
|
||||||
(await showOkCancelAlertDialog(
|
() async => (await showOkCancelAlertDialog(
|
||||||
context: context, title: l10n.areYouSure) ==
|
context: context,
|
||||||
|
title: l10n.areYouSure,
|
||||||
|
okLabel: l10n.yes,
|
||||||
|
cancelLabel: l10n.no,
|
||||||
|
) ==
|
||||||
OkCancelResult.ok);
|
OkCancelResult.ok);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'mention':
|
case 'mention':
|
||||||
|
@ -347,6 +347,7 @@ class _ChatState extends State<Chat> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).messageWillBeRemovedWarning,
|
title: L10n.of(context).messageWillBeRemovedWarning,
|
||||||
okLabel: L10n.of(context).remove,
|
okLabel: L10n.of(context).remove,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok;
|
OkCancelResult.ok;
|
||||||
if (!confirmed) return;
|
if (!confirmed) return;
|
||||||
|
@ -46,6 +46,8 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).isDeviceKeyCorrect,
|
title: L10n.of(context).isDeviceKeyCorrect,
|
||||||
message: key.ed25519Key.beautified,
|
message: key.ed25519Key.beautified,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
await unblock();
|
await unblock();
|
||||||
|
@ -185,6 +185,8 @@ class _ChatListState extends State<ChatList> {
|
|||||||
final confirmed = await showOkCancelAlertDialog(
|
final confirmed = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.ok;
|
OkCancelResult.ok;
|
||||||
if (!confirmed) return;
|
if (!confirmed) return;
|
||||||
|
@ -64,6 +64,7 @@ class _DiscoverState extends State<Discover> {
|
|||||||
okLabel: L10n.of(context).joinRoom,
|
okLabel: L10n.of(context).joinRoom,
|
||||||
title: '${room.name} (${room.numJoinedMembers ?? 0})',
|
title: '${room.name} (${room.numJoinedMembers ?? 0})',
|
||||||
message: room.topic ?? L10n.of(context).noDescription,
|
message: room.topic ?? L10n.of(context).noDescription,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
|
@ -44,6 +44,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSureYouWantToLogout,
|
title: L10n.of(context).areYouSureYouWantToLogout,
|
||||||
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
@ -91,12 +93,18 @@ class _SettingsState extends State<Settings> {
|
|||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).warning,
|
title: L10n.of(context).warning,
|
||||||
message: L10n.of(context).deactivateAccountWarning,
|
message: L10n.of(context).deactivateAccountWarning,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (await showOkCancelAlertDialog(
|
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) {
|
OkCancelResult.cancel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -512,6 +520,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
title: L10n.of(context).keysCached,
|
title: L10n.of(context).keysCached,
|
||||||
message: L10n.of(context).wipeChatBackup,
|
message: L10n.of(context).wipeChatBackup,
|
||||||
isDestructiveAction: true,
|
isDestructiveAction: true,
|
||||||
|
okLabel: L10n.of(context).ok,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
)) {
|
)) {
|
||||||
await BootstrapDialog(
|
await BootstrapDialog(
|
||||||
l10n: L10n.of(context),
|
l10n: L10n.of(context),
|
||||||
|
@ -76,6 +76,8 @@ class _Settings3PidState extends State<Settings3Pid> {
|
|||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) !=
|
) !=
|
||||||
OkCancelResult.ok) {
|
OkCancelResult.ok) {
|
||||||
return;
|
return;
|
||||||
|
@ -29,6 +29,8 @@ class DevicesSettingsState extends State<DevicesSettings> {
|
|||||||
if (await showOkCancelAlertDialog(
|
if (await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
title: L10n.of(context).areYouSure,
|
title: L10n.of(context).areYouSure,
|
||||||
|
okLabel: L10n.of(context).yes,
|
||||||
|
cancelLabel: L10n.of(context).cancel,
|
||||||
) ==
|
) ==
|
||||||
OkCancelResult.cancel) return;
|
OkCancelResult.cancel) return;
|
||||||
var matrix = Matrix.of(context);
|
var matrix = Matrix.of(context);
|
||||||
|
Loading…
Reference in New Issue
Block a user