From d0d2c13d166ee5280d610c1714f58e70876ea8f4 Mon Sep 17 00:00:00 2001
From: ILoveOpenSourceApplications
<117499019+ILoveOpenSourceApplications@users.noreply.github.com>
Date: Mon, 14 Jul 2025 16:31:10 +0530
Subject: [PATCH] refactor(YouTube): Sort and standardize strings (#5442)
---
.../components/LayoutComponentsFilter.java | 10 +--
.../extension/youtube/settings/Settings.java | 2 +-
.../hide/general/HideLayoutComponentsPatch.kt | 6 +-
.../hide/shorts/HideShortsComponentsPatch.kt | 2 +-
.../resources/addresources/values/strings.xml | 87 +++++++++----------
5 files changed, 53 insertions(+), 54 deletions(-)
diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java
index c4313b51d..03e173756 100644
--- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java
+++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/LayoutComponentsFilter.java
@@ -32,7 +32,7 @@ public final class LayoutComponentsFilter extends Filter {
);
private final StringTrieSearch exceptions = new StringTrieSearch();
- private final StringFilterGroup inFeedSurvey;
+ private final StringFilterGroup surveys;
private final StringFilterGroup notifyMe;
private final StringFilterGroup singleItemInformationPanel;
private final StringFilterGroup expandableMetadata;
@@ -110,8 +110,8 @@ public final class LayoutComponentsFilter extends Filter {
"chip_bar"
);
- inFeedSurvey = new StringFilterGroup(
- Settings.HIDE_FEED_SURVEY,
+ surveys = new StringFilterGroup(
+ Settings.HIDE_SURVEYS,
"in_feed_survey",
"slimline_survey",
"feed_nudge"
@@ -286,7 +286,6 @@ public final class LayoutComponentsFilter extends Filter {
forYouShelf,
horizontalShelves,
imageShelf,
- inFeedSurvey,
infoPanel,
latestPosts,
medicalPanel,
@@ -298,6 +297,7 @@ public final class LayoutComponentsFilter extends Filter {
singleItemInformationPanel,
subscribersCommunityGuidelines,
subscriptionsChipBar,
+ surveys,
timedReactions,
videoRecommendationLabels
);
@@ -317,7 +317,7 @@ public final class LayoutComponentsFilter extends Filter {
// The groups are excluded from the filter due to the exceptions list below.
// Filter them separately here.
- if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata) {
+ if (matchedGroup == notifyMe || matchedGroup == surveys || matchedGroup == expandableMetadata) {
return true;
}
diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java
index 564dd5f31..b57a54523 100644
--- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java
+++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java
@@ -100,7 +100,6 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_CROWDFUNDING_BOX = new BooleanSetting("revanced_hide_crowdfunding_box", FALSE, true);
public static final BooleanSetting HIDE_DOODLES = new BooleanSetting("revanced_hide_doodles", FALSE, true, "revanced_hide_doodles_user_dialog_message");
public static final BooleanSetting HIDE_EXPANDABLE_CARD = new BooleanSetting("revanced_hide_expandable_card", TRUE);
- public static final BooleanSetting HIDE_FEED_SURVEY = new BooleanSetting("revanced_hide_feed_survey", TRUE);
public static final BooleanSetting HIDE_FILTER_BAR_FEED_IN_FEED = new BooleanSetting("revanced_hide_filter_bar_feed_in_feed", FALSE, true);
public static final BooleanSetting HIDE_FILTER_BAR_FEED_IN_HISTORY = new BooleanSetting("revanced_hide_filter_bar_feed_in_history", FALSE);
public static final BooleanSetting HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS = new BooleanSetting("revanced_hide_filter_bar_feed_in_related_videos", FALSE, true);
@@ -113,6 +112,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_NOTIFY_ME_BUTTON = new BooleanSetting("revanced_hide_notify_me_button", TRUE);
public static final BooleanSetting HIDE_PLAYABLES = new BooleanSetting("revanced_hide_playables", TRUE);
public static final BooleanSetting HIDE_SHOW_MORE_BUTTON = new BooleanSetting("revanced_hide_show_more_button", TRUE, true);
+ public static final BooleanSetting HIDE_SURVEYS = new BooleanSetting("revanced_hide_surveys", TRUE);
public static final BooleanSetting HIDE_TICKET_SHELF = new BooleanSetting("revanced_hide_ticket_shelf", FALSE);
public static final BooleanSetting HIDE_VIDEO_RECOMMENDATION_LABELS = new BooleanSetting("revanced_hide_video_recommendation_labels", TRUE);
diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
index f81d10ca4..4c9bac27c 100644
--- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
+++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
@@ -201,9 +201,9 @@ val hideLayoutComponentsPatch = bytecodePatch(
key = "revanced_hide_filter_bar_screen",
preferences = setOf(
SwitchPreference("revanced_hide_filter_bar_feed_in_feed"),
- SwitchPreference("revanced_hide_filter_bar_feed_in_history"),
- SwitchPreference("revanced_hide_filter_bar_feed_in_search"),
SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"),
+ SwitchPreference("revanced_hide_filter_bar_feed_in_search"),
+ SwitchPreference("revanced_hide_filter_bar_feed_in_history"),
),
),
PreferenceScreenPreference(
@@ -223,7 +223,6 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_crowdfunding_box"),
SwitchPreference("revanced_hide_chips_shelf"),
SwitchPreference("revanced_hide_expandable_card"),
- SwitchPreference("revanced_hide_feed_survey"),
SwitchPreference("revanced_hide_floating_microphone_button"),
SwitchPreference("revanced_hide_horizontal_shelves"),
SwitchPreference("revanced_hide_image_shelf"),
@@ -233,6 +232,7 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_notify_me_button"),
SwitchPreference("revanced_hide_playables"),
SwitchPreference("revanced_hide_show_more_button"),
+ SwitchPreference("revanced_hide_surveys"),
SwitchPreference("revanced_hide_ticket_shelf"),
SwitchPreference("revanced_hide_video_recommendation_labels"),
SwitchPreference("revanced_hide_doodles"),
diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index 9edb5622b..1faab015e 100644
--- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -66,8 +66,8 @@ private val hideShortsComponentsResourcePatch = resourcePatch {
PreferenceScreen.SHORTS.addPreferences(
SwitchPreference("revanced_hide_shorts_home"),
- SwitchPreference("revanced_hide_shorts_subscriptions"),
SwitchPreference("revanced_hide_shorts_search"),
+ SwitchPreference("revanced_hide_shorts_subscriptions"),
SwitchPreference("revanced_hide_shorts_history"),
PreferenceScreenPreference(
diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml
index cd4dbeb10..b44a4b98a 100644
--- a/patches/src/main/resources/addresources/values/strings.xml
+++ b/patches/src/main/resources/addresources/values/strings.xml
@@ -222,9 +222,6 @@ You will not be notified of any unexpected events."
Hide expandable card
Expandable card under videos is hidden
Expandable card under videos is shown
- Hide feed surveys
- Feed surveys are hidden
- Feed surveys are shown
Hide floating microphone button
Floating microphone button in search is hidden
Floating microphone button in search is shown
@@ -250,7 +247,7 @@ You will not be notified of any unexpected events."
Movies section is hidden
Movies section is shown
+ This item appear in the Subscriptions feed for future livestreams or unreleased videos. -->
Hide \'Notify me\' button
Notify me button is hidden
Notify me button is shown
@@ -262,6 +259,9 @@ You will not be notified of any unexpected events."
Hide \'Show more\' button
Show more button in search results is hidden
Show more button in search results is shown
+ Hide surveys
+ Surveys are hidden
+ Surveys are shown
Hide ticket shelf
Ticket shelf is hidden
Ticket shelf is shown
@@ -309,8 +309,8 @@ If a Doodle is currently showing in your region and this hide setting is on, the
Timed reactions are hidden
Timed reactions are shown
Hide \'AI-generated video summary\'
- Video summary section is hidden
- Video summary section is shown
+ AI-generated video summary section is hidden
+ AI-generated video summary section is shown
Hide Ask
Ask section is hidden
Ask section is shown
@@ -339,19 +339,19 @@ If a Doodle is currently showing in your region and this hide setting is on, the
Hide or show video description components
Filter bar
- Hide or show the filter bar in the feeds, history, search results, and related videos
+ Hide or show the filter bar in feeds, related videos, search results, and watch history
Hide in feeds
Hidden in feeds
Shown in feeds
- Hide in history
- Hidden in history
- Shown in history
- Hide in search results
- Hidden in search results
- Shown in search results
Hide in related videos
Hidden in related videos
Shown in related videos
+ Hide in search results
+ Hidden in search results
+ Shown in search results
+ Hide in watch history
+ Hidden in watch history
+ Shown in watch history
Channel page
Hide or show channel page components
@@ -376,12 +376,12 @@ If a Doodle is currently showing in your region and this hide setting is on, the
Comments
Hide or show comments section components
- Hide AI Chat summary
- Chat summary is hidden
- Chat summary is shown
+ Hide AI chat summary
+ AI chat summary is hidden
+ AI chat summary is shown
Hide AI comments summary
- Comments summary is hidden
- Comments summary is shown
+ AI comments summary is hidden
+ AI comments summary is shown
Hide channel guidelines
Channel guidelines are hidden
Channel guidelines are shown
@@ -418,16 +418,16 @@ If a Doodle is currently showing in your region and this hide setting is on, the
Invalid custom filter: %s
Hide keyword content
- Hide search and feed videos using keyword filters
- Hide home videos by keywords
- Videos in the home tab are filtered by keywords
- Videos in the home tab are not filtered by keywords
+ Hide feed and search videos using keyword filters
+ Hide Home videos by keywords
+ Videos in Home tab are filtered by keywords
+ Videos in Home tab are not filtered by keywords
Hide search results by keywords
Search results are filtered by keywords
Search results are not filtered by keywords
- Hide subscription videos by keywords
- Videos in the subscriptions tab are filtered by keywords
- Videos in the subscriptions tab are not filtered by keywords
+ Hide Subscriptions videos by keywords
+ Videos in Subscriptions tab are filtered by keywords
+ Videos in Subscriptions tab are not filtered by keywords
Keywords to hide
@@ -437,7 +437,7 @@ Keywords can be channel names or any text shown in video titles
Words with uppercase letters in the middle must be entered with the casing (ie: iPhone, TikTok, LeBlanc)"
About keyword filtering
- "Home/Subscription/Search results are filtered to hide content that matches keyword phrases
+ "Home/Subscriptions/Search results are filtered to hide content that matches keyword phrases
Limitations
• Shorts cannot be hidden by channel name
@@ -482,8 +482,7 @@ This feature is only available for older devices"
Hide shopping links
Shopping links in video description are hidden
Shopping links in video description are shown
-
- Hide \'View products\' banner
+ Hide view products banner
View products banner in video overlay is hidden
View products banner in video overlay is shown
Hide web search results
@@ -537,8 +536,8 @@ This feature is only available for older devices"
Disable precise seeking gesture
- Gesture is disabled
- Gesture is enabled
+ Precise seeking gesture is disabled
+ Precise seeking gesture is enabled
Enable tap to seek
@@ -652,7 +651,7 @@ Adjust volume by swiping vertically on the right side of the screen"
Navigation buttons
- Hide or change buttons in the navigation bar
+ Hide or change navigation bar buttons
Hide Home
Home button is hidden
@@ -769,8 +768,8 @@ To show the Audio track menu, change \'Spoof video streams\' to iOS TV"
Player controls background is hidden
Player controls background is shown
Hide Previous & Next buttons
- Buttons are hidden
- Buttons are shown
+ Previous & Next buttons are hidden
+ Previous & Next buttons are shown
Hide end screen cards
@@ -793,27 +792,27 @@ To show the Audio track menu, change \'Spoof video streams\' to iOS TV"
Rolling numbers are animated
- Hide seekbar in video player
+ Hide video player seekbar
Video player seekbar is hidden
Video player seekbar is shown
- Hide seekbar in video thumbnails
- Thumbnail seekbar is hidden
- Thumbnail seekbar is shown
+ Hide video thumbnails seekbar
+ Video thumbnails seekbar is hidden
+ Video thumbnails seekbar is shown
Shorts player
- Hide or show components in the Shorts player
+ Hide or show Shorts player components
Hide Shorts in Home feed
Hidden in Home feed and related videos
Shown in Home feed and related videos
+ Hide Shorts in search results
+ Hidden in search results
+ Shown in search results
Hide Shorts in Subscriptions feed
Hidden in Subscriptions feed
Shown in Subscriptions feed
- Hide Shorts in search results
- Hidden in search results
- Shown in search results
Hide Shorts in watch history
Hidden in watch history
Shown in watch history
@@ -945,9 +944,9 @@ Settings → Playback → Autoplay next video"
Portrait and landscape
- Open videos in fullscreen portrait
- Videos open fullscreen
- Videos do not open fullscreen
+ Open videos in fullscreen portrait mode
+ Videos open in fullscreen mode
+ Videos do not open in fullscreen mode
Player overlay opacity