From f6b481cea83c0f94249a3310e754561add276ca8 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Wed, 29 Nov 2023 11:07:57 +0100 Subject: [PATCH] translate "no proxy" in settings Signed-off-by: Marcel Hibbe --- .../java/com/nextcloud/talk/settings/SettingsActivity.kt | 6 ++++-- .../nextcloud/talk/utils/preferences/AppPreferencesImpl.kt | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt b/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt index d69d48aa02..2bf2c3d47d 100644 --- a/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt @@ -587,7 +587,9 @@ class SettingsActivity : BaseActivity() { } } - if (("No proxy" == appPreferences.proxyType) || appPreferences.proxyType == null) { + if (((context.resources.getString(R.string.nc_no_proxy)) == appPreferences.proxyType) || + appPreferences.proxyType == null + ) { hideProxySettings() } else { showProxySettings() @@ -987,7 +989,7 @@ class SettingsActivity : BaseActivity() { proxyTypeFlow.collect { newString -> if (newString != state) { state = newString - if (("No proxy" == newString) || newString.isEmpty()) { + if (((context.resources.getString(R.string.nc_no_proxy)) == newString) || newString.isEmpty()) { hideProxySettings() } else { when (newString) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt index 2a7fcedf21..4e6f4fcd61 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferencesImpl.kt @@ -41,7 +41,9 @@ import kotlinx.coroutines.runBlocking class AppPreferencesImpl(val context: Context) : AppPreferences { override fun getProxyType(): String { - return runBlocking { async { readString(PROXY_TYPE, "No proxy").first() } }.getCompleted() + return runBlocking { + async { readString(PROXY_TYPE, context.resources.getString(R.string.nc_no_proxy)).first() } + }.getCompleted() } override fun setProxyType(proxyType: String?) = runBlocking {