feat: Renamed translation strings

This commit is contained in:
Anton Stubenbord
2023-02-16 20:55:10 +01:00
parent fb6f79f017
commit d1a49ac73d
80 changed files with 3281 additions and 3974 deletions

View File

@@ -153,7 +153,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
}
final filename = extractFilenameFromPath(mediaFile.path);
final extension = p.extension(mediaFile.path);
try {
if (await File(mediaFile.path).exists()) {
final bytes = File(mediaFile.path).readAsBytesSync();
final success = await Navigator.push<bool>(
@@ -178,23 +177,17 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
false;
if (success) {
await Fluttertoast.showToast(
msg: S.of(context).documentUploadSuccessText,
msg: S.of(context).documentSuccessfullyUploadedProcessing,
);
SystemNavigator.pop();
}
} else {
Fluttertoast.showToast(
msg: S.of(context).receiveSharedFilePermissionDeniedMessage,
msg: S.of(context).couldNotAccessReceivedFile,
toastLength: Toast.LENGTH_LONG,
);
}
} catch (e) {
Fluttertoast.showToast(
msg: S.of(context).receiveSharedFilePermissionDeniedMessage,
toastLength: Toast.LENGTH_LONG,
);
}
}
@override
Widget build(BuildContext context) {
@@ -205,7 +198,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
Icons.description,
color: Theme.of(context).colorScheme.primary,
),
label: S.of(context).bottomNavDocumentsPageLabel,
label: S.of(context).documents,
),
RouteDescription(
icon: const Icon(Icons.document_scanner_outlined),
@@ -213,7 +206,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
Icons.document_scanner,
color: Theme.of(context).colorScheme.primary,
),
label: S.of(context).bottomNavScannerPageLabel,
label: S.of(context).scanner,
),
RouteDescription(
icon: const Icon(Icons.sell_outlined),
@@ -221,7 +214,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
Icons.sell,
color: Theme.of(context).colorScheme.primary,
),
label: S.of(context).bottomNavLabelsPageLabel,
label: S.of(context).labels,
),
RouteDescription(
icon: const Icon(Icons.inbox_outlined),
@@ -229,7 +222,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
Icons.inbox,
color: Theme.of(context).colorScheme.primary,
),
label: S.of(context).bottomNavInboxPageLabel,
label: S.of(context).inbox,
badgeBuilder: (icon) => BlocBuilder<InboxCubit, InboxState>(
bloc: _inboxCubit,
builder: (context, state) {

View File

@@ -1,320 +0,0 @@
// import 'package:flutter/material.dart';
// import 'package:flutter_bloc/flutter_bloc.dart';
// import 'package:hydrated_bloc/hydrated_bloc.dart';
// import 'package:package_info_plus/package_info_plus.dart';
// import 'package:paperless_api/paperless_api.dart';
// import 'package:paperless_mobile/core/bloc/paperless_server_information_cubit.dart';
// import 'package:paperless_mobile/core/bloc/paperless_server_information_state.dart';
// import 'package:paperless_mobile/core/repository/label_repository.dart';
// import 'package:paperless_mobile/core/repository/provider/label_repositories_provider.dart';
// import 'package:paperless_mobile/core/repository/saved_view_repository.dart';
// import 'package:paperless_mobile/core/repository/state/impl/correspondent_repository_state.dart';
// import 'package:paperless_mobile/core/repository/state/impl/document_type_repository_state.dart';
// import 'package:paperless_mobile/core/repository/state/impl/storage_path_repository_state.dart';
// import 'package:paperless_mobile/core/repository/state/impl/tag_repository_state.dart';
// import 'package:paperless_mobile/extensions/flutter_extensions.dart';
// import 'package:paperless_mobile/features/inbox/cubit/inbox_cubit.dart';
// import 'package:paperless_mobile/features/inbox/view/pages/inbox_page.dart';
// import 'package:paperless_mobile/features/login/bloc/authentication_cubit.dart';
// import 'package:paperless_mobile/features/settings/bloc/application_settings_cubit.dart';
// import 'package:paperless_mobile/features/settings/view/settings_page.dart';
// import 'package:paperless_mobile/generated/l10n.dart';
// import 'package:paperless_mobile/helpers/message_helpers.dart';
// import 'package:paperless_mobile/constants.dart';
// import 'package:url_launcher/link.dart';
// import 'package:url_launcher/url_launcher_string.dart';
// class AppDrawer extends StatefulWidget {
// final VoidCallback? afterInboxClosed;
// const AppDrawer({Key? key, this.afterInboxClosed}) : super(key: key);
// @override
// State<AppDrawer> createState() => _AppDrawerState();
// }
// // enum NavigationDestinations {
// // inbox,
// // settings,
// // reportBug,
// // about,
// // logout;
// // }
// class _AppDrawerState extends State<AppDrawer> {
// @override
// void initState() {
// super.initState();
// }
// @override
// Widget build(BuildContext context) {
// final listtTileShape = RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(32),
// );
// // return NavigationDrawer(
// // selectedIndex: -1,
// // children: [
// // Text(
// // "",
// // style: Theme.of(context).textTheme.titleSmall,
// // ).padded(16),
// // NavigationDrawerDestination(
// // icon: const Icon(Icons.inbox),
// // label: Text(S.of(context).bottomNavInboxPageLabel),
// // ),
// // NavigationDrawerDestination(
// // icon: const Icon(Icons.settings),
// // label: Text(S.of(context).appDrawerSettingsLabel),
// // ),
// // const Divider(
// // indent: 16,
// // ),
// // NavigationDrawerDestination(
// // icon: const Icon(Icons.bug_report),
// // label: Text(S.of(context).appDrawerReportBugLabel),
// // ),
// // NavigationDrawerDestination(
// // icon: const Icon(Icons.info_outline),
// // label: Text(S.of(context).appDrawerAboutLabel),
// // ),
// // ],
// // onDestinationSelected: (idx) {
// // final val = NavigationDestinations.values[idx - 1];
// // switch (val) {
// // case NavigationDestinations.inbox:
// // _onOpenInbox();
// // break;
// // case NavigationDestinations.settings:
// // _onOpenSettings();
// // break;
// // case NavigationDestinations.reportBug:
// // launchUrlString(
// // 'https://github.com/astubenbord/paperless-mobile/issues/new',
// // );
// // break;
// // case NavigationDestinations.about:
// // _onShowAboutDialog();
// // break;
// // case NavigationDestinations.logout:
// // _onLogout();
// // break;
// // }
// // },
// // );
// return SafeArea(
// top: true,
// child: ClipRRect(
// borderRadius: const BorderRadius.only(
// topRight: Radius.circular(16.0),
// bottomRight: Radius.circular(16.0),
// ),
// child: Drawer(
// shape: const RoundedRectangleBorder(
// borderRadius: BorderRadius.only(
// topRight: Radius.circular(16.0),
// bottomRight: Radius.circular(16.0),
// ),
// ),
// child: ListView(
// children: [
// DrawerHeader(
// decoration: BoxDecoration(
// color: Theme.of(context).colorScheme.secondaryContainer,
// ),
// padding: const EdgeInsets.only(
// top: 8,
// left: 8,
// bottom: 0,
// right: 8,
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// children: [
// Image.asset(
// 'assets/logos/paperless_logo_white.png',
// height: 32,
// width: 32,
// color:
// Theme.of(context).colorScheme.onPrimaryContainer,
// ).paddedOnly(right: 8.0),
// Text(
// S.of(context).appTitleText,
// style: Theme.of(context)
// .textTheme
// .headlineSmall
// ?.copyWith(
// color: Theme.of(context)
// .colorScheme
// .onPrimaryContainer,
// ),
// ),
// ],
// ),
// Align(
// alignment: Alignment.bottomRight,
// child: BlocBuilder<PaperlessServerInformationCubit,
// PaperlessServerInformationState>(
// builder: (context, state) {
// if (!state.isLoaded) {
// return Container();
// }
// final info = state.information!;
// return Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// ListTile(
// contentPadding: EdgeInsets.zero,
// dense: true,
// title: Text(
// S.of(context).appDrawerHeaderLoggedInAsText +
// (info.username ?? '?'),
// style: Theme.of(context).textTheme.bodyMedium,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.end,
// maxLines: 1,
// ),
// subtitle: Column(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// state.information!.host ?? '',
// style: Theme.of(context)
// .textTheme
// .bodyMedium,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.end,
// maxLines: 1,
// ),
// Text(
// '${S.of(context).serverInformationPaperlessVersionText} ${info.version} (API v${info.apiVersion})',
// style:
// Theme.of(context).textTheme.bodySmall,
// overflow: TextOverflow.ellipsis,
// textAlign: TextAlign.end,
// maxLines: 1,
// ),
// ],
// ),
// isThreeLine: true,
// ),
// ],
// );
// },
// ),
// ),
// ],
// ),
// ),
// ...[
// ListTile(
// title: Text(S.of(context).bottomNavInboxPageLabel),
// leading: const Icon(Icons.inbox),
// onTap: () => _onOpenInbox(),
// shape: listtTileShape,
// ),
// ListTile(
// leading: const Icon(Icons.settings),
// shape: listtTileShape,
// title: Text(
// S.of(context).appDrawerSettingsLabel,
// ),
// onTap: () => Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) => BlocProvider.value(
// value: context.read<ApplicationSettingsCubit>(),
// child: const SettingsPage(),
// ),
// ),
// ),
// ),
// const Divider(
// indent: 16,
// endIndent: 16,
// ),
// ListTile(
// leading: const Icon(Icons.bug_report),
// title: Text(S.of(context).appDrawerReportBugLabel),
// onTap: () {
// launchUrlString(
// 'https://github.com/astubenbord/paperless-mobile/issues/new');
// },
// shape: listtTileShape,
// ),
// ListTile(
// title: Text(S.of(context).appDrawerAboutLabel),
// leading: Icon(Icons.info_outline_rounded),
// onTap: _onShowAboutDialog,
// shape: listtTileShape,
// ),
// ListTile(
// leading: const Icon(Icons.logout),
// title: Text(S.of(context).appDrawerLogoutLabel),
// shape: listtTileShape,
// onTap: () {
// _onLogout();
// },
// )
// ],
// ],
// ),
// ),
// ),
// );
// }
// void _onLogout() async {
// try {
// await context.read<AuthenticationCubit>().logout();
// await context.read<ApplicationSettingsCubit>().clear();
// await context.read<LabelRepository<Tag, TagRepositoryState>>().clear();
// await context
// .read<LabelRepository<Correspondent, CorrespondentRepositoryState>>()
// .clear();
// await context
// .read<LabelRepository<DocumentType, DocumentTypeRepositoryState>>()
// .clear();
// await context
// .read<LabelRepository<StoragePath, StoragePathRepositoryState>>()
// .clear();
// await context.read<SavedViewRepository>().clear();
// await HydratedBloc.storage.clear();
// } on PaperlessServerException catch (error, stackTrace) {
// showErrorMessage(context, error, stackTrace);
// }
// }
// Future<void> _onOpenInbox() async {
// await Navigator.of(context).push(
// MaterialPageRoute(
// builder: (_) => LabelRepositoriesProvider(
// child: BlocProvider(
// create: (context) => InboxCubit(
// context.read(),
// context.read(),
// context.read(),
// context.read(),
// )..initializeInbox(),
// child: const InboxPage(),
// ),
// ),
// ),
// );
// widget.afterInboxClosed?.call();
// }
// void _onOpenSettings() {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) => BlocProvider.value(
// value: context.read<ApplicationSettingsCubit>(),
// child: const SettingsPage(),
// ),
// ),
// );
// }
// void _onShowAboutDialog() {}
// }

View File

@@ -19,12 +19,12 @@ class VerifyIdentityPage extends StatelessWidget {
appBar: AppBar(
elevation: 0,
backgroundColor: Theme.of(context).colorScheme.background,
title: Text(S.of(context).verifyIdentityPageTitle),
title: Text(S.of(context).verifyYourIdentity),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(S.of(context).verifyIdentityPageDescriptionText)
Text(S.of(context).useTheConfiguredBiometricFactorToAuthenticate)
.paddedSymmetrically(horizontal: 16),
const Icon(
Icons.fingerprint,
@@ -39,7 +39,7 @@ class VerifyIdentityPage extends StatelessWidget {
TextButton(
onPressed: () => _logout(context),
child: Text(
S.of(context).verifyIdentityPageLogoutButtonLabel,
S.of(context).disconnect,
style: TextStyle(
color: Theme.of(context).colorScheme.error,
),
@@ -52,9 +52,7 @@ class VerifyIdentityPage extends StatelessWidget {
.read<ApplicationSettingsCubit>()
.state
.isLocalAuthenticationEnabled),
child: Text(S
.of(context)
.verifyIdentityPageVerifyIdentityButtonLabel),
child: Text(S.of(context).verifyIdentity),
),
],
).padded(16),