feat: Migrated strings, and translations to native flutter l10n plugin

This commit is contained in:
Anton Stubenbord
2023-02-17 00:00:13 +01:00
parent 7b55a96164
commit 14ab604118
90 changed files with 1661 additions and 683 deletions

View File

@@ -7,7 +7,8 @@ import 'package:paperless_mobile/extensions/flutter_extensions.dart';
import 'package:paperless_mobile/features/document_search/cubit/document_search_cubit.dart';
import 'package:paperless_mobile/features/document_search/view/remove_history_entry_dialog.dart';
import 'package:paperless_mobile/features/documents/view/widgets/adaptive_documents_view.dart';
import 'package:paperless_mobile/generated/l10n.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/routes/document_details_route.dart';
import 'dart:math' as math;
@@ -60,7 +61,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
hintStyle: theme.textTheme.bodyLarge?.apply(
color: theme.colorScheme.onSurfaceVariant,
),
hintText: S.of(context).searchDocuments,
hintText: S.of(context)!.searchDocuments,
border: InputBorder.none,
),
controller: _queryController,
@@ -181,7 +182,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
Widget _buildResultsView(DocumentSearchState state) {
final header = Text(
S.of(context).results,
S.of(context)!.results,
style: Theme.of(context).textTheme.labelSmall,
).padded();
return CustomScrollView(
@@ -190,7 +191,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
if (state.hasLoaded && !state.isLoading && state.documents.isEmpty)
SliverToBoxAdapter(
child: Center(
child: Text(S.of(context).noMatchesFound),
child: Text(S.of(context)!.noMatchesFound),
),
)
else

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:paperless_mobile/core/widgets/dialog_utils/dialog_cancel_button.dart';
import 'package:paperless_mobile/generated/l10n.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
class RemoveHistoryEntryDialog extends StatelessWidget {
final String entry;
@@ -10,11 +10,11 @@ class RemoveHistoryEntryDialog extends StatelessWidget {
Widget build(BuildContext context) {
return AlertDialog(
title: Text(entry),
content: Text(S.of(context).removeQueryFromSearchHistory),
content: Text(S.of(context)!.removeQueryFromSearchHistory),
actions: [
const DialogCancelButton(),
TextButton(
child: Text(S.of(context).remove),
child: Text(S.of(context)!.remove),
onPressed: () {
Navigator.pop(context, true);
},