mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 08:08:14 -06:00
feat: Migrated strings, and translations to native flutter l10n plugin
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/features/documents/cubit/documents_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
final DocumentsState state;
|
||||
@@ -14,24 +14,24 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
assert(state.selection.isNotEmpty);
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).confirmDeletion),
|
||||
title: Text(S.of(context)!.confirmDeletion),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(
|
||||
S.of(context)!.areYouSureYouWantToDeleteTheFollowingDocuments(
|
||||
state.selection.length),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
...state.selection.map(_buildBulletPoint).toList(),
|
||||
const SizedBox(height: 16),
|
||||
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
Text(S.of(context)!.thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
@@ -41,7 +41,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
child: Text(S.of(context).delete),
|
||||
child: Text(S.of(context)!.delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ConfirmDeleteSavedViewDialog extends StatelessWidget {
|
||||
const ConfirmDeleteSavedViewDialog({
|
||||
@@ -14,18 +14,18 @@ class ConfirmDeleteSavedViewDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
S.of(context).deleteView + view.name + "?",
|
||||
S.of(context)!.deleteView + view.name + "?",
|
||||
softWrap: true,
|
||||
),
|
||||
content: Text(S.of(context).doYouReallyWantToDeleteThisView),
|
||||
content: Text(S.of(context)!.doYouReallyWantToDeleteThisView),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
S.of(context).delete,
|
||||
S.of(context)!.delete,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/view_type.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
/// Meant to be used with blocbuilder.
|
||||
class ViewTypeSelectionWidget extends StatelessWidget {
|
||||
@@ -34,19 +34,19 @@ class ViewTypeSelectionWidget extends StatelessWidget {
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.list,
|
||||
label: S.of(context).list,
|
||||
label: S.of(context)!.list,
|
||||
icon: Icons.list,
|
||||
),
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.grid,
|
||||
label: S.of(context).grid,
|
||||
label: S.of(context)!.grid,
|
||||
icon: Icons.grid_view_rounded,
|
||||
),
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.detailed,
|
||||
label: S.of(context).detailed,
|
||||
label: S.of(context)!.detailed,
|
||||
icon: Icons.article_outlined,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user