mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 12:08:05 -06:00
feat: Renamed translation strings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 '';
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
];
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user