Add indicator which language is translated (#455)

This commit is contained in:
Thomas 2023-01-30 07:26:43 +01:00 committed by GitHub
parent 392b1bd01a
commit 5871d13eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 2 deletions

View file

@ -292,6 +292,7 @@
// MARK: Package: Status
"status.action.translate" = "Übersetzen";
"status.action.translate-from-%@" = "Übersetzen aus %@";
"status.action.translated-label" = "Übersetzt mit DeepL.com";
"status.action.bookmark" = "Lesezeichen";
"status.action.boost" = "Boosten";

View file

@ -291,6 +291,7 @@
// MARK: Package: Status
"status.action.translate" = "Translate";
"status.action.translate-from-%@" = "Translate from %@";
"status.action.translated-label" = "Translated using DeepL.com";
"status.action.bookmark" = "Bookmark";
"status.action.boost" = "Boost";

View file

@ -292,6 +292,7 @@
// MARK: Package: Status
"status.action.translate" = "Traducir";
"status.action.translate-from-%@" = "Traducir desde %@";
"status.action.translated-label" = "Traducido usando DeepL.com";
"status.action.bookmark" = "Añadir a marcadores";
"status.action.boost" = "Retootear";

View file

@ -287,6 +287,7 @@
// MARK: Package: Status
"status.action.translate" = "Traduire";
"status.action.translate-from-%@" = "Traduire de %@";
"status.action.translated-label" = "Traduit avec DeepL.com";
"status.action.bookmark" = "Marquer";
"status.action.boost" = "Promouvoir";

View file

@ -293,6 +293,7 @@
// MARK: Package: Status
"status.action.translate" = "Traduci";
"status.action.translate-from-%@" = "Traduci da %@";
"status.action.translated-label" = "Tradotto usando DeepL.com";
"status.action.bookmark" = "Salva nei segnalibri";
"status.action.boost" = "Condividi";

View file

@ -275,6 +275,7 @@
// MARK: Package: Status
"status.action.translate" = "翻訳";
"status.action.translate-from-%@" = "翻訳 %@";
"status.action.translated-label" = "DeepL.comを使用して翻訳";
"status.action.bookmark" = "ブックマーク";
"status.action.boost" = "ブースト";

View file

@ -289,6 +289,7 @@
// MARK: Package: Status
"status.action.translate" = "Vertaal";
"status.action.translate-from-%@" = "Vertaal uit %@";
"status.action.translated-label" = "Vertaald met behulp van DeepL.com";
"status.action.bookmark" = "Voeg bladwijzer toe";
"status.action.boost" = "Boosten";

View file

@ -273,6 +273,7 @@
// MARK: Package: Status
"status.action.translate" = "Tercüme et";
"status.action.translate-from-%@" = "Tercüme et %@";
"status.action.translated-label" = "DeepL.com tarafından tercüme edildi";
"status.action.bookmark" = "Yer İmi Ekle";
"status.action.boost" = "Yükselt";

View file

@ -292,6 +292,7 @@
// MARK: Package: Status
"status.action.translate" = "翻译";
"status.action.translate-from-%@" = "翻译 %@";
"status.action.translated-label" = "使用 DeepL.com 翻译";
"status.action.bookmark" = "书签";
"status.action.boost" = "转发";

View file

@ -85,7 +85,12 @@ struct StatusRowContextMenu: View {
await viewModel.translate(userLang: lang)
}
} label: {
Label("status.action.translate", systemImage: "captions.bubble")
if let statusLanguage = viewModel.status.language,
let lanugageName = Locale.current.localizedString(forLanguageCode: statusLanguage) {
Label("status.action.translate-from-\(lanugageName)", systemImage: "captions.bubble")
} else {
Label("status.action.translate", systemImage: "captions.bubble")
}
}
}

View file

@ -316,7 +316,12 @@ public struct StatusRowView: View {
if viewModel.isLoadingTranslation {
ProgressView()
} else {
Text("status.action.translate")
if let statusLanguage = status.language,
let lanugageName = Locale.current.localizedString(forLanguageCode: statusLanguage) {
Text("status.action.translate-from-\(lanugageName)")
} else {
Text("status.action.translate")
}
}
}
.buttonStyle(.borderless)