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

@@ -121,7 +121,7 @@
// password: testPassword,
// ));
// expect(
// find.textContaining(t.translations.loginPagePasswordValidatorMessageText),
// find.textContaining(t.translations.passwordMustNotBeEmpty),
// findsOneWidget,
// );
// });
@@ -169,7 +169,7 @@
// password: testPassword,
// ));
// expect(
// find.textContaining(t.translations.loginPageUsernameValidatorMessageText),
// find.textContaining(t.translations.usernameMustNotBeEmpty),
// findsOneWidget,
// );
// });

View File

@@ -6,8 +6,8 @@ String translateColorSchemeOption(
BuildContext context, ColorSchemeOption option) {
switch (option) {
case ColorSchemeOption.classic:
return S.of(context).colorSchemeOptionClassic;
return S.of(context).classic;
case ColorSchemeOption.dynamic:
return S.of(context).colorSchemeOptionDynamic;
return S.of(context).dynamic;
}
}

View File

@@ -5,72 +5,72 @@ import 'package:paperless_mobile/generated/l10n.dart';
String translateError(BuildContext context, ErrorCode code) {
switch (code) {
case ErrorCode.unknown:
return S.of(context).errorMessageUnknonwnError;
return S.of(context).anUnknownErrorOccurred;
case ErrorCode.authenticationFailed:
return S.of(context).errorMessageAuthenticationFailed;
return S.of(context).authenticationFailedPleaseTryAgain;
case ErrorCode.notAuthenticated:
return S.of(context).errorMessageNotAuthenticated;
return S.of(context).userIsNotAuthenticated;
case ErrorCode.documentUploadFailed:
return S.of(context).errorMessageDocumentUploadFailed;
return S.of(context).couldNotUploadDocument;
case ErrorCode.documentUpdateFailed:
return S.of(context).errorMessageDocumentUpdateFailed;
return S.of(context).couldNotUpdateDocument;
case ErrorCode.documentLoadFailed:
return S.of(context).errorMessageDocumentLoadFailed;
return S.of(context).couldNotLoadDocuments;
case ErrorCode.documentDeleteFailed:
return S.of(context).errorMessageDocumentDeleteFailed;
return S.of(context).couldNotDeleteDocument;
case ErrorCode.documentPreviewFailed:
return S.of(context).errorMessageDocumentPreviewFailed;
return S.of(context).couldNotLoadDocumentPreview;
case ErrorCode.documentAsnQueryFailed:
return S.of(context).errorMessageDocumentAsnQueryFailed;
return S.of(context).couldNotAssignArchiveSerialNumber;
case ErrorCode.tagCreateFailed:
return S.of(context).errorMessageTagCreateFailed;
return S.of(context).couldNotCreateTag;
case ErrorCode.tagLoadFailed:
return S.of(context).errorMessageTagLoadFailed;
return S.of(context).couldNotLoadTags;
case ErrorCode.documentTypeCreateFailed:
return S.of(context).errorMessageDocumentTypeCreateFailed;
return S.of(context).couldNotCreateDocument;
case ErrorCode.documentTypeLoadFailed:
return S.of(context).errorMessageDocumentTypeLoadFailed;
return S.of(context).couldNotLoadDocumentTypes;
case ErrorCode.correspondentCreateFailed:
return S.of(context).errorMessageCorrespondentCreateFailed;
return S.of(context).couldNotCreateCorrespondent;
case ErrorCode.correspondentLoadFailed:
return S.of(context).errorMessageCorrespondentLoadFailed;
return S.of(context).couldNotLoadCorrespondents;
case ErrorCode.scanRemoveFailed:
return S.of(context).errorMessageScanRemoveFailed;
return S.of(context).anErrorOccurredRemovingTheScans;
case ErrorCode.invalidClientCertificateConfiguration:
return S.of(context).errorMessageInvalidClientCertificateConfiguration;
return S.of(context).invalidCertificateOrMissingPassphrase;
case ErrorCode.documentBulkActionFailed:
return S.of(context).errorMessageBulkActionFailed;
return S.of(context).couldNotBulkEditDocuments;
case ErrorCode.biometricsNotSupported:
return S.of(context).errorMessageBiotmetricsNotSupported;
return S.of(context).biometricAuthenticationNotSupported;
case ErrorCode.biometricAuthenticationFailed:
return S.of(context).errorMessageBiometricAuthenticationFailed;
return S.of(context).biometricAuthenticationFailed;
case ErrorCode.deviceOffline:
return S.of(context).errorMessageDeviceOffline;
return S.of(context).youAreCurrentlyOffline;
case ErrorCode.serverUnreachable:
return S.of(context).errorMessageServerUnreachable;
return S.of(context).couldNotReachYourPaperlessServer;
case ErrorCode.similarQueryError:
return S.of(context).errorMessageSimilarQueryError;
return S.of(context).couldNotLoadSimilarDocuments;
case ErrorCode.autocompleteQueryError:
return S.of(context).errorMessageAutocompleteQueryError;
return S.of(context).anErrorOccurredWhileTryingToAutocompleteYourQuery;
case ErrorCode.storagePathLoadFailed:
return S.of(context).errorMessageStoragePathLoadFailed;
return S.of(context).couldNotLoadStoragePaths;
case ErrorCode.storagePathCreateFailed:
return S.of(context).errorMessageStoragePathCreateFailed;
return S.of(context).couldNotCreateStoragePath;
case ErrorCode.loadSavedViewsError:
return S.of(context).errorMessageLoadSavedViewsError;
return S.of(context).couldNotLoadSavedViews;
case ErrorCode.createSavedViewError:
return S.of(context).errorMessageCreateSavedViewError;
return S.of(context).couldNotCreateSavedView;
case ErrorCode.deleteSavedViewError:
return S.of(context).errorMessageDeleteSavedViewError;
return S.of(context).couldNotDeleteSavedView;
case ErrorCode.requestTimedOut:
return S.of(context).errorMessageRequestTimedOut;
return S.of(context).requestTimedOut;
case ErrorCode.unsupportedFileFormat:
return S.of(context).errorMessageUnsupportedFileFormat;
return S.of(context).fileFormatNotSupported;
case ErrorCode.missingClientCertificate:
return S.of(context).errorMessageMissingClientCertificate;
return S.of(context).aClientCertificateWasExpectedButNotSent;
case ErrorCode.suggestionsQueryError:
return S.of(context).errorMessageSuggestionsQueryError;
return S.of(context).couldNotLoadSuggestions;
case ErrorCode.acknowledgeTasksError:
return S.of(context).errorMessageAcknowledgeTasksError;
return S.of(context).couldNotAcknowledgeTasks;
}
}

View File

@@ -8,17 +8,17 @@ String translateMatchingAlgorithmDescription(
) {
switch (algorithm) {
case MatchingAlgorithm.anyWord:
return S.of(context).matchingAlgorithmAnyDescription;
return S.of(context).documentContainsAnyOfTheseWords;
case MatchingAlgorithm.allWords:
return S.of(context).matchingAlgorithmAllDescription;
return S.of(context).documentContainsAllOfTheseWords;
case MatchingAlgorithm.exactMatch:
return S.of(context).matchingAlgorithmExactDescription;
return S.of(context).documentContainsThisString;
case MatchingAlgorithm.regex:
return S.of(context).matchingAlgorithmRegexDescription;
return S.of(context).documentMatchesThisRegularExpression;
case MatchingAlgorithm.fuzzy:
return S.of(context).matchingAlgorithmFuzzyDescription;
return S.of(context).documentContainsAWordSimilarToThisWord;
case MatchingAlgorithm.auto:
return S.of(context).matchingAlgorithmAutoDescription;
return S.of(context).learnMatchingAutomatically;
}
}
@@ -28,16 +28,16 @@ String translateMatchingAlgorithmName(
) {
switch (algorithm) {
case MatchingAlgorithm.anyWord:
return S.of(context).matchingAlgorithmAnyName;
return S.of(context).any;
case MatchingAlgorithm.allWords:
return S.of(context).matchingAlgorithmAllName;
return S.of(context).all;
case MatchingAlgorithm.exactMatch:
return S.of(context).matchingAlgorithmExactName;
return S.of(context).exact;
case MatchingAlgorithm.regex:
return S.of(context).matchingAlgorithmRegexName;
return S.of(context).regularExpression;
case MatchingAlgorithm.fuzzy:
return S.of(context).matchingAlgorithmFuzzyName;
return S.of(context).fuzzy;
case MatchingAlgorithm.auto:
return S.of(context).matchingAlgorithmAutoName;
return S.of(context).auto;
}
}

View File

@@ -5,19 +5,19 @@ import 'package:paperless_mobile/generated/l10n.dart';
String translateSortField(BuildContext context, SortField? sortField) {
switch (sortField) {
case SortField.archiveSerialNumber:
return S.of(context).documentArchiveSerialNumberPropertyShortLabel;
return S.of(context).asn;
case SortField.correspondentName:
return S.of(context).documentCorrespondentPropertyLabel;
return S.of(context).correspondent;
case SortField.title:
return S.of(context).documentTitlePropertyLabel;
return S.of(context).title;
case SortField.documentType:
return S.of(context).documentDocumentTypePropertyLabel;
return S.of(context).documentType;
case SortField.created:
return S.of(context).documentCreatedPropertyLabel;
return S.of(context).createdAt;
case SortField.added:
return S.of(context).documentAddedPropertyLabel;
return S.of(context).addedAt;
case SortField.modified:
return S.of(context).documentModifiedPropertyLabel;
return S.of(context).modifiedAt;
default:
return '';
}

View File

@@ -74,7 +74,7 @@
// padding: EdgeInsets.zero,
// child: ListTile(
// leading: const Icon(Icons.bug_report),
// title: Text(S.of(context).appDrawerReportBugLabel),
// title: Text(S.of(context).reportABug),
// ),
// );
// }
@@ -85,7 +85,7 @@
// value: AppPopupMenuEntries.openSettings,
// child: ListTile(
// leading: const Icon(Icons.settings_outlined),
// title: Text(S.of(context).appDrawerSettingsLabel),
// title: Text(S.of(context).settings),
// ),
// );
// }
@@ -96,7 +96,7 @@
// value: AppPopupMenuEntries.openAboutThisAppDialog,
// child: ListTile(
// leading: const Icon(Icons.info_outline),
// title: Text(S.of(context).appDrawerAboutLabel),
// title: Text(S.of(context).aboutThisApp),
// ),
// );
// }
@@ -146,7 +146,7 @@
// applicationName: 'Paperless Mobile',
// applicationVersion: packageInfo.version + '+' + packageInfo.buildNumber,
// children: [
// Text(S.of(context).aboutDialogDevelopedByText('Anton Stubenbord')),
// Text(S.of(context).developedBy('Anton Stubenbord')),
// Link(
// uri: Uri.parse('https://github.com/astubenbord/paperless-mobile'),
// builder: (context, followLink) => GestureDetector(

View File

@@ -10,7 +10,7 @@ class DialogCancelButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: onTap ?? () => Navigator.pop(context),
);
}

View File

