mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +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(
|
||||
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(
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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;
|
||||
|
@ -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':
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user