From d320caaa4ffefdd4f112af7c720bd75eb9fb7c4e Mon Sep 17 00:00:00 2001 From: Klaus Dresbach Date: Wed, 17 Jul 2024 17:30:30 +0200 Subject: [PATCH] AddRemoteTimelineView: show error message when instance is invalid (#2105) (#2133) --- .../Tabs/Timeline/AddRemoteTimelineView.swift | 6 + .../Localization/Localizable.xcstrings | 130 ++++++++++++++++++ 2 files changed, 136 insertions(+) diff --git a/IceCubesApp/App/Tabs/Timeline/AddRemoteTimelineView.swift b/IceCubesApp/App/Tabs/Timeline/AddRemoteTimelineView.swift index 3f6e7e38..ef1a9429 100644 --- a/IceCubesApp/App/Tabs/Timeline/AddRemoteTimelineView.swift +++ b/IceCubesApp/App/Tabs/Timeline/AddRemoteTimelineView.swift @@ -37,6 +37,11 @@ struct AddRemoteTimelineView: View { .foregroundColor(.green) .listRowBackground(theme.primaryBackgroundColor) } + if !instanceName.isEmpty && instance == nil { + Label("timeline.\(instanceName)-not-valid", systemImage: "xmark.seal.fill") + .foregroundColor(.red) + .listRowBackground(theme.primaryBackgroundColor) + } Button { guard instance != nil else { return } context.insert(LocalTimeline(instance: instanceName)) @@ -45,6 +50,7 @@ struct AddRemoteTimelineView: View { Text("timeline.add.action.add") } .listRowBackground(theme.primaryBackgroundColor) + .disabled(instance == nil) instancesListView } diff --git a/IceCubesApp/Resources/Localization/Localizable.xcstrings b/IceCubesApp/Resources/Localization/Localizable.xcstrings index 552b1d8d..f256986d 100644 --- a/IceCubesApp/Resources/Localization/Localizable.xcstrings +++ b/IceCubesApp/Resources/Localization/Localizable.xcstrings @@ -701,6 +701,17 @@ } } }, + "%@ ist keine valide Instanz" : { + "extractionState" : "stale", + "localizations" : { + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ не є дійсним екземпляром" + } + } + } + }, "%@ was posted on Mastodon" : { "localizations" : { "de" : { @@ -78831,6 +78842,125 @@ } } }, + "timeline.%@-not-valid" : { + "extractionState" : "manual", + "localizations" : { + "be" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ не з'яўляецца сапраўдным прыкладам" + } + }, + "ca" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ no és una instància vàlida" + } + }, + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ ist keine gültige Instanz" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ is not a valid instance" + } + }, + "en-GB" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ is not a valid instance" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ no es una instancia válida" + } + }, + "eu" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ ez da baliozko instantzia" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ n'est pas une instance valide" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ non è un'istanza valida" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ 有効なインスタンスではありません" + } + }, + "ko" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ 유효한 인스턴스가 아닙니다" + } + }, + "nb" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ er ikke en gyldig instans" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ is geen geldige instantie" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ nie jest poprawnym serwerem" + } + }, + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ não é uma instância válida" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ geçerli bir örnek değil" + } + }, + "uk" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ немає коректний сервера" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ 不是一个有效的实例" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "%@ 不是一個有效的實例" + } + } + } + }, "timeline.add-remote.title" : { "localizations" : { "be" : {