Add translate.nostr.wine to available translation services

Closes: https://github.com/damus-io/damus/pull/1113
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Mazin
2023-05-09 22:38:11 -04:00
committed by William Casarin
parent a58ca2918a
commit 957ac1dc03
4 changed files with 53 additions and 0 deletions

View File

@@ -73,6 +73,17 @@ struct TranslationSettingsView: View {
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 == .winetranslate {
SecureField(NSLocalizedString("API Key (required)", comment: "Prompt for required entry of API Key to use translation server."), text: $settings.winetranslate_api_key)
.disableAutocorrection(true)
.disabled(settings.translation_service != .winetranslate)
.autocapitalization(UITextAutocapitalizationType.none)
if settings.winetranslate_api_key == "" {
Link(NSLocalizedString("Get API Key with BTC/Lightning", comment: "Button to navigate to translate.nostr.wine to get a translation API key."), destination: URL(string: "https://translate.nostr.wine")!)
}
}
if settings.translation_service != .none {
Toggle(NSLocalizedString("Automatically translate notes", comment: "Toggle to automatically translate notes."), isOn: $settings.auto_translate)