Add nokyctranslate translation option

Changelog-Added: Add nokyctranslate translation option
Closes: #946
This commit is contained in:
symbsrcool
2023-04-16 22:29:40 -04:00
committed by William Casarin
parent 2048e68d67
commit 6ac68b5a73
4 changed files with 76 additions and 1 deletions

View File

@@ -65,6 +65,17 @@ struct TranslationSettingsView: View {
}
}
if settings.translation_service == .nokyctranslate {
SecureField(NSLocalizedString("API Key (required)", comment: "Prompt for optional entry of API Key to use translation server."), text: $settings.nokyctranslate_api_key)
.disableAutocorrection(true)
.disabled(settings.translation_service != .nokyctranslate)
.autocapitalization(UITextAutocapitalizationType.none)
if settings.nokyctranslate_api_key == "" {
Link(NSLocalizedString("Get API Key with BTC/Lightning", comment: "Button to navigate to nokyctranslate website to get a translation API key."), destination: URL(string: "https://nokyctranslate.com")!)
}
}
if settings.translation_service != .none {
Toggle(NSLocalizedString("Automatically translate notes", comment: "Toggle to automatically translate notes."), isOn: $settings.auto_translate)
.toggleStyle(.switch)