From 3c989161997729d9d2e193507eb11803e7663a06 Mon Sep 17 00:00:00 2001 From: Anton Stubenbord Date: Sun, 30 Apr 2023 12:32:14 +0200 Subject: [PATCH] feat: Add translations for default download/share filetypes --- .../widgets/default_download_file_type_setting.dart | 12 ++++++------ .../widgets/default_share_file_type_setting.dart | 12 ++++++------ lib/l10n/intl_ca.arb | 13 +++++++++++++ lib/l10n/intl_cs.arb | 13 +++++++++++++ lib/l10n/intl_de.arb | 13 +++++++++++++ lib/l10n/intl_en.arb | 13 +++++++++++++ lib/l10n/intl_fr.arb | 13 +++++++++++++ lib/l10n/intl_pl.arb | 13 +++++++++++++ lib/l10n/intl_ru.arb | 13 +++++++++++++ lib/l10n/intl_tr.arb | 13 +++++++++++++ .../lib/src/models/document_model.dart | 11 ++++------- 11 files changed, 120 insertions(+), 19 deletions(-) diff --git a/lib/features/settings/view/widgets/default_download_file_type_setting.dart b/lib/features/settings/view/widgets/default_download_file_type_setting.dart index 9335ab4..86e342f 100644 --- a/lib/features/settings/view/widgets/default_download_file_type_setting.dart +++ b/lib/features/settings/view/widgets/default_download_file_type_setting.dart @@ -12,7 +12,7 @@ class DefaultDownloadFileTypeSetting extends StatelessWidget { return GlobalSettingsBuilder( builder: (context, settings) { return ListTile( - title: Text("Default download file type"), + title: Text(S.of(context)!.defaultDownloadFileType), subtitle: Text( _downloadFileTypeToString(context, settings.defaultDownloadType), ), @@ -21,19 +21,19 @@ class DefaultDownloadFileTypeSetting extends StatelessWidget { context: context, builder: (context) { return RadioSettingsDialog( - titleText: "Default download file type", + titleText: S.of(context)!.defaultDownloadFileType, options: [ RadioOption( value: FileDownloadType.alwaysAsk, - label: "Always ask", + label: _downloadFileTypeToString(context, FileDownloadType.alwaysAsk), ), RadioOption( value: FileDownloadType.original, - label: S.of(context)!.original, + label: _downloadFileTypeToString(context, FileDownloadType.original), ), RadioOption( value: FileDownloadType.archived, - label: S.of(context)!.archivedPdf, + label: _downloadFileTypeToString(context, FileDownloadType.archived), ), ], initialValue: settings.defaultDownloadType, @@ -58,7 +58,7 @@ class DefaultDownloadFileTypeSetting extends StatelessWidget { case FileDownloadType.archived: return S.of(context)!.archivedPdf; case FileDownloadType.alwaysAsk: - return "Always ask"; + return S.of(context)!.alwaysAsk; } } } diff --git a/lib/features/settings/view/widgets/default_share_file_type_setting.dart b/lib/features/settings/view/widgets/default_share_file_type_setting.dart index 21d689f..2b7ba55 100644 --- a/lib/features/settings/view/widgets/default_share_file_type_setting.dart +++ b/lib/features/settings/view/widgets/default_share_file_type_setting.dart @@ -12,7 +12,7 @@ class DefaultShareFileTypeSetting extends StatelessWidget { return GlobalSettingsBuilder( builder: (context, settings) { return ListTile( - title: Text("Default share file type"), + title: Text(S.of(context)!.defaultShareFileType), subtitle: Text( _downloadFileTypeToString(context, settings.defaultShareType), ), @@ -21,19 +21,19 @@ class DefaultShareFileTypeSetting extends StatelessWidget { context: context, builder: (context) { return RadioSettingsDialog( - titleText: "Default share file type", + titleText: S.of(context)!.defaultShareFileType, options: [ RadioOption( value: FileDownloadType.alwaysAsk, - label: "Always ask", + label: _downloadFileTypeToString(context, FileDownloadType.alwaysAsk), ), RadioOption( value: FileDownloadType.original, - label: S.of(context)!.original, + label: _downloadFileTypeToString(context, FileDownloadType.original), ), RadioOption( value: FileDownloadType.archived, - label: S.of(context)!.archivedPdf, + label: _downloadFileTypeToString(context, FileDownloadType.archived), ), ], initialValue: settings.defaultShareType, @@ -58,7 +58,7 @@ class DefaultShareFileTypeSetting extends StatelessWidget { case FileDownloadType.archived: return S.of(context)!.archivedPdf; case FileDownloadType.alwaysAsk: - return "Always ask"; + return S.of(context)!.alwaysAsk; } } } diff --git a/lib/l10n/intl_ca.arb b/lib/l10n/intl_ca.arb index 471bc5e..d320268 100644 --- a/lib/l10n/intl_ca.arb +++ b/lib/l10n/intl_ca.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_cs.arb b/lib/l10n/intl_cs.arb index 6fecad7..7e0f9c4 100644 --- a/lib/l10n/intl_cs.arb +++ b/lib/l10n/intl_cs.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index f1251bc..66cb563 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Finde den Code auf", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Meine Entscheidung merken", + "defaultDownloadFileType": "Standard Dateityp beim Herunterladen", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Standard Dateityp beim Teilen", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Immer fragen", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index c0a9d2b..8984f3b 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index acdc5f5..1ae2fdb 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index e06d3ff..a51ceac 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index 8269f2b..b1a5366 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/lib/l10n/intl_tr.arb b/lib/l10n/intl_tr.arb index 9941169..2946b9f 100644 --- a/lib/l10n/intl_tr.arb +++ b/lib/l10n/intl_tr.arb @@ -766,5 +766,18 @@ "findTheSourceCodeOn": "Find the source code on", "@findTheSourceCodeOn": { "description": "Text before link to Paperless Mobile GitHub" + }, + "rememberDecision": "Remember my decision", + "defaultDownloadFileType": "Default Download File Type", + "@defaultDownloadFileType": { + "description": "Label indicating the default filetype to download (one of archived, original and always ask)" + }, + "defaultShareFileType": "Default Share File Type", + "@defaultShareFileType": { + "description": "Label indicating the default filetype to share (one of archived, original and always ask)" + }, + "alwaysAsk": "Always ask", + "@alwaysAsk": { + "description": "Option to choose when the app should always ask the user which filetype to use" } } \ No newline at end of file diff --git a/packages/paperless_api/lib/src/models/document_model.dart b/packages/paperless_api/lib/src/models/document_model.dart index 801778f..838a93c 100644 --- a/packages/paperless_api/lib/src/models/document_model.dart +++ b/packages/paperless_api/lib/src/models/document_model.dart @@ -61,8 +61,7 @@ class DocumentModel extends Equatable { this.searchHit, }); - factory DocumentModel.fromJson(Map json) => - _$DocumentModelFromJson(json); + factory DocumentModel.fromJson(Map json) => _$DocumentModelFromJson(json); Map toJson() => _$DocumentModelToJson(this); @@ -85,17 +84,15 @@ class DocumentModel extends Equatable { title: title ?? this.title, content: content ?? this.content, documentType: documentType != null ? documentType() : this.documentType, - correspondent: - correspondent != null ? correspondent() : this.correspondent, + correspondent: correspondent != null ? correspondent() : this.correspondent, storagePath: storagePath != null ? storagePath() : this.storagePath, tags: tags ?? this.tags, created: created ?? this.created, modified: modified ?? this.modified, added: added ?? this.added, originalFileName: originalFileName ?? this.originalFileName, - archiveSerialNumber: archiveSerialNumber != null - ? archiveSerialNumber() - : this.archiveSerialNumber, + archiveSerialNumber: + archiveSerialNumber != null ? archiveSerialNumber() : this.archiveSerialNumber, archivedFileName: archivedFileName ?? this.archivedFileName, ); }