feat: Add translations for default download/share filetypes

This commit is contained in:
Anton Stubenbord
2023-04-30 12:32:14 +02:00
parent b7ec3a2edc
commit 3c98916199
11 changed files with 120 additions and 19 deletions

View File

@@ -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<FileDownloadType>(
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;
}
}
}

View File

@@ -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<FileDownloadType>(
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;
}
}
}