@@ -47,7 +47,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
Widget build(BuildContext context) {
return AlertDialog(
insetPadding: const EdgeInsets.all(24.0),
title: Text(S.of(context).extendedDateRangeDialogTitle),
title: Text(S.of(context).selectDateRange),
content: FormBuilder(
key: _formKey,
child: Column(
@@ -56,7 +56,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
children: [
_buildDateRangeQueryTypeSelection(),
Text(
S.of(context).extendedDateRangeDialogHintText,
S.of(context).hintYouCanAlsoSpecifyRelativeValues,
style: Theme.of(context).textTheme.bodySmall,
).paddedOnly(top: 8, bottom: 16),
Builder(
@@ -83,11 +83,11 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
),
actions: [
TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: () => Navigator.pop(context),
),
TextButton(
child: Text(S.of(context).genericActionSaveLabel),
child: Text(S.of(context).save),
onPressed: () {
_formKey.currentState?.save();
if (_formKey.currentState?.validate() ?? false) {
@@ -110,12 +110,12 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
ButtonSegment(
value: DateRangeType.absolute,
enabled: true,
label: Text(S.of(context).extendedDateRangeDialogAbsoluteLabel),
label: Text(S.of(context).absolute),
),
ButtonSegment(
value: DateRangeType.relative,
enabled: true,
label: Text(S.of(context).extendedDateRangeDialogRelativeLabel),
label: Text(S.of(context).relative),
),
],
selected: {_selectedDateRangeType},
@@ -133,7 +133,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
: null,
initialDate: _before?.subtract(const Duration(days: 1)),
decoration: InputDecoration(
labelText: S.of(context).extendedDateRangePickerAfterLabel,
labelText: S.of(context).after,
prefixIcon: const Icon(Icons.date_range),
suffixIcon: _after != null
? IconButton(
@@ -161,7 +161,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
: null,
inputType: InputType.date,
decoration: InputDecoration(
labelText: S.of(context).extendedDateRangePickerBeforeLabel,
labelText: S.of(context).before,
prefixIcon: const Icon(Icons.date_range),
suffixIcon: _before != null
? IconButton(

View File

@@ -90,29 +90,21 @@ class _FormBuilderExtendedDateRangePickerState
return '${df.format(query.after!)} ${df.format(query.before!)}';
}
if (query.before != null) {
return '${S.of(context).extendedDateRangePickerBeforeLabel} ${df.format(query.before!)}';
return '${S.of(context).before} ${df.format(query.before!)}';
}
if (query.after != null) {
return '${S.of(context).extendedDateRangePickerAfterLabel} ${df.format(query.after!)}';
return '${S.of(context).after} ${df.format(query.after!)}';
}
} else if (query is RelativeDateRangeQuery) {
switch (query.unit) {
case DateRangeUnit.day:
return S
.of(context)
.extendedDateRangePickerLastDaysLabel(query.offset);
return S.of(context).lastNDays(query.offset);
case DateRangeUnit.week:
return S
.of(context)
.extendedDateRangePickerLastWeeksLabel(query.offset);
return S.of(context).lastNWeeks(query.offset);
case DateRangeUnit.month:
return S
.of(context)
.extendedDateRangePickerLastMonthsLabel(query.offset);
return S.of(context).lastNMonths(query.offset);
case DateRangeUnit.year:
return S
.of(context)
.extendedDateRangePickerLastYearsLabel(query.offset);
return S.of(context).lastNYears(query.offset);
default:
}
}

View File

@@ -46,14 +46,12 @@ class _FormBuilderRelativeDateRangePickerState
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(S.of(context).extendedDateRangeDialogRelativeLastLabel),
Text(S.of(context).last),
SizedBox(
width: 80,
child: TextFormField(
decoration: InputDecoration(
labelText: S
.of(context)
.extendedDateRangeDialogRelativeAmountLabel,
labelText: S.of(context).amount,
),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
@@ -92,9 +90,7 @@ class _FormBuilderRelativeDateRangePickerState
onChanged: (value) =>
field.didChange(field.value!.copyWith(unit: value)),
decoration: InputDecoration(
labelText: S
.of(context)
.extendedDateRangeDialogRelativeTimeUnitLabel,
labelText: S.of(context).timeUnit,
),
),
),
@@ -117,13 +113,13 @@ class _FormBuilderRelativeDateRangePickerState
String _dateRangeUnitToLocalizedString(DateRangeUnit unit, int? count) {
switch (unit) {
case DateRangeUnit.day:
return S.of(context).extendedDateRangePickerDayText(count ?? 1);
return S.of(context).days(count ?? 1);
case DateRangeUnit.week:
return S.of(context).extendedDateRangePickerWeekText(count ?? 1);
return S.of(context).weeks(count ?? 1);
case DateRangeUnit.month:
return S.of(context).extendedDateRangePickerMonthText(count ?? 1);
return S.of(context).months(count ?? 1);
case DateRangeUnit.year:
return S.of(context).extendedDateRangePickerYearText(count ?? 1);
return S.of(context).years(count ?? 1);
}
}
}

View File

@@ -49,19 +49,19 @@ class _RelativeDateRangePickerHelperState
List<_ExtendedDateRangeQueryOption> get _options => [
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastWeeksLabel(1),
S.of(context).lastNWeeks(1),
const RelativeDateRangeQuery(1, DateRangeUnit.week),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastMonthsLabel(1),
S.of(context).lastNMonths(1),
const RelativeDateRangeQuery(1, DateRangeUnit.month),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastMonthsLabel(3),
S.of(context).lastNMonths(3),
const RelativeDateRangeQuery(3, DateRangeUnit.month),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastYearsLabel(1),
S.of(context).lastNYears(1),
const RelativeDateRangeQuery(1, DateRangeUnit.year),
),
];

View File

@@ -52,7 +52,7 @@ class HintCard extends StatelessWidget {
Align(
alignment: Alignment.bottomRight,
child: TextButton(
child: Text(S.of(context).genericAcknowledgeLabel),
child: Text(S.of(context).gotIt),
onPressed: onHintAcknowledged,
),
)

View File

@@ -21,7 +21,7 @@ class OfflineBanner extends StatelessWidget with PreferredSizeWidget {
),
),
Text(
S.of(context).genericMessageOfflineText,
S.of(context).youreOffline,
style: TextStyle(
color: Theme.of(context).colorScheme.onErrorContainer,
),

View File

@@ -15,7 +15,7 @@ class OfflineWidget extends StatelessWidget {
color: Theme.of(context).disabledColor,
size: (Theme.of(context).iconTheme.size ?? 24) * 3),
Text(
S.of(context).offlineWidgetText,
S.of(context).anInternetConnectionCouldNotBeEstablished,
textAlign: TextAlign.center,
),
],

View File

@@ -31,14 +31,14 @@ class AppDrawer extends StatelessWidget {
const Divider(),
ListTile(
dense: true,
title: Text(S.of(context).appDrawerAboutLabel),
title: Text(S.of(context).aboutThisApp),
leading: const Icon(Icons.info_outline),
onTap: () => _showAboutDialog(context),
),
ListTile(
dense: true,
leading: const Icon(Icons.bug_report_outlined),
title: Text(S.of(context).appDrawerReportBugLabel),
title: Text(S.of(context).reportABug),
onTap: () {
launchUrlString(
'https://github.com/astubenbord/paperless-mobile/issues/new');
@@ -48,7 +48,7 @@ class AppDrawer extends StatelessWidget {
dense: true,
leading: const Icon(Icons.settings_outlined),
title: Text(
S.of(context).appDrawerSettingsLabel,
S.of(context).settings,
),
onTap: () => Navigator.of(context).push(
MaterialPageRoute(
@@ -74,7 +74,7 @@ class AppDrawer extends StatelessWidget {
applicationName: 'Paperless Mobile',
applicationVersion: packageInfo.version + '+' + packageInfo.buildNumber,
children: [
Text(S.of(context).aboutDialogDevelopedByText('Anton Stubenbord')),
Text(S.of(context).developedBy('Anton Stubenbord')),
Link(
uri: Uri.parse('https://github.com/astubenbord/paperless-mobile'),
builder: (context, followLink) => GestureDetector(

View File

@@ -26,8 +26,8 @@ class _ApplicationIntroSlideshowState extends State<ApplicationIntroSlideshow> {
child: IntroductionScreen(
globalBackgroundColor: Theme.of(context).canvasColor,
showDoneButton: true,
next: Text(S.of(context).onboardingNextButtonLabel),
done: Text(S.of(context).onboardingDoneButtonLabel),
next: Text(S.of(context).next),
done: Text(S.of(context).done),
onDone: () => Navigator.pop(context),
dotsDecorator: DotsDecorator(
color: Theme.of(context).colorScheme.onBackground,

View File

@@ -102,7 +102,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
tabs: [
Tab(
child: Text(
S.of(context).documentDetailsPageTabOverviewLabel,
S.of(context).overview,
style: TextStyle(
color: Theme.of(context)
.colorScheme
@@ -112,7 +112,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
),
Tab(
child: Text(
S.of(context).documentDetailsPageTabContentLabel,
S.of(context).content,
style: TextStyle(
color: Theme.of(context)
.colorScheme
@@ -122,7 +122,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
),
Tab(
child: Text(
S.of(context).documentDetailsPageTabMetaDataLabel,
S.of(context).metaData,
style: TextStyle(
color: Theme.of(context)
.colorScheme
@@ -132,9 +132,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
),
Tab(
child: Text(
S
.of(context)
.documentDetailsPageTabSimilarDocumentsLabel,
S.of(context).similarDocuments,
style: TextStyle(
color: Theme.of(context)
.colorScheme
@@ -200,7 +198,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
position: b.BadgePosition.topEnd(top: -12, end: -6),
showBadge: _filteredSuggestions.hasSuggestions,
child: Tooltip(
message: S.of(context).documentDetailsPageEditTooltip,
message: S.of(context).editDocumentTooltip,
preferBelow: false,
verticalOffset: 40,
child: FloatingActionButton(
@@ -233,14 +231,14 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
IconButton(
tooltip: S.of(context).documentDetailsPageDeleteTooltip,
tooltip: S.of(context).deleteDocumentTooltip,
icon: const Icon(Icons.delete),
onPressed: widget.allowEdit && isConnected
? () => _onDelete(state.document)
: null,
).paddedSymmetrically(horizontal: 4),
Tooltip(
message: S.of(context).documentDetailsPageDownloadTooltip,
message: S.of(context).downloadDocumentTooltip,
child: DocumentDownloadButton(
document: state.document,
enabled: isConnected,
@@ -248,20 +246,18 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
),
),
IconButton(
tooltip: S.of(context).documentDetailsPagePreviewTooltip,
tooltip: S.of(context).previewTooltip,
icon: const Icon(Icons.visibility),
onPressed:
isConnected ? () => _onOpen(state.document) : null,
).paddedOnly(right: 4.0),
IconButton(
tooltip: S
.of(context)
.documentDetailsPageOpenInSystemViewerTooltip,
tooltip: S.of(context).openInSystemViewer,
icon: const Icon(Icons.open_in_new),
onPressed: isConnected ? _onOpenFileInSystemViewer : null,
).paddedOnly(right: 4.0),
IconButton(
tooltip: S.of(context).documentDetailsPageShareTooltip,
tooltip: S.of(context).shareTooltip,
icon: const Icon(Icons.share),
onPressed: isConnected
? () =>
@@ -326,15 +322,13 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
await context.read<DocumentDetailsCubit>().openDocumentInSystemViewer();
if (status == ResultType.done) return;
if (status == ResultType.noAppToOpen) {
showGenericError(context,
S.of(context).documentDetailsPageNoPdfViewerFoundErrorMessage);
showGenericError(context, S.of(context).noAppToDisplayPDFFilesFound);
}
if (status == ResultType.fileNotFound) {
showGenericError(context, translateError(context, ErrorCode.unknown));
}
if (status == ResultType.permissionDenied) {
showGenericError(context,
S.of(context).documentDetailsPageOpenPdfPermissionDeniedErrorMessage);
showGenericError(context, S.of(context).couldNotOpenFilePermissionDenied);
}
}
@@ -348,7 +342,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
if (delete) {
try {
await context.read<DocumentDetailsCubit>().delete(document);
showSnackBar(context, S.of(context).documentDeleteSuccessMessage);
showSnackBar(context, S.of(context).documentSuccessfullyDeleted);
} on PaperlessServerException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
} finally {

View File

@@ -38,8 +38,7 @@ class DocumentContentWidget extends StatelessWidget {
Align(
alignment: Alignment.bottomCenter,
child: TextButton(
child:
Text(S.of(context).documentDetailsPageLoadFullContentLabel),
child: Text(S.of(context).loadFullContent),
onPressed: () {
context.read<DocumentDetailsCubit>().loadFullContent();
},

View File

@@ -53,15 +53,15 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
final downloadOriginal = await showDialog<bool>(
context: context,
builder: (context) => RadioSettingsDialog(
titleText: S.of(context).documentDownloadDialogChooseFiletype,
titleText: S.of(context).chooseFiletype,
options: [
RadioOption(
value: true,
label: S.of(context).documentDownloadDialogOriginalOption +
label: S.of(context).original +
" (${meta.originalMimeType.split("/").last})"),
RadioOption(
value: false,
label: S.of(context).documentDownloadDialogArchivedOption,
label: S.of(context).archivedPdf,
),
],
initialValue: false,
@@ -91,7 +91,7 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
createdFile.createSync(recursive: true);
createdFile.writeAsBytesSync(bytes);
debugPrint("Downloaded file to $filePath");
showSnackBar(context, S.of(context).documentDownloadSuccessMessage);
showSnackBar(context, S.of(context).documentSuccessfullyDownloaded);
} on PaperlessServerException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
} catch (error) {

View File

@@ -44,48 +44,39 @@ class DocumentMetaDataWidget extends StatelessWidget {
),
children: [
DetailsItem(
label: S
.of(context)
.documentArchiveSerialNumberPropertyLongLabel,
label: S.of(context).archiveSerialNumber,
content: document.archiveSerialNumber != null
? Text(document.archiveSerialNumber.toString())
: TextButton.icon(
icon: const Icon(Icons.archive_outlined),
label: Text(S
.of(context)
.documentDetailsPageAssignAsnButtonLabel),
label: Text(S.of(context).AssignAsn),
onPressed: connectivity.isConnected
? () => _assignAsn(context)
: null,
),
).paddedOnly(bottom: itemSpacing),
DetailsItem.text(DateFormat().format(document.modified),
label: S.of(context).documentModifiedPropertyLabel,
context: context)
label: S.of(context).modifiedAt, context: context)
.paddedOnly(bottom: itemSpacing),
DetailsItem.text(DateFormat().format(document.added),
label: S.of(context).documentAddedPropertyLabel,
context: context)
label: S.of(context).addedAt, context: context)
.paddedOnly(bottom: itemSpacing),
DetailsItem.text(
meta.mediaFilename,
context: context,
label:
S.of(context).documentMetaDataMediaFilenamePropertyLabel,
label: S.of(context).mediaFilename,
).paddedOnly(bottom: itemSpacing),
DetailsItem.text(
meta.originalChecksum,
context: context,
label: S.of(context).documentMetaDataChecksumLabel,
label: S.of(context).originalMD5Checksum,
).paddedOnly(bottom: itemSpacing),
DetailsItem.text(formatBytes(meta.originalSize, 2),
label:
S.of(context).documentMetaDataOriginalFileSizeLabel,
context: context)
label: S.of(context).originalFileSize, context: context)
.paddedOnly(bottom: itemSpacing),
DetailsItem.text(
meta.originalMimeType,
label: S.of(context).documentMetaDataOriginalMimeTypeLabel,
label: S.of(context).originalMIMEType,
context: context,
).paddedOnly(bottom: itemSpacing),
],

View File

@@ -29,7 +29,7 @@ class DocumentOverviewWidget extends StatelessWidget {
),
children: [
DetailsItem(
label: S.of(context).documentTitlePropertyLabel,
label: S.of(context).title,
content: HighlightedText(
text: document.title,
highlights: queryString?.split(" ") ?? [],
@@ -39,12 +39,12 @@ class DocumentOverviewWidget extends StatelessWidget {
DetailsItem.text(
DateFormat.yMMMMd().format(document.created),
context: context,
label: S.of(context).documentCreatedPropertyLabel,
label: S.of(context).createdAt,
).paddedOnly(bottom: itemSpacing),
Visibility(
visible: document.documentType != null,
child: DetailsItem(
label: S.of(context).documentDocumentTypePropertyLabel,
label: S.of(context).documentType,
content: LabelText<DocumentType>(
style: Theme.of(context).textTheme.bodyLarge,
id: document.documentType,
@@ -54,7 +54,7 @@ class DocumentOverviewWidget extends StatelessWidget {
Visibility(
visible: document.correspondent != null,
child: DetailsItem(
label: S.of(context).documentCorrespondentPropertyLabel,
label: S.of(context).correspondent,
content: LabelText<Correspondent>(
style: Theme.of(context).textTheme.bodyLarge,
id: document.correspondent,
@@ -64,7 +64,7 @@ class DocumentOverviewWidget extends StatelessWidget {
Visibility(
visible: document.storagePath != null,
child: DetailsItem(
label: S.of(context).documentStoragePathPropertyLabel,
label: S.of(context).storagePath,
content: StoragePathWidget(
pathId: document.storagePath,
),
@@ -73,7 +73,7 @@ class DocumentOverviewWidget extends StatelessWidget {
Visibility(
visible: document.tags.isNotEmpty,
child: DetailsItem(
label: S.of(context).documentTagsPropertyLabel,
label: S.of(context).tags,
content: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: TagsWidget(

View File

@@ -59,10 +59,10 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
floatingActionButton: FloatingActionButton.extended(
onPressed: () => _onSubmit(state.document),
icon: const Icon(Icons.save),
label: Text(S.of(context).genericActionUpdateLabel),
label: Text(S.of(context).saveChanges),
),
appBar: AppBar(
title: Text(S.of(context).documentEditPageTitle),
title: Text(S.of(context).editDocument),
bottom: _isSubmitLoading
? const PreferredSize(
preferredSize: Size.fromHeight(4),
@@ -159,7 +159,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
create: (context) => context.read<LabelRepository<StoragePath>>(),
child: AddStoragePathPage(initalValue: initialValue),
),
textFieldLabel: S.of(context).documentStoragePathPropertyLabel,
textFieldLabel: S.of(context).storagePath,
labelOptions: options,
initialValue: IdQueryParameter.fromId(initialId),
name: fkStoragePath,
@@ -180,7 +180,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
create: (context) => context.read<LabelRepository<Correspondent>>(),
child: AddCorrespondentPage(initialName: initialValue),
),
textFieldLabel: S.of(context).documentCorrespondentPropertyLabel,
textFieldLabel: S.of(context).correspondent,
labelOptions: options,
initialValue: IdQueryParameter.fromId(initialId),
name: fkCorrespondent,
@@ -214,7 +214,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
initialName: currentInput,
),
),
textFieldLabel: S.of(context).documentDocumentTypePropertyLabel,
textFieldLabel: S.of(context).documentType,
initialValue: IdQueryParameter.fromId(initialId),
labelOptions: options,
name: fkDocumentType,
@@ -249,7 +249,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
});
try {
await context.read<DocumentEditCubit>().updateDocument(mergedDocument);
showSnackBar(context, S.of(context).documentUpdateSuccessMessage);
showSnackBar(context, S.of(context).documentSuccessfullyUpdated);
} on PaperlessServerException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
} finally {
@@ -266,7 +266,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
name: fkTitle,
validator: FormBuilderValidators.required(),
decoration: InputDecoration(
label: Text(S.of(context).documentTitlePropertyLabel),
label: Text(S.of(context).title),
),
initialValue: initialTitle,
);
@@ -281,7 +281,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
name: fkCreatedDate,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.calendar_month_outlined),
label: Text(S.of(context).documentCreatedPropertyLabel),
label: Text(S.of(context).createdAt),
),
initialValue: initialCreatedAtDate,
format: DateFormat.yMMMMd(),
@@ -311,7 +311,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).documentEditPageSuggestionsLabel,
S.of(context).suggestions,
style: Theme.of(context).textTheme.bodySmall,
),
SizedBox(

View File

@@ -72,7 +72,7 @@ class _ScannerPageState extends State<ScannerPage>
state.isEmpty ? const NeverScrollableScrollPhysics() : null,
slivers: [
SearchAppBar(
hintText: S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
bottom: PreferredSize(
child: _buildActions(connectedState.isConnected),
@@ -97,7 +97,7 @@ class _ScannerPageState extends State<ScannerPage>
floatHeaderSlivers: false,
headerSliverBuilder: (context, innerBoxIsScrolled) => [
SearchAppBar(
hintText: S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
bottom: PreferredSize(
child: _buildActions(connectedState.isConnected),
@@ -134,7 +134,7 @@ class _ScannerPageState extends State<ScannerPage>
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return TextButton.icon(
label: Text(S.of(context).scannerPagePreviewLabel),
label: Text(S.of(context).previewScan),
onPressed: state.isNotEmpty
? () => Navigator.of(context).push(
MaterialPageRoute(
@@ -154,7 +154,7 @@ class _ScannerPageState extends State<ScannerPage>
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return TextButton.icon(
label: Text(S.of(context).scannerPageClearAllLabel),
label: Text(S.of(context).clearAll),
onPressed: state.isEmpty ? null : () => _reset(context),
icon: const Icon(Icons.delete_sweep_outlined),
);
@@ -163,7 +163,7 @@ class _ScannerPageState extends State<ScannerPage>
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return TextButton.icon(
label: Text(S.of(context).scannerPageUploadLabel),
label: Text(S.of(context).upload),
onPressed: state.isEmpty || !isConnected
? null
: () => _onPrepareDocumentUpload(context),
@@ -176,55 +176,6 @@ class _ScannerPageState extends State<ScannerPage>
);
}
AppBar _buildAppBar(BuildContext context, bool isConnected) {
return AppBar(
title: Text(S.of(context).documentScannerPageTitle),
bottom: !isConnected ? const OfflineBanner() : null,
actions: [
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return IconButton(
onPressed: state.isNotEmpty
? () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => DocumentView(
documentBytes: _assembleFileBytes(
state,
forcePdf: true,
).then((file) => file.bytes),
),
),
)
: null,
icon: const Icon(Icons.visibility),
tooltip: S.of(context).documentScannerPageResetButtonTooltipText,
);
},
),
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return IconButton(
onPressed: state.isEmpty ? null : () => _reset(context),
icon: const Icon(Icons.delete_sweep),
tooltip: S.of(context).documentScannerPageResetButtonTooltipText,
);
},
),
BlocBuilder<DocumentScannerCubit, List<File>>(
builder: (context, state) {
return IconButton(
onPressed: state.isEmpty || !isConnected
? null
: () => _onPrepareDocumentUpload(context),
icon: const Icon(Icons.done),
tooltip: S.of(context).documentScannerPageUploadButtonTooltip,
);
},
),
],
);
}
void _openDocumentScanner(BuildContext context) async {
final isGranted = await askForPermission(Permission.camera);
if (!isGranted) {
@@ -296,19 +247,16 @@ class _ScannerPageState extends State<ScannerPage>
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).documentScannerPageEmptyStateText,
S.of(context).noDocumentsScannedYet,
textAlign: TextAlign.center,
),
TextButton(
child:
Text(S.of(context).documentScannerPageAddScanButtonLabel),
child: Text(S.of(context).scanADocument),
onPressed: () => _openDocumentScanner(context),
),
Text(S.of(context).documentScannerPageOrText),
Text(S.of(context).or),
TextButton(
child: Text(S
.of(context)
.documentScannerPageUploadFromThisDeviceButtonLabel),
child: Text(S.of(context).uploadADocumentFromThisDevice),
onPressed: isConnected ? _onUploadFromFilesystem : null,
),
],

View File

@@ -112,7 +112,7 @@ class _ScannedImageItemState extends State<ScannedImageItem> {
builder: (context) => Scaffold(
appBar: AppBar(
title: Text(
"${S.of(context).scannerPageImagePreviewTitle} ${widget.index + 1}/${widget.totalNumberOfFiles}"),
"${S.of(context).scan} ${widget.index + 1}/${widget.totalNumberOfFiles}"),
),
body: PhotoView(imageProvider: FileImage(widget.file)),
),

View File

@@ -60,7 +60,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
hintStyle: theme.textTheme.bodyLarge?.apply(
color: theme.colorScheme.onSurfaceVariant,
),
hintText: S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
border: InputBorder.none,
),
controller: _queryController,
@@ -181,7 +181,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
Widget _buildResultsView(DocumentSearchState state) {
final header = Text(
S.of(context).documentSearchResults,
S.of(context).results,
style: Theme.of(context).textTheme.labelSmall,
).padded();
return CustomScrollView(
@@ -190,7 +190,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
if (state.hasLoaded && !state.isLoading && state.documents.isEmpty)
SliverToBoxAdapter(
child: Center(
child: Text(S.of(context).documentSearchNoMatchesFound),
child: Text(S.of(context).noMatchesFound),
),
)
else

View File

@@ -10,11 +10,11 @@ class RemoveHistoryEntryDialog extends StatelessWidget {
Widget build(BuildContext context) {
return AlertDialog(
title: Text(entry),
content: Text(S.of(context).documentSearchRemoveHistoryEntryText),
content: Text(S.of(context).removeQueryFromSearchHistory),
actions: [
const DialogCancelButton(),
TextButton(
child: Text(S.of(context).genericActionRemoveLabel),
child: Text(S.of(context).remove),
onPressed: () {
Navigator.pop(context, true);
},

View File

@@ -62,7 +62,7 @@ class _DocumentUploadPreparationPageState
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(
title: Text(S.of(context).documentsUploadPageTitle),
title: Text(S.of(context).prepareDocument),
bottom: _isUploadLoading
? const PreferredSize(
child: LinearProgressIndicator(),
@@ -73,7 +73,7 @@ class _DocumentUploadPreparationPageState
visible: MediaQuery.of(context).viewInsets.bottom == 0,
child: FloatingActionButton.extended(
onPressed: _onSubmit,
label: Text(S.of(context).genericActionUploadLabel),
label: Text(S.of(context).upload),
icon: const Icon(Icons.upload),
),
),
@@ -91,7 +91,7 @@ class _DocumentUploadPreparationPageState
widget.title ?? "scan_${fileNameDateFormat.format(_now)}",
validator: FormBuilderValidators.required(),
decoration: InputDecoration(
labelText: S.of(context).documentTitlePropertyLabel,
labelText: S.of(context).title,
suffixIcon: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
@@ -121,7 +121,7 @@ class _DocumentUploadPreparationPageState
enabled: !_syncTitleAndFilename,
name: fkFileName,
decoration: InputDecoration(
labelText: S.of(context).documentUploadFileNameLabel,
labelText: S.of(context).fileName,
suffixText: widget.fileExtension,
suffixIcon: IconButton(
icon: const Icon(Icons.clear),
@@ -151,9 +151,7 @@ class _DocumentUploadPreparationPageState
}
},
title: Text(
S
.of(context)
.documentUploadPageSynchronizeTitleAndFilenameLabel,
S.of(context).synchronizeTitleAndFilename,
),
),
// Created at
@@ -168,8 +166,7 @@ class _DocumentUploadPreparationPageState
},
decoration: InputDecoration(
prefixIcon: const Icon(Icons.calendar_month_outlined),
labelText:
S.of(context).documentCreatedPropertyLabel + " *",
labelText: S.of(context).createdAt + " *",
suffixIcon: _showDatePickerDeleteIcon
? IconButton(
icon: const Icon(Icons.close),
@@ -192,8 +189,7 @@ class _DocumentUploadPreparationPageState
context.read<LabelRepository<Correspondent>>(),
child: AddCorrespondentPage(initialName: initialName),
),
textFieldLabel:
S.of(context).documentCorrespondentPropertyLabel + " *",
textFieldLabel: S.of(context).correspondent + " *",
name: DocumentModel.correspondentKey,
labelOptions: state.correspondents,
prefixIcon: const Icon(Icons.person_outline),
@@ -208,8 +204,7 @@ class _DocumentUploadPreparationPageState
context.read<LabelRepository<DocumentType>>(),
child: AddDocumentTypePage(initialName: initialName),
),
textFieldLabel:
S.of(context).documentDocumentTypePropertyLabel + " *",
textFieldLabel: S.of(context).documentType + " *",
name: DocumentModel.documentTypeKey,
labelOptions: state.documentTypes,
prefixIcon: const Icon(Icons.description_outlined),
@@ -223,10 +218,7 @@ class _DocumentUploadPreparationPageState
//Label: "Tags" + " *",
),
Text(
"* " +
S
.of(context)
.uploadPageAutomaticallInferredFieldsHintText,
"* " + S.of(context).uploadInferValuesHint,
style: Theme.of(context).textTheme.bodySmall,
),
SizedBox(height: 300),
@@ -265,7 +257,8 @@ class _DocumentUploadPreparationPageState
tags: tags.ids,
createdAt: createdAt,
);
showSnackBar(context, S.of(context).documentUploadSuccessText);
showSnackBar(
context, S.of(context).documentSuccessfullyUploadedProcessing);
Navigator.pop(context, taskId);
} on PaperlessServerException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);

View File

@@ -32,7 +32,7 @@ class _DocumentViewState extends State<DocumentView> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).documentPreviewPageTitle),
title: Text(S.of(context).preview),
),
body: PdfView(
builders: PdfViewBuilders<DefaultBuilderOptions>(

View File

@@ -112,11 +112,9 @@ class _DocumentsPageState extends State<DocumentsPage>
listener: (context, state) {
showSnackBar(
context,
S.of(context).documentsPageNewDocumentAvailableText,
S.of(context).newDocumentAvailable,
action: SnackBarActionConfig(
label: S
.of(context)
.documentUploadProcessingSuccessfulReloadActionText,
label: S.of(context).reload,
onPressed: () {
context.read<TaskStatusCubit>().acknowledgeCurrentTask();
context.read<DocumentsCubit>().reload();
@@ -202,7 +200,7 @@ class _DocumentsPageState extends State<DocumentsPage>
.resetSelection(),
),
title: Text(
"${state.selection.length} ${S.of(context).documentsSelectedText}",
"${state.selection.length} ${S.of(context).countSelected}",
),
actions: [
IconButton(
@@ -213,14 +211,13 @@ class _DocumentsPageState extends State<DocumentsPage>
);
}
return SearchAppBar(
hintText:
S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
bottom: TabBar(
controller: _tabController,
tabs: [
Tab(text: S.of(context).documentsPageTitle),
Tab(text: S.of(context).savedViewsLabel),
Tab(text: S.of(context).documents),
Tab(text: S.of(context).views),
],
),
);
@@ -296,7 +293,7 @@ class _DocumentsPageState extends State<DocumentsPage>
_nestedScrollViewKey.currentState?.outerController.jumpTo(0);
},
label: Text(
S.of(context).scrollToTopLabel,
S.of(context).scrollToTop,
style: DefaultTextStyle.of(context).style.apply(
color: Theme.of(context).colorScheme.onPrimary,
),
@@ -411,7 +408,7 @@ class _DocumentsPageState extends State<DocumentsPage>
.bulkDelete(documentsState.selection);
showSnackBar(
context,
S.of(context).documentsPageBulkDeleteSuccessfulText,
S.of(context).documentsSuccessfullyDeleted,
);
context.read<DocumentsCubit>().resetSelection();
} on PaperlessServerException catch (error, stackTrace) {

View File

@@ -9,12 +9,12 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(S.of(context).documentsPageSelectionBulkDeleteDialogTitle),
title: Text(S.of(context).confirmDeletion),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogWarningTextOne,
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(1),
),
const SizedBox(height: 16),
Text(
@@ -26,14 +26,13 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
),
),
const SizedBox(height: 16),
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogContinueText),
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
style: ButtonStyle(
@@ -43,7 +42,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
onPressed: () {
Navigator.pop(context, true);
},
child: Text(S.of(context).genericActionDeleteLabel),
child: Text(S.of(context).delete),
),
],
);

View File

@@ -18,13 +18,13 @@ class DocumentsEmptyState extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: EmptyState(
title: S.of(context).documentsPageEmptyStateOopsText,
subtitle: S.of(context).documentsPageEmptyStateNothingHereText,
title: S.of(context).oops,
subtitle: S.of(context).thereSeemsToBeNothingHere,
bottomChild: state.filter != DocumentFilter.initial && onReset != null
? TextButton(
onPressed: onReset,
child: Text(
S.of(context).documentsEmptyStateResetFilterLabel,
S.of(context).resetFilter,
),
).padded()
: null,

View File

@@ -96,14 +96,14 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
Align(
alignment: Alignment.centerLeft,
child: Text(
S.of(context).documentFilterAdvancedLabel,
S.of(context).advanced,
style: Theme.of(context).textTheme.bodySmall,
),
),
FormBuilderExtendedDateRangePicker(
name: DocumentFilterForm.fkCreatedAt,
initialValue: widget.initialFilter.created,
labelText: S.of(context).documentCreatedPropertyLabel,
labelText: S.of(context).createdAt,
onChanged: (_) {
_checkQueryConstraints();
},
@@ -111,7 +111,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
FormBuilderExtendedDateRangePicker(
name: DocumentFilterForm.fkAddedAt,
initialValue: widget.initialFilter.added,
labelText: S.of(context).documentAddedPropertyLabel,
labelText: S.of(context).addedAt,
onChanged: (_) {
_checkQueryConstraints();
},
@@ -151,7 +151,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkDocumentType,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentDocumentTypePropertyLabel,
textFieldLabel: S.of(context).documentType,
initialValue: widget.initialFilter.documentType,
prefixIcon: const Icon(Icons.description_outlined),
);
@@ -166,7 +166,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkCorrespondent,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentCorrespondentPropertyLabel,
textFieldLabel: S.of(context).correspondent,
initialValue: widget.initialFilter.correspondent,
prefixIcon: const Icon(Icons.person_outline),
);
@@ -181,7 +181,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkStoragePath,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentStoragePathPropertyLabel,
textFieldLabel: S.of(context).storagePath,
initialValue: widget.initialFilter.storagePath,
prefixIcon: const Icon(Icons.folder_outlined),
);

View File

@@ -74,7 +74,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
visible: MediaQuery.of(context).viewInsets.bottom == 0,
child: FloatingActionButton.extended(
icon: const Icon(Icons.done),
label: Text(S.of(context).documentFilterApplyFilterLabel),
label: Text(S.of(context).apply),
onPressed: _onApplyFilter,
),
),
@@ -85,7 +85,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
TextButton.icon(
onPressed: _resetFilter,
icon: const Icon(Icons.refresh),
label: Text(S.of(context).documentFilterResetLabel),
label: Text(S.of(context).reset),
),
],
),
@@ -133,7 +133,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
),
Padding(
padding: EdgeInsets.only(left: _heightAnimationValue * 48),
child: Text(S.of(context).documentFilterTitle),
child: Text(S.of(context).filterDocuments),
),
],
),

View File

@@ -48,12 +48,12 @@ class _SortFieldSelectionBottomSheetState
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).documentsPageOrderByLabel,
S.of(context).orderBy,
style: Theme.of(context).textTheme.bodySmall,
textAlign: TextAlign.start,
),
TextButton(
child: Text(S.of(context).documentFilterApplyFilterLabel),
child: Text(S.of(context).apply),
onPressed: () {
widget.onSubmit(
_currentSortField,
@@ -105,12 +105,12 @@ class _SortFieldSelectionBottomSheetState
ButtonSegment(
icon: const FaIcon(FontAwesomeIcons.arrowDownAZ),
value: SortOrder.descending,
label: Text(S.of(context).sortDocumentDescending),
label: Text(S.of(context).descending),
),
ButtonSegment(
icon: const FaIcon(FontAwesomeIcons.arrowUpZA),
value: SortOrder.ascending,
label: Text(S.of(context).sortDocumentAscending),
label: Text(S.of(context).ascending),
),
],
emptySelectionAllowed: false,

View File

@@ -63,20 +63,19 @@ class TextQueryFormField extends StatelessWidget {
itemBuilder: (context) => [
PopupMenuItem(
child: ListTile(
title: Text(
S.of(context).documentFilterQueryOptionsTitleAndContentLabel),
title: Text(S.of(context).titleAndContent),
),
value: QueryType.titleAndContent,
),
PopupMenuItem(
child: ListTile(
title: Text(S.of(context).documentFilterQueryOptionsTitleLabel),
title: Text(S.of(context).title),
),
value: QueryType.title,
),
PopupMenuItem(
child: ListTile(
title: Text(S.of(context).documentFilterQueryOptionsExtendedLabel),
title: Text(S.of(context).extended),
),
value: QueryType.extended,
),
@@ -90,11 +89,11 @@ class TextQueryFormField extends StatelessWidget {
String _buildLabelText(BuildContext context, QueryType queryType) {
switch (queryType) {
case QueryType.title:
return S.of(context).documentFilterQueryOptionsTitleLabel;
return S.of(context).title;
case QueryType.titleAndContent:
return S.of(context).documentFilterQueryOptionsTitleAndContentLabel;
return S.of(context).titleAndContent;
case QueryType.extended:
return S.of(context).documentFilterQueryOptionsExtendedLabel;
return S.of(context).extended;
default:
return '';
}

View File

@@ -14,31 +14,24 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
Widget build(BuildContext context) {
assert(state.selection.isNotEmpty);
return AlertDialog(
title: Text(S.of(context).documentsPageSelectionBulkDeleteDialogTitle),
title: Text(S.of(context).confirmDeletion),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
//TODO: use plurals, didn't use because of crash... investigate later.
state.selection.length == 1
? S
.of(context)
.documentsPageSelectionBulkDeleteDialogWarningTextOne
: S
.of(context)
.documentsPageSelectionBulkDeleteDialogWarningTextMany,
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(
state.selection.length),
),
const SizedBox(height: 16),
...state.selection.map(_buildBulletPoint).toList(),
const SizedBox(height: 16),
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogContinueText),
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
style: ButtonStyle(
@@ -48,7 +41,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
onPressed: () {
Navigator.pop(context, true);
},
child: Text(S.of(context).genericActionDeleteLabel),
child: Text(S.of(context).delete),
),
],
);

View File

@@ -14,18 +14,18 @@ class ConfirmDeleteSavedViewDialog extends StatelessWidget {
Widget build(BuildContext context) {
return AlertDialog(
title: Text(
S.of(context).deleteViewDialogTitleText + view.name + "?",
S.of(context).deleteView + view.name + "?",
softWrap: true,
),
content: Text(S.of(context).deleteViewDialogContentText),
content: Text(S.of(context).doYouReallyWantToDeleteThisView),
actions: [
TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: () => Navigator.pop(context, false),
),
TextButton(
child: Text(
S.of(context).genericActionDeleteLabel,
S.of(context).delete,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
onPressed: () => Navigator.pop(context, true),

View File

@@ -34,19 +34,19 @@ class ViewTypeSelectionWidget extends StatelessWidget {
_buildViewTypeOption(
context,
type: ViewType.list,
label: S.of(context).viewTypeListOption,
label: S.of(context).list,
icon: Icons.list,
),
_buildViewTypeOption(
context,
type: ViewType.grid,
label: S.of(context).viewTypeGridOption,
label: S.of(context).grid,
icon: Icons.grid_view_rounded,
),
_buildViewTypeOption(
context,
type: ViewType.detailed,
label: S.of(context).viewTypeDetailedOption,
label: S.of(context).detailed,
icon: Icons.article_outlined,
),
],

View File

@@ -62,7 +62,7 @@ class AddLabelFormWidget<T extends Label> extends StatelessWidget {
fromJsonT: fromJsonT,
submitButtonConfig: SubmitButtonConfig<T>(
icon: const Icon(Icons.add),
label: Text(S.of(context).genericActionCreateLabel),
label: Text(S.of(context).create),
onSubmit: context.read<EditLabelCubit<T>>().create,
),
additionalFields: additionalFields,

View File

@@ -55,7 +55,7 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).genericActionEditLabel),
title: Text(S.of(context).edit),
actions: [
IconButton(
onPressed: () => _onDelete(context),
@@ -68,7 +68,7 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
fromJsonT: fromJsonT,
submitButtonConfig: SubmitButtonConfig<T>(
icon: const Icon(Icons.save),
label: Text(S.of(context).genericActionUpdateLabel),
label: Text(S.of(context).saveChanges),
onSubmit: context.read<EditLabelCubit<T>>().update,
),
additionalFields: additionalFields,
@@ -81,22 +81,21 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
final shouldDelete = await showDialog<bool>(
context: context,
builder: (context) => AlertDialog(
title:
Text(S.of(context).editLabelPageConfirmDeletionDialogTitle),
title: Text(S.of(context).confirmDeletion),
content: Text(
S.of(context).editLabelPageDeletionDialogText,
S.of(context).deleteLabelWarningText,
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
onPressed: () {
Navigator.pop(context, true);
},
child: Text(
S.of(context).genericActionDeleteLabel,
S.of(context).delete,
style:
TextStyle(color: Theme.of(context).colorScheme.error),
),

View File

@@ -18,7 +18,7 @@ class AddCorrespondentPage extends StatelessWidget {
context.read<LabelRepository<Correspondent>>(),
),
child: AddLabelPage<Correspondent>(
pageTitle: Text(S.of(context).addCorrespondentPageTitle),
pageTitle: Text(S.of(context).addCorrespondent),
fromJsonT: Correspondent.fromJson,
initialName: initialName,
),

View File

@@ -21,7 +21,7 @@ class AddDocumentTypePage extends StatelessWidget {
context.read<LabelRepository<DocumentType>>(),
),
child: AddLabelPage<DocumentType>(
pageTitle: Text(S.of(context).addDocumentTypePageTitle),
pageTitle: Text(S.of(context).addDocumentType),
fromJsonT: DocumentType.fromJson,
initialName: initialName,
),

View File

@@ -19,7 +19,7 @@ class AddStoragePathPage extends StatelessWidget {
context.read<LabelRepository<StoragePath>>(),
),
child: AddLabelPage<StoragePath>(
pageTitle: Text(S.of(context).addStoragePathPageTitle),
pageTitle: Text(S.of(context).addStoragePath),
fromJsonT: StoragePath.fromJson,
initialName: initalValue,
additionalFields: const [

View File

@@ -22,7 +22,7 @@ class AddTagPage extends StatelessWidget {
context.read<LabelRepository<Tag>>(),
),
child: AddLabelPage<Tag>(
pageTitle: Text(S.of(context).addTagPageTitle),
pageTitle: Text(S.of(context).addTag),
fromJsonT: Tag.fromJson,
initialName: initialValue,
additionalFields: [
@@ -30,7 +30,7 @@ class AddTagPage extends StatelessWidget {
name: Tag.colorKey,
valueTransformer: (color) => "#${color?.value.toRadixString(16)}",
decoration: InputDecoration(
label: Text(S.of(context).tagColorPropertyLabel),
label: Text(S.of(context).color),
),
colorPickerType: ColorPickerType.materialPicker,
initialValue: Color((Random().nextDouble() * 0xFFFFFF).toInt())
@@ -38,7 +38,7 @@ class AddTagPage extends StatelessWidget {
),
FormBuilderCheckbox(
name: Tag.isInboxTagKey,
title: Text(S.of(context).tagInboxTagPropertyLabel),
title: Text(S.of(context).inboxTag),
),
],
),

View File

@@ -28,14 +28,14 @@ class EditTagPage extends StatelessWidget {
initialValue: tag.color,
name: Tag.colorKey,
decoration: InputDecoration(
label: Text(S.of(context).tagColorPropertyLabel),
label: Text(S.of(context).color),
),
colorPickerType: ColorPickerType.blockPicker,
),
FormBuilderCheckbox(
initialValue: tag.isInboxTag,
name: Tag.isInboxTagKey,
title: Text(S.of(context).tagInboxTagPropertyLabel),
title: Text(S.of(context).inboxTag),
),
],
),

View File

@@ -75,7 +75,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
FormBuilderTextField(
name: Label.nameKey,
decoration: InputDecoration(
labelText: S.of(context).labelNamePropertyLabel,
labelText: S.of(context).name,
errorText: _errors[Label.nameKey],
),
validator: FormBuilderValidators.required(),
@@ -88,7 +88,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
MatchingAlgorithm.defaultValue)
.value,
decoration: InputDecoration(
labelText: S.of(context).labelMatchingAlgorithmPropertyLabel,
labelText: S.of(context).matchingAlgorithm,
errorText: _errors[Label.matchingAlgorithmKey],
),
onChanged: (val) {
@@ -112,7 +112,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
FormBuilderTextField(
name: Label.matchKey,
decoration: InputDecoration(
labelText: S.of(context).labelMatchPropertyLabel,
labelText: S.of(context).match,
errorText: _errors[Label.matchKey],
),
initialValue: widget.initialValue?.match,
@@ -121,7 +121,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
FormBuilderCheckbox(
name: Label.isInsensitiveKey,
initialValue: widget.initialValue?.isInsensitive ?? true,
title: Text(S.of(context).labelIsInsensivitePropertyLabel),
title: Text(S.of(context).caseIrrelevant),
),
...widget.additionalFields,
].padded(),

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),

View File

@@ -52,7 +52,7 @@ class _InboxPageState extends State<InboxPage>
return const SizedBox.shrink();
}
return FloatingActionButton.extended(
label: Text(S.of(context).inboxPageMarkAllAsSeenLabel),
label: Text(S.of(context).allSeen),
icon: const Icon(Icons.done_all),
onPressed: state.hasLoaded && state.documents.isNotEmpty
? () => _onMarkAllAsSeen(
@@ -128,7 +128,7 @@ class _InboxPageState extends State<InboxPage>
controller: pagingScrollController,
slivers: [
SearchAppBar(
hintText: S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
),
if (state.documents.isEmpty)
@@ -149,7 +149,8 @@ class _InboxPageState extends State<InboxPage>
SliverToBoxAdapter(
child: HintCard(
show: !state.isHintAcknowledged,
hintText: S.of(context).inboxPageUsageHintText,
hintText:
S.of(context).swipeLeftToMarkADocumentAsSeen,
onHintAcknowledged: () =>
context.read<InboxCubit>().acknowledgeHint(),
),
@@ -177,7 +178,7 @@ class _InboxPageState extends State<InboxPage>
color: Theme.of(context).colorScheme.primary,
).padded(),
Text(
S.of(context).inboxPageMarkAsSeenText,
S.of(context).markAsSeen,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
@@ -197,21 +198,19 @@ class _InboxPageState extends State<InboxPage>
final isActionConfirmed = await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(S
.of(context)
.inboxPageMarkAllAsSeenConfirmationDialogTitleText),
title: Text(S.of(context).markAllAsSeen),
content: Text(
S.of(context).inboxPageMarkAllAsSeenConfirmationDialogText,
S.of(context).areYouSureYouWantToMarkAllDocumentsAsSeen,
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: Text(
S.of(context).genericActionOkLabel,
S.of(context).ok,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
),
@@ -229,9 +228,9 @@ class _InboxPageState extends State<InboxPage>
final removedTags = await context.read<InboxCubit>().removeFromInbox(doc);
showSnackBar(
context,
S.of(context).inboxPageDocumentRemovedMessageText,
S.of(context).removeDocumentFromInbox,
action: SnackBarActionConfig(
label: S.of(context).inboxPageUndoRemoveText,
label: S.of(context).undo,
onPressed: () => _onUndoMarkAsSeen(doc, removedTags),
),
);
@@ -268,10 +267,10 @@ class _InboxPageState extends State<InboxPage>
documents,
(doc) {
if (doc.added.isToday) {
return S.of(context).inboxPageTodayText;
return S.of(context).today;
}
if (doc.added.isYesterday) {
return S.of(context).inboxPageYesterdayText;
return S.of(context).yesterday;
}
return DateFormat.yMMMMd().format(doc.added);
},

View File

@@ -23,11 +23,11 @@ class InboxEmptyWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(S.of(context).inboxPageNoNewDocumentsText),
Text(S.of(context).youDoNotHaveUnseenDocuments),
TextButton(
onPressed: () =>
_emptyStateRefreshIndicatorKey.currentState?.show(),
child: Text(S.of(context).inboxPageNoNewDocumentsRefreshLabel),
child: Text(S.of(context).refresh),
),
],
),

View File

@@ -99,7 +99,7 @@ class _InboxItemState extends State<InboxItem> {
child: ActionChip(
avatar: const Icon(Icons.delete_outline),
shape: chipShape,
label: Text(S.of(context).inboxActionDeleteDocument),
label: Text(S.of(context).deleteDocument),
onPressed: () async {
final shouldDelete = await showDialog<bool>(
context: context,
@@ -147,7 +147,7 @@ class _InboxItemState extends State<InboxItem> {
maxWidth: 50,
),
child: Text(
S.of(context).inboxPageQuickActionsLabel,
S.of(context).quickAction,
textAlign: TextAlign.center,
maxLines: 3,
style: Theme.of(context).textTheme.labelSmall,
@@ -190,9 +190,9 @@ class _InboxItemState extends State<InboxItem> {
shape: chipShape,
label: hasAsn
? Text(
'${S.of(context).documentArchiveSerialNumberPropertyShortLabel} #${widget.document.archiveSerialNumber}',
'${S.of(context).asn} #${widget.document.archiveSerialNumber}',
)
: Text(S.of(context).inboxActionAssignAsn),
: Text(S.of(context).assignASN),
onPressed: !hasAsn
? () {
setState(() {
@@ -294,7 +294,7 @@ class _InboxItemState extends State<InboxItem> {
// context,
// S
// .of(context)
// .inboxPageSuggestionSuccessfullyAppliedMessage));
// .suggestionSuccessfullyApplied));
// },
// ),
// )
@@ -316,7 +316,7 @@ class _InboxItemState extends State<InboxItem> {
// context,
// S
// .of(context)
// .inboxPageSuggestionSuccessfullyAppliedMessage)),
// .suggestionSuccessfullyApplied)),
// ),
// )
// .toList(),
@@ -340,7 +340,7 @@ class _InboxItemState extends State<InboxItem> {
// context,
// S
// .of(context)
// .inboxPageSuggestionSuccessfullyAppliedMessage));
// .suggestionSuccessfullyApplied));
// },
// ),
// )
@@ -352,7 +352,7 @@ class _InboxItemState extends State<InboxItem> {
// avatar: const Icon(Icons.calendar_today_outlined),
// shape: chipShape,
// label: Text(
// "${S.of(context).documentCreatedPropertyLabel}: ${DateFormat.yMd().format(e)}",
// "${S.of(context).createdAt}: ${DateFormat.yMd().format(e)}",
// ),
// onPressed: () => context
// .read<InboxCubit>()
@@ -364,7 +364,7 @@ class _InboxItemState extends State<InboxItem> {
// context,
// S
// .of(context)
// .inboxPageSuggestionSuccessfullyAppliedMessage)),
// .suggestionSuccessfullyApplied)),
// ),
// )
// .toList(),

View File

@@ -48,7 +48,7 @@ class _StoragePathAutofillFormBuilderFieldState
controller: _textEditingController,
validator: FormBuilderValidators.required(), //TODO: INTL
decoration: InputDecoration(
label: Text(S.of(context).documentStoragePathPropertyLabel),
label: Text(S.of(context).storagePath),
suffixIcon: _showClearIcon
? IconButton(
icon: const Icon(Icons.clear),
@@ -69,67 +69,65 @@ class _StoragePathAutofillFormBuilderFieldState
runSpacing: 4.0,
children: [
InputChip(
label: Text(S
.of(context)
.documentArchiveSerialNumberPropertyLongLabel),
label: Text(S.of(context).archiveSerialNumber),
onPressed: () => _addParameterToInput("{asn}", field),
),
InputChip(
label: Text(S.of(context).documentCorrespondentPropertyLabel),
label: Text(S.of(context).correspondent),
onPressed: () =>
_addParameterToInput("{correspondent}", field),
),
InputChip(
label: Text(S.of(context).documentDocumentTypePropertyLabel),
label: Text(S.of(context).documentType),
onPressed: () =>
_addParameterToInput("{document_type}", field),
),
InputChip(
label: Text(S.of(context).documentTagsPropertyLabel),
label: Text(S.of(context).tags),
onPressed: () => _addParameterToInput("{tag_list}", field),
),
InputChip(
label: Text(S.of(context).documentTitlePropertyLabel),
label: Text(S.of(context).title),
onPressed: () => _addParameterToInput("{title}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel),
label: Text(S.of(context).createdAt),
onPressed: () => _addParameterToInput("{created}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterYearLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathYear})"),
onPressed: () =>
_addParameterToInput("{created_year}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterMonthLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathMonth})"),
onPressed: () =>
_addParameterToInput("{created_month}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterDayLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathDay})"),
onPressed: () => _addParameterToInput("{created_day}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel),
label: Text(S.of(context).createdAt),
onPressed: () => _addParameterToInput("{added}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterYearLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathYear})"),
onPressed: () => _addParameterToInput("{added_year}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterMonthLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathMonth})"),
onPressed: () => _addParameterToInput("{added_month}", field),
),
InputChip(
label: Text(S.of(context).documentCreatedPropertyLabel +
" (${S.of(context).storagePathParameterDayLabel})"),
label: Text(S.of(context).createdAt +
" (${S.of(context).storagePathDay})"),
onPressed: () => _addParameterToInput("{added_day}", field),
),
],

View File

@@ -94,8 +94,8 @@ class _TagFormFieldState extends State<TagFormField> {
Icons.label_outline,
),
suffixIcon: _buildSuffixIcon(context, field),
labelText: S.of(context).documentTagsPropertyLabel,
hintText: S.of(context).tagFormFieldSearchHintText,
labelText: S.of(context).tags,
hintText: S.of(context).filterTags,
),
controller: _textEditingController,
),
@@ -138,10 +138,10 @@ class _TagFormFieldState extends State<TagFormField> {
late String? title;
switch (data) {
case _onlyNotAssignedId:
title = S.of(context).labelNotAssignedText;
title = S.of(context).notAssigned;
break;
case _anyAssignedId:
title = S.of(context).labelAnyAssignedText;
title = S.of(context).anyAssigned;
break;
default:
title = widget.selectableOptions[data]?.name;
@@ -270,7 +270,7 @@ class _TagFormFieldState extends State<TagFormField> {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
side: BorderSide.none,
label: Text(
S.of(context).labelNotAssignedText,
S.of(context).notAssigned,
),
backgroundColor:
Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
@@ -323,7 +323,7 @@ class _TagFormFieldState extends State<TagFormField> {
padding: const EdgeInsets.all(4),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
side: BorderSide.none,
label: Text(S.of(context).labelAnyAssignedText),
label: Text(S.of(context).anyAssigned),
backgroundColor:
Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.12),
onDeleted: () => field.didChange(const IdsTagsQuery()),

View File

@@ -72,7 +72,7 @@ class _LabelsPageState extends State<LabelsPage>
context,
),
sliver: SearchAppBar(
hintText: S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
bottom: TabBar(
controller: _tabController,
@@ -160,12 +160,10 @@ class _LabelsPageState extends State<LabelsPage>
pageSize: label.documentCount ?? 0,
),
onEdit: _openEditCorrespondentPage,
emptyStateActionButtonLabel: S
.of(context)
.labelsPageCorrespondentEmptyStateAddNewLabel,
emptyStateDescription: S
.of(context)
.labelsPageCorrespondentEmptyStateDescriptionText,
emptyStateActionButtonLabel:
S.of(context).addNewCorrespondent,
emptyStateDescription:
S.of(context).noCorrespondentsSetUp,
onAddNew: _openAddCorrespondentPage,
),
],
@@ -187,12 +185,10 @@ class _LabelsPageState extends State<LabelsPage>
pageSize: label.documentCount ?? 0,
),
onEdit: _openEditDocumentTypePage,
emptyStateActionButtonLabel: S
.of(context)
.labelsPageDocumentTypeEmptyStateAddNewLabel,
emptyStateDescription: S
.of(context)
.labelsPageDocumentTypeEmptyStateDescriptionText,
emptyStateActionButtonLabel:
S.of(context).addNewDocumentType,
emptyStateDescription:
S.of(context).noDocumentTypesSetUp,
onAddNew: _openAddDocumentTypePage,
),
],
@@ -222,12 +218,10 @@ class _LabelsPageState extends State<LabelsPage>
)
: null,
),
emptyStateActionButtonLabel: S
.of(context)
.labelsPageTagsEmptyStateAddNewLabel,
emptyStateDescription: S
.of(context)
.labelsPageTagsEmptyStateDescriptionText,
emptyStateActionButtonLabel:
S.of(context).addNewTag,
emptyStateDescription:
S.of(context).noTagsSetUp,
onAddNew: _openAddTagPage,
),
],
@@ -250,12 +244,10 @@ class _LabelsPageState extends State<LabelsPage>
pageSize: label.documentCount ?? 0,
),
contentBuilder: (path) => Text(path.path),
emptyStateActionButtonLabel: S
.of(context)
.labelsPageStoragePathEmptyStateAddNewLabel,
emptyStateDescription: S
.of(context)
.labelsPageStoragePathEmptyStateDescriptionText,
emptyStateActionButtonLabel:
S.of(context).addNewStoragePath,
emptyStateDescription:
S.of(context).noStoragePathsSetUp,
onAddNew: _openAddStoragePathPage,
),
],

View File

@@ -79,7 +79,7 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
noItemsFoundBuilder: (context) => Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Text(
S.of(context).labelFormFieldNoItemsFoundText,
S.of(context).noItemsFound,
textAlign: TextAlign.center,
style:
TextStyle(color: Theme.of(context).disabledColor, fontSize: 18.0),
@@ -97,8 +97,7 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
),
itemBuilder: (context, suggestion) => ListTile(
title: Text(
widget.labelOptions[suggestion.id]?.name ??
S.of(context).labelNotAssignedText,
widget.labelOptions[suggestion.id]?.name ?? S.of(context).notAssigned,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -142,7 +141,7 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
),
selectionToTextTransformer: (suggestion) {
if (suggestion == const IdQueryParameter.notAssigned()) {
return S.of(context).labelNotAssignedText;
return S.of(context).notAssigned;
}
return widget.labelOptions[suggestion.id]?.name ?? "";
},
@@ -195,11 +194,11 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
String _getLocalizedHint(BuildContext context) {
if (T == Correspondent) {
return S.of(context).correspondentFormFieldSearchHintText;
return S.of(context).startTyping;
} else if (T == DocumentType) {
return S.of(context).documentTypeFormFieldSearchHintText;
return S.of(context).startTyping;
} else {
return S.of(context).tagFormFieldSearchHintText;
return S.of(context).filterTags;
}
}
}

View File

@@ -24,7 +24,7 @@ class _LinkedDocumentsPageState extends State<LinkedDocumentsPage>
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).linkedDocumentsPageTitle),
title: Text(S.of(context).linkedDocuments),
actions: [
BlocBuilder<LinkedDocumentsCubit, LinkedDocumentsState>(
builder: (context, state) {

View File

@@ -40,9 +40,7 @@ class _ClientCertificateFormFieldState
}
assert(_selectedFile != null);
if (_selectedFile?.path.split(".").last != 'pfx') {
return S
.of(context)
.loginPageClientCertificateSettingInvalidFileFormatValidationText;
return S.of(context).invalidCertificateFormat;
}
return null;
},
@@ -52,9 +50,8 @@ class _ClientCertificateFormFieldState
return Theme(
data: theme,
child: ExpansionTile(
title: Text(S.of(context).loginPageClientCertificateSettingLabel),
subtitle: Text(
S.of(context).loginPageClientCertificateSettingDescriptionText),
title: Text(S.of(context).clientcertificate),
subtitle: Text(S.of(context).configureMutualTLSAuthentication),
children: [
InputDecorator(
decoration: InputDecoration(
@@ -70,8 +67,7 @@ class _ClientCertificateFormFieldState
children: [
ElevatedButton(
onPressed: () => _onSelectFile(field),
child:
Text(S.of(context).genericActionSelectText),
child: Text(S.of(context).select),
),
_buildSelectedFileText(field).paddedOnly(left: 8),
],
@@ -89,7 +85,7 @@ class _ClientCertificateFormFieldState
// ListTile(
// leading: ElevatedButton(
// onPressed: () => _onSelectFile(field),
// child: Text(S.of(context).genericActionSelectText),
// child: Text(S.of(context).select),
// ),
// title: _buildSelectedFileText(field),
// trailing: AbsorbPointer(
@@ -112,9 +108,7 @@ class _ClientCertificateFormFieldState
onChanged: (value) => field.didChange(
field.value?.copyWith(passphrase: value),
),
label: S
.of(context)
.loginPageClientCertificatePassphraseLabel,
label: S.of(context).passphrase,
).padded(),
] else
...[]
@@ -149,7 +143,7 @@ class _ClientCertificateFormFieldState
if (field.value == null) {
assert(_selectedFile == null);
return Text(
S.of(context).loginPageClientCertificateSettingSelectFileText,
S.of(context).selectFile,
style: Theme.of(context).textTheme.labelMedium?.apply(
color: Theme.of(context).hintColor,
),

View File

@@ -44,18 +44,16 @@ class _ServerAddressFormFieldState extends State<ServerAddressFormField> {
autovalidateMode: AutovalidateMode.onUserInteraction,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(
errorText:
S.of(context).loginPageServerUrlValidatorMessageRequiredText,
errorText: S.of(context).serverAddressMustNotBeEmpty,
),
FormBuilderValidators.match(
r"https?://.*",
errorText:
S.of(context).loginPageServerUrlValidatorMessageMissingSchemeText,
errorText: S.of(context).serverAddressMustIncludeAScheme,
)
]),
decoration: InputDecoration(
hintText: "http://192.168.1.50:8000",
labelText: S.of(context).loginPageServerUrlFieldLabel,
labelText: S.of(context).serverAddress,
suffixIcon: _canClear
? IconButton(
icon: const Icon(Icons.clear),

View File

@@ -37,22 +37,22 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
UserCredentials(username: username),
),
validator: FormBuilderValidators.required(
errorText: S.of(context).loginPageUsernameValidatorMessageText,
errorText: S.of(context).usernameMustNotBeEmpty,
),
autofillHints: const [AutofillHints.username],
decoration: InputDecoration(
label: Text(S.of(context).loginPageUsernameLabel),
label: Text(S.of(context).username),
),
),
ObscuredInputTextFormField(
key: const ValueKey('login-password'),
label: S.of(context).loginPagePasswordFieldLabel,
label: S.of(context).password,
onChanged: (password) => field.didChange(
field.value?.copyWith(password: password) ??
UserCredentials(password: password),
),
validator: FormBuilderValidators.required(
errorText: S.of(context).loginPagePasswordValidatorMessageText,
errorText: S.of(context).passwordMustNotBeEmpty,
),
),
].map((child) => child.padded()).toList(),
@@ -73,11 +73,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
FocusScope.of(context).requestFocus(_focusNodes[fkPassword]);
},
validator: FormBuilderValidators.required(
errorText: S.of(context).loginPageUsernameValidatorMessageText,
errorText: S.of(context).usernameMustNotBeEmpty,
),
autofillHints: const [AutofillHints.username],
decoration: InputDecoration(
labelText: S.of(context).loginPageUsernameLabel,
labelText: S.of(context).username,
),
).padded(),
FormBuilderTextField(
@@ -88,11 +88,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
},
autofillHints: const [AutofillHints.password],
validator: FormBuilderValidators.required(
errorText: S.of(context).loginPagePasswordValidatorMessageText,
errorText: S.of(context).passwordMustNotBeEmpty,
),
obscureText: true,
decoration: InputDecoration(
labelText: S.of(context).loginPagePasswordFieldLabel,
labelText: S.of(context).password,
),
).padded(),
],

View File

@@ -32,7 +32,7 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
return Scaffold(
appBar: AppBar(
toolbarHeight: kToolbarHeight - 4,
title: Text(S.of(context).loginPageTitle),
title: Text(S.of(context).connectToPaperless),
bottom: PreferredSize(
child: _isCheckingConnection
? const LinearProgressIndicator()
@@ -61,11 +61,11 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
child: Text("Test connection"),
child: Text("Test connection"), //TODO: INTL
onPressed: _updateReachability,
),
FilledButton(
child: Text(S.of(context).loginPageContinueLabel),
child: Text(S.of(context).continueLabel),
onPressed: _reachabilityStatus == ReachabilityStatus.reachable
? widget.onContinue
: null,
@@ -108,19 +108,19 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
case ReachabilityStatus.reachable:
return _buildIconText(
Icons.done,
S.of(context).loginPageReachabilitySuccessText,
S.of(context).connectionSuccessfulylEstablished,
Colors.green,
);
case ReachabilityStatus.notReachable:
return _buildIconText(
Icons.close,
S.of(context).loginPageReachabilityNotReachableText,
S.of(context).couldNotEstablishConnectionToTheServer,
errorColor,
);
case ReachabilityStatus.unknownHost:
return _buildIconText(
Icons.close,
S.of(context).loginPageReachabilityUnresolvedHostText,
S.of(context).hostCouldNotBeResolved,
errorColor,
);
case ReachabilityStatus.missingClientCertificate:
@@ -132,15 +132,13 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
case ReachabilityStatus.invalidClientCertificateConfiguration:
return _buildIconText(
Icons.close,
S
.of(context)
.loginPageReachabilityInvalidClientCertificateConfigurationText,
S.of(context).incorrectOrMissingCertificatePassphrase,
errorColor,
);
case ReachabilityStatus.connectionTimeout:
return _buildIconText(
Icons.close,
S.of(context).loginPageReachabilityConnectionTimeoutText,
S.of(context).connectionTimedOut,
errorColor,
);
}

View File

@@ -39,8 +39,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
),
body: ListView(
children: [
Text(S.of(context).loginPageSignInToPrefixText(serverAddress))
.padded(),
Text(S.of(context).signInToServer(serverAddress)).padded(),
const UserCredentialsFormField(),
],
),
@@ -54,7 +53,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
await widget.onDone();
setState(() => _isLoginLoading = false);
},
child: Text(S.of(context).loginPageSignInButtonLabel),
child: Text(S.of(context).signIn),
)
],
),

View File

@@ -25,12 +25,12 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).savedViewCreateNewLabel),
title: Text(S.of(context).newView),
),
floatingActionButton: FloatingActionButton.extended(
icon: const Icon(Icons.add),
onPressed: () => _onCreate(context),
label: Text(S.of(context).genericActionCreateLabel),
label: Text(S.of(context).create),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
@@ -46,18 +46,18 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
name: _AddSavedViewPageState.fkName,
validator: FormBuilderValidators.required(),
decoration: InputDecoration(
label: Text(S.of(context).savedViewNameLabel),
label: Text(S.of(context).name),
),
),
FormBuilderCheckbox(
name: _AddSavedViewPageState.fkShowOnDashboard,
initialValue: false,
title: Text(S.of(context).savedViewShowOnDashboardLabel),
title: Text(S.of(context).showOnDashboard),
),
FormBuilderCheckbox(
name: _AddSavedViewPageState.fkShowInSidebar,
initialValue: false,
title: Text(S.of(context).savedViewShowInSidebarLabel),
title: Text(S.of(context).showInSidebar),
),
],
),
@@ -94,18 +94,18 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
name: fkName,
validator: FormBuilderValidators.required(),
decoration: InputDecoration(
label: Text(S.of(context).savedViewNameLabel),
label: Text(S.of(context).name),
),
),
FormBuilderCheckbox(
name: fkShowOnDashboard,
initialValue: false,
title: Text(S.of(context).savedViewShowOnDashboardLabel),
title: Text(S.of(context).showOnDashboard),
),
FormBuilderCheckbox(
name: fkShowInSidebar,
initialValue: false,
title: Text(S.of(context).savedViewShowInSidebarLabel),
title: Text(S.of(context).showInSidebar),
),
],
),

View File

@@ -20,7 +20,8 @@ class SavedViewList extends StatelessWidget {
if (state.value.isEmpty) {
return SliverToBoxAdapter(
child: HintCard(
hintText: S.of(context).savedViewsEmptyStateText,
hintText:
S.of(context).createViewsToQuicklyFilterYourDocuments,
),
);
}
@@ -32,9 +33,7 @@ class SavedViewList extends StatelessWidget {
enabled: connectivity.isConnected,
title: Text(view.name),
subtitle: Text(
S
.of(context)
.savedViewsFiltersSetCount(view.filterRules.length),
S.of(context).nFiltersSet(view.filterRules.length),
),
onTap: () {
Navigator.of(context).push(

View File

@@ -24,7 +24,7 @@ class AccountSettingsDialog extends StatelessWidget {
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(S.of(context).accountSettingsTitle),
Text(S.of(context).account),
const CloseButton(),
],
),
@@ -49,7 +49,7 @@ class AccountSettingsDialog extends StatelessWidget {
ListTile(
dense: true,
leading: const Icon(Icons.person_add_rounded),
title: Text(S.of(context).accountSettingsAddAnotherAccount),
title: Text(S.of(context).addAnotherAccount),
onTap: () {},
),
const Divider(),
@@ -60,7 +60,7 @@ class AccountSettingsDialog extends StatelessWidget {
),
),
child: Text(
S.of(context).appDrawerLogoutLabel,
S.of(context).disconnect,
style: TextStyle(
color: Theme.of(context).colorScheme.onError,
),

View File

@@ -15,7 +15,7 @@ class ApplicationSettingsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).settingsPageApplicationSettingsLabel),
title: Text(S.of(context).applicationSettings),
),
body: ListView(
children: const [

View File

@@ -8,8 +8,7 @@ class SecuritySettingsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:
AppBar(title: Text(S.of(context).settingsPageSecuritySettingsLabel)),
appBar: AppBar(title: Text(S.of(context).security)),
body: ListView(
children: const [
BiometricAuthenticationSetting(),

View File

@@ -9,7 +9,7 @@ class StorageSettingsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).settingsPageStorageSettingsLabel),
title: Text(S.of(context).storage),
),
body: ListView(
children: const [

View File

@@ -5,7 +5,6 @@ import 'package:paperless_mobile/core/bloc/paperless_server_information_state.da
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
import 'package:paperless_mobile/features/settings/view/pages/application_settings_page.dart';
import 'package:paperless_mobile/features/settings/view/pages/security_settings_page.dart';
import 'package:paperless_mobile/features/settings/view/pages/storage_settings_page.dart';
import 'package:paperless_mobile/generated/l10n.dart';
class SettingsPage extends StatelessWidget {
@@ -15,24 +14,21 @@ class SettingsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).appDrawerSettingsLabel),
title: Text(S.of(context).settings),
),
bottomNavigationBar: BlocBuilder<PaperlessServerInformationCubit,
PaperlessServerInformationState>(
builder: (context, state) {
final info = state.information!;
return ListTile(
title: Text(
S.of(context).appDrawerHeaderLoggedInAsText +
" " +
(info.username ?? 'unknown') +
S.of(context).loggedInAs(info.username ?? 'unknown') +
"@${info.host}",
style: Theme.of(context).textTheme.labelSmall,
textAlign: TextAlign.center,
),
subtitle: Text(
S.of(context).serverInformationPaperlessVersionText +
S.of(context).paperlessServerVersion +
' ' +
info.version.toString() +
' (API v${info.apiVersion})',
@@ -46,23 +42,21 @@ class SettingsPage extends StatelessWidget {
children: [
ListTile(
// leading: const Icon(Icons.style_outlined),
title: Text(S.of(context).settingsPageApplicationSettingsLabel),
subtitle: Text(
S.of(context).settingsPageApplicationSettingsDescriptionText),
title: Text(S.of(context).applicationSettings),
subtitle: Text(S.of(context).languageAndVisualAppearance),
onTap: () => _goto(const ApplicationSettingsPage(), context),
),
ListTile(
// leading: const Icon(Icons.security_outlined),
title: Text(S.of(context).settingsPageSecuritySettingsLabel),
subtitle:
Text(S.of(context).settingsPageSecuritySettingsDescriptionText),
title: Text(S.of(context).security),
subtitle: Text(S.of(context).biometricAuthentication),
onTap: () => _goto(const SecuritySettingsPage(), context),
),
// ListTile(
// // leading: const Icon(Icons.storage_outlined),
// title: Text(S.of(context).settingsPageStorageSettingsLabel),
// title: Text(S.of(context).storage),
// subtitle:
// Text(S.of(context).settingsPageStorageSettingsDescriptionText),
// Text(S.of(context).mangeFilesAndStorageSpace),
// onTap: () => _goto(const StorageSettingsPage(), context),
// ),
],

View File

@@ -12,21 +12,19 @@ class BiometricAuthenticationSetting extends StatelessWidget {
builder: (context, settings) {
return SwitchListTile(
value: settings.isLocalAuthenticationEnabled,
title: Text(S.of(context).appSettingsBiometricAuthenticationLabel),
subtitle: Text(
S.of(context).appSettingsBiometricAuthenticationDescriptionText),
title: Text(S.of(context).biometricAuthentication),
subtitle: Text(S.of(context).authenticateOnAppStart),
onChanged: (val) async {
final String localizedReason = val
? S
.of(context)
.appSettingsEnableBiometricAuthenticationReasonText
: S
.of(context)
.appSettingsDisableBiometricAuthenticationReasonText;
final String localizedReason =
S.of(context).authenticateToToggleBiometricAuthentication(
val ? 'enable' : 'disable',
);
await context
.read<ApplicationSettingsCubit>()
.setIsBiometricAuthenticationEnabled(val,
localizedReason: localizedReason);
.setIsBiometricAuthenticationEnabled(
val,
localizedReason: localizedReason,
);
},
);
},

View File

@@ -18,7 +18,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
builder: (context, settings) {
return ListTile(
title: Text(S.of(context).settingsPageColorSchemeSettingLabel),
title: Text(S.of(context).colors),
subtitle: Text(
translateColorSchemeOption(
context,
@@ -28,9 +28,8 @@ class ColorSchemeOptionSetting extends StatelessWidget {
onTap: () => showDialog(
context: context,
builder: (_) => RadioSettingsDialog<ColorSchemeOption>(
titleText: S.of(context).settingsPageColorSchemeSettingLabel,
descriptionText:
S.of(context).settingsPageColorSchemeSettingDialogDescription,
titleText: S.of(context).colors,
descriptionText: S.of(context).colorSchemeHint,
options: [
RadioOption(
value: ColorSchemeOption.classic,
@@ -47,9 +46,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
],
footer: _isBelowAndroid12()
? HintCard(
hintText: S
.of(context)
.settingsPageColorSchemeSettingDynamicThemeingVersionMismatchWarning,
hintText: S.of(context).colorSchemeNotSupportedWarning,
hintIcon: Icons.warning_amber,
)
: null,

View File

@@ -25,7 +25,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
builder: (context, settings) {
return ListTile(
title: Text(S.of(context).settingsPageLanguageSettingLabel),
title: Text(S.of(context).language),
subtitle: Text(_languageOptions[settings.preferredLocaleSubtag]!),
onTap: () => showDialog<String>(
context: context,
@@ -33,7 +33,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
footer: const Text(
"* Work in progress, not fully translated yet. Some words may be displayed in English!",
),
titleText: S.of(context).settingsPageLanguageSettingLabel,
titleText: S.of(context).language,
options: [
RadioOption(
value: 'en',

View File

@@ -41,11 +41,11 @@ class _RadioSettingsDialogState<T> extends State<RadioSettingsDialog<T>> {
widget.confirmButton ??
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(S.of(context).genericActionCancelLabel)),
child: Text(S.of(context).cancel)),
widget.confirmButton ??
TextButton(
onPressed: () => Navigator.pop(context, _groupValue),
child: Text(S.of(context).genericActionOkLabel)),
child: Text(S.of(context).ok)),
],
title: widget.titleText != null ? Text(widget.titleText!) : null,
content: Column(

View File

@@ -12,13 +12,13 @@ class ThemeModeSetting extends StatelessWidget {
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
builder: (context, settings) {
return ListTile(
title: Text(S.of(context).settingsPageAppearanceSettingTitle),
title: Text(S.of(context).appearance),
subtitle: Text(_mapThemeModeToLocalizedString(
settings.preferredThemeMode, context)),
onTap: () => showDialog<ThemeMode>(
context: context,
builder: (_) => RadioSettingsDialog<ThemeMode>(
titleText: S.of(context).settingsPageAppearanceSettingTitle,
titleText: S.of(context).appearance,
initialValue: context
.read<ApplicationSettingsCubit>()
.state
@@ -26,20 +26,15 @@ class ThemeModeSetting extends StatelessWidget {
options: [
RadioOption(
value: ThemeMode.system,
label: S
.of(context)
.settingsPageAppearanceSettingSystemThemeLabel,
label: S.of(context).systemTheme,
),
RadioOption(
value: ThemeMode.light,
label: S
.of(context)
.settingsPageAppearanceSettingLightThemeLabel,
label: S.of(context).lightTheme,
),
RadioOption(
value: ThemeMode.dark,
label:
S.of(context).settingsPageAppearanceSettingDarkThemeLabel,
label: S.of(context).darkTheme,
)
],
),
@@ -56,11 +51,11 @@ class ThemeModeSetting extends StatelessWidget {
String _mapThemeModeToLocalizedString(ThemeMode theme, BuildContext context) {
switch (theme) {
case ThemeMode.system:
return S.of(context).settingsThemeModeSystemLabel;
return S.of(context).system;
case ThemeMode.light:
return S.of(context).settingsThemeModeLightLabel;
return S.of(context).light;
case ThemeMode.dark:
return S.of(context).settingsThemeModeDarkLabel;
return S.of(context).dark;
}
}
}

View File

@@ -68,7 +68,7 @@ void showGenericError(
context,
error.toString(),
action: SnackBarActionConfig(
label: S.of(context).errorReportLabel,
label: S.of(context).report,
onPressed: () => GithubIssueService.createIssueFromError(
context,
stackTrace: stackTrace,

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff