From 4ca6886fcf8140a448f3c058dfb2b041cdd54331 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 21 Apr 2024 08:03:11 +0400 Subject: [PATCH] chore: Fix duplicate strings that is confusing Crowdin --- .../patches/twitch/misc/settings/SettingsPatch.kt | 12 +++++++++++- src/main/resources/addresources/values/strings.xml | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt index 719c65593..b034444b7 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt @@ -62,7 +62,17 @@ object SettingsPatch : BytecodePatch( AddResourcesPatch(this::class) PreferenceScreen.MISC.OTHER.addPreferences( - SwitchPreference("revanced_debug") + // The debug setting is shared across multiple apps and the key must be the same. + // But the title and summary must be different, otherwise when the strings file is flattened + // for Crowdin push, Crowdin gets confused by the duplicate keys. + // FIXME: Ideally the shared debug strings are extracted into a common app group + // and then both apps import that. But for now unique unique title and summary keys also works. + SwitchPreference( + key = "revanced_debug", + titleKey = "revanced_twitch_debug_title", + summaryOnKey = "revanced_twitch_debug_summary_on", + summaryOffKey = "revanced_twitch_debug_summary_off" + ) ) // Hook onCreate to handle fragment creation diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index ee5f9fdd4..2e9f2e648 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1155,9 +1155,9 @@ Other settings Client-side ads Server-side surestream ads - Debug logging - Debug logs are enabled - Debug logs are disabled + Debug logging + Debug logs are enabled + Debug logs are disabled \ No newline at end of file