Add auto-translate setting

This commit is contained in:
2023-03-26 11:50:41 -06:00
parent f75fc7eebe
commit 866e93d338
4 changed files with 41 additions and 14 deletions
+6
View File
@@ -155,6 +155,7 @@ struct ConfigView: View {
Section(NSLocalizedString("Translations", comment: "Section title for selecting the translation service.")) {
Toggle(NSLocalizedString("Show only preferred languages on Universe feed", comment: "Toggle to show notes that are only in the device's preferred languages on the Universe feed and hide notes that are in other languages."), isOn: $settings.show_only_preferred_languages)
.toggleStyle(.switch)
Picker(NSLocalizedString("Service", comment: "Prompt selection of translation service provider."), selection: $settings.translation_service) {
ForEach(TranslationService.allCases, id: \.self) { server in
Text(server.model.displayName)
@@ -199,6 +200,11 @@ struct ConfigView: View {
Link(NSLocalizedString("Get API Key", comment: "Button to navigate to DeepL website to get a translation API key."), destination: URL(string: "https://www.deepl.com/pro-api")!)
}
}
if settings.translation_service != .none {
Toggle(NSLocalizedString("Automatically translate notes", comment: "Toggle to automatically translate notes."), isOn: $settings.auto_translate)
.toggleStyle(.switch)
}
}
Section(NSLocalizedString("Miscellaneous", comment: "Section header for miscellaneous user configuration")) {