From 9e93427d11b10da4c5314adc4cf744d65c1244ca Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Thu, 2 May 2024 03:51:55 +0900 Subject: [PATCH] feat(YouTube/Settings): add strings that provide no translation --- .../youtube/utils/settings/SettingsPatch.kt | 16 ++++++++++++++++ .../youtube/settings/host/values/strings.xml | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt index 0571ccece..fe3fd4658 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt @@ -1,6 +1,7 @@ package app.revanced.patches.youtube.utils.settings import app.revanced.patcher.data.ResourceContext +import app.revanced.patches.shared.elements.StringsElementsUtils.removeStringsElements import app.revanced.patches.shared.mapping.ResourceMappingPatch import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.youtube.utils.integrations.IntegrationsPatch @@ -93,6 +94,21 @@ object SettingsPatch : BaseResourcePatch( .also { it.shutdown() } .awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS) + /** + * remove strings duplicated with RVX resources + * + * YouTube does not provide translations for these strings. + * That's why it's been added to RVX resources. + * This string also exists in RVX resources, so it must be removed to avoid being duplicated. + */ + context.removeStringsElements( + arrayOf("values"), + arrayOf( + "accessibility_settings_edu_opt_in_text", + "accessibility_settings_edu_opt_out_text" + ) + ) + /** * copy arrays, strings and preference */ diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 66d0d2633..a7f709f62 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -1,5 +1,9 @@ + + Turn on accessibility controls for the video player? + Your controls are modified because an accessibility service is on. + ReVanced Extended