refactor(YouTube): Match YouTube naming and sort strings (#5309)

This commit is contained in:
ILoveOpenSourceApplications
2025-07-01 01:42:01 +05:30
committed by GitHub
parent 6c32591f62
commit bbe504e616
5 changed files with 56 additions and 50 deletions

View File

@@ -107,21 +107,24 @@ public final class AdsFilter extends Filter {
);
final var viewProducts = new StringFilterGroup(
Settings.HIDE_PRODUCTS_BANNER,
Settings.HIDE_VIEW_PRODUCTS_BANNER,
"product_item",
"products_in_video",
"shopping_overlay.eml", // Video player overlay shopping links.
"shopping_carousel.eml" // Channel profile shopping shelf.
"shopping_overlay.eml" // Video player overlay shopping links.
);
shoppingLinks = new StringFilterGroup(
Settings.HIDE_SHOPPING_LINKS,
"expandable_list",
Settings.HIDE_TAGGED_PRODUCTS,
"expandable_list"
);
final var storeProductsShelf = new StringFilterGroup(
Settings.HIDE_CREATOR_STORE_SHELVES,
"shopping_description_shelf.eml"
);
playerShoppingShelf = new StringFilterGroup(
Settings.HIDE_PLAYER_STORE_SHELF,
Settings.HIDE_CREATOR_STORE_SHELVES,
"horizontal_shelf.eml"
);
@@ -148,7 +151,8 @@ public final class AdsFilter extends Filter {
final var merchandise = new StringFilterGroup(
Settings.HIDE_MERCHANDISE_BANNERS,
"product_carousel"
"product_carousel",
"shopping_carousel.eml" // Channel profile shopping shelf.
);
final var selfSponsor = new StringFilterGroup(
@@ -157,16 +161,17 @@ public final class AdsFilter extends Filter {
);
addPathCallbacks(
channelProfile,
fullscreenAd,
generalAds,
merchandise,
viewProducts,
selfSponsor,
fullscreenAd,
channelProfile,
webLinkPanel,
shoppingLinks,
movieAds,
playerShoppingShelf,
movieAds
selfSponsor,
shoppingLinks,
storeProductsShelf,
viewProducts,
webLinkPanel
);
}

View File

@@ -74,6 +74,7 @@ public class Settings extends BaseSettings {
public static final BooleanSetting FORCE_ORIGINAL_AUDIO = new BooleanSetting("revanced_force_original_audio", FALSE, new ForceOriginalAudioAvailability());
// Ads
public static final BooleanSetting HIDE_CREATOR_STORE_SHELVES = new BooleanSetting("revanced_hide_creator_store_shelves", TRUE);
public static final BooleanSetting HIDE_END_SCREEN_STORE_BANNER = new BooleanSetting("revanced_hide_end_screen_store_banner", TRUE, true);
public static final BooleanSetting HIDE_FULLSCREEN_ADS = new BooleanSetting("revanced_hide_fullscreen_ads", TRUE);
public static final BooleanSetting HIDE_GENERAL_ADS = new BooleanSetting("revanced_hide_general_ads", TRUE);
@@ -81,11 +82,10 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_HIDE_LATEST_POSTS = new BooleanSetting("revanced_hide_latest_posts_ads", TRUE);
public static final BooleanSetting HIDE_MERCHANDISE_BANNERS = new BooleanSetting("revanced_hide_merchandise_banners", TRUE);
public static final BooleanSetting HIDE_PAID_PROMOTION_LABEL = new BooleanSetting("revanced_hide_paid_promotion_label", TRUE);
public static final BooleanSetting HIDE_PLAYER_STORE_SHELF = new BooleanSetting("revanced_hide_player_store_shelf", TRUE);
public static final BooleanSetting HIDE_PRODUCTS_BANNER = new BooleanSetting("revanced_hide_products_banner", TRUE);
public static final BooleanSetting HIDE_SELF_SPONSOR = new BooleanSetting("revanced_hide_self_sponsor_ads", TRUE);
public static final BooleanSetting HIDE_SHOPPING_LINKS = new BooleanSetting("revanced_hide_shopping_links", TRUE);
public static final BooleanSetting HIDE_TAGGED_PRODUCTS = new BooleanSetting("revanced_hide_tagged_products", TRUE);
public static final BooleanSetting HIDE_VIDEO_ADS = new BooleanSetting("revanced_hide_video_ads", TRUE, true);
public static final BooleanSetting HIDE_VIEW_PRODUCTS_BANNER = new BooleanSetting("revanced_hide_view_products_banner", TRUE);
public static final BooleanSetting HIDE_VISIT_STORE_BUTTON = new BooleanSetting("revanced_hide_visit_store_button", TRUE);
public static final BooleanSetting HIDE_WEB_SEARCH_RESULTS = new BooleanSetting("revanced_hide_web_search_results", TRUE);
@@ -187,10 +187,10 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_COMMENTS_AI_SUMMARY = new BooleanSetting("revanced_hide_comments_ai_summary", FALSE);
public static final BooleanSetting HIDE_COMMENTS_BY_MEMBERS_HEADER = new BooleanSetting("revanced_hide_comments_by_members_header", FALSE);
public static final BooleanSetting HIDE_COMMENTS_CREATE_A_SHORT_BUTTON = new BooleanSetting("revanced_hide_comments_create_a_short_button", TRUE);
public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_BUTTON = new BooleanSetting("revanced_hide_comments_timestamp_button", FALSE);
public static final BooleanSetting HIDE_COMMENTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_comments_preview_comment", FALSE);
public static final BooleanSetting HIDE_COMMENTS_SECTION = new BooleanSetting("revanced_hide_comments_section", FALSE);
public static final BooleanSetting HIDE_COMMENTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_comments_thanks_button", TRUE);
public static final BooleanSetting HIDE_COMMENTS_TIMESTAMP_BUTTON = new BooleanSetting("revanced_hide_comments_timestamp_button", FALSE);
// Description
public static final BooleanSetting HIDE_AI_GENERATED_VIDEO_SUMMARY_SECTION = new BooleanSetting("revanced_hide_ai_generated_video_summary_section", FALSE);
public static final BooleanSetting HIDE_ASK_SECTION = new BooleanSetting("revanced_hide_ask_section", FALSE);

View File

@@ -43,17 +43,17 @@ private val hideAdsResourcePatch = resourcePatch {
addResources("youtube", "ad.general.hideAdsResourcePatch")
PreferenceScreen.ADS.addPreferences(
SwitchPreference("revanced_hide_general_ads"),
SwitchPreference("revanced_hide_creator_store_shelves"),
SwitchPreference("revanced_hide_end_screen_store_banner"),
SwitchPreference("revanced_hide_fullscreen_ads"),
SwitchPreference("revanced_hide_general_ads"),
SwitchPreference("revanced_hide_merchandise_banners"),
SwitchPreference("revanced_hide_paid_promotion_label"),
SwitchPreference("revanced_hide_player_store_shelf"),
SwitchPreference("revanced_hide_self_sponsor_ads"),
SwitchPreference("revanced_hide_products_banner"),
SwitchPreference("revanced_hide_shopping_links"),
SwitchPreference("revanced_hide_tagged_products"),
SwitchPreference("revanced_hide_view_products_banner"),
SwitchPreference("revanced_hide_visit_store_button"),
SwitchPreference("revanced_hide_web_search_results"),
SwitchPreference("revanced_hide_merchandise_banners"),
)
addLithoFilter("Lapp/revanced/extension/youtube/patches/components/AdsFilter;")

View File

@@ -160,9 +160,9 @@ val hideLayoutComponentsPatch = bytecodePatch(
SwitchPreference("revanced_hide_comments_by_members_header"),
SwitchPreference("revanced_hide_comments_section"),
SwitchPreference("revanced_hide_comments_create_a_short_button"),
SwitchPreference("revanced_hide_comments_timestamp_button"),
SwitchPreference("revanced_hide_comments_preview_comment"),
SwitchPreference("revanced_hide_comments_thanks_button"),
SwitchPreference("revanced_hide_comments_timestamp_button"),
),
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
),

View File

@@ -363,7 +363,7 @@ You will not be notified of any unexpected events."</string>
<string name="revanced_hide_comments_ai_chat_summary_title">Hide AI Chat summary</string>
<string name="revanced_hide_comments_ai_chat_summary_summary_on">Chat summary is hidden</string>
<string name="revanced_hide_comments_ai_chat_summary_summary_off">Chat summary is shown</string>
<string name="revanced_hide_comments_ai_summary_title">Hide AI Comments summary</string>
<string name="revanced_hide_comments_ai_summary_title">Hide AI comments summary</string>
<string name="revanced_hide_comments_ai_summary_summary_on">Comments summary is hidden</string>
<string name="revanced_hide_comments_ai_summary_summary_off">Comments summary is shown</string>
<string name="revanced_hide_comments_by_members_header_title">Hide \'Comments by members\' header</string>
@@ -375,15 +375,15 @@ You will not be notified of any unexpected events."</string>
<string name="revanced_hide_comments_create_a_short_button_title">Hide \'Create a Short\' button</string>
<string name="revanced_hide_comments_create_a_short_button_summary_on">Create a Short button is hidden</string>
<string name="revanced_hide_comments_create_a_short_button_summary_off">Create a Short button is shown</string>
<string name="revanced_hide_comments_timestamp_button_title">Hide timestamp button</string>
<string name="revanced_hide_comments_timestamp_button_summary_on">Timestamp button is hidden</string>
<string name="revanced_hide_comments_timestamp_button_summary_off">Timestamp button is shown</string>
<string name="revanced_hide_comments_preview_comment_title">Hide preview comment</string>
<string name="revanced_hide_comments_preview_comment_summary_on">Preview comment is hidden</string>
<string name="revanced_hide_comments_preview_comment_summary_off">Preview comment is shown</string>
<string name="revanced_hide_comments_thanks_button_title">Hide Thanks button</string>
<string name="revanced_hide_comments_thanks_button_summary_on">Thanks button is hidden</string>
<string name="revanced_hide_comments_thanks_button_summary_off">Thanks button is shown</string>
<string name="revanced_hide_comments_timestamp_button_title">Hide timestamp button</string>
<string name="revanced_hide_comments_timestamp_button_summary_on">Timestamp button is hidden</string>
<string name="revanced_hide_comments_timestamp_button_summary_off">Timestamp button is shown</string>
<!-- https://logos.fandom.com/wiki/YouTube/Yoodles -->
<string name="revanced_hide_doodles_title">Hide YouTube Doodles</string>
@@ -439,32 +439,38 @@ Limitations
<string name="revanced_hide_keyword_toast_invalid_broad">Keyword will hide all videos: %s</string>
</patch>
<patch id="ad.general.hideAdsResourcePatch">
<string name="revanced_hide_general_ads_title">Hide general ads</string>
<string name="revanced_hide_general_ads_summary_on">General ads are hidden</string>
<string name="revanced_hide_general_ads_summary_off">General ads are shown</string>
<string name="revanced_hide_creator_store_shelves_title">Hide creator store shelves</string>
<string name="revanced_hide_creator_store_shelves_summary_on">Store shelves below the player and in video description are hidden</string>
<string name="revanced_hide_creator_store_shelves_summary_off">Store shelves below the player and in video description are shown</string>
<string name="revanced_hide_end_screen_store_banner_title">Hide end screen store banner</string>
<string name="revanced_hide_end_screen_store_banner_summary_on">Store banner is hidden</string>
<string name="revanced_hide_end_screen_store_banner_summary_off">Store banner is shown</string>
<string name="revanced_hide_fullscreen_ads_title">Hide fullscreen ads</string>
<string name="revanced_hide_fullscreen_ads_summary_on">"Fullscreen ads are hidden
This feature is only available for older devices"</string>
<string name="revanced_hide_fullscreen_ads_summary_off">Fullscreen ads are shown</string>
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
<string name="revanced_hide_fullscreen_ads_feature_not_available_toast">Hide fullscreen ads only works with older devices</string>
<string name="revanced_hide_general_ads_title">Hide general ads</string>
<string name="revanced_hide_general_ads_summary_on">General ads are hidden</string>
<string name="revanced_hide_general_ads_summary_off">General ads are shown</string>
<string name="revanced_hide_merchandise_banners_title">Hide merchandise banners</string>
<string name="revanced_hide_merchandise_banners_summary_on">Merchandise banners are hidden</string>
<string name="revanced_hide_merchandise_banners_summary_off">Merchandise banners are shown</string>
<string name="revanced_hide_paid_promotion_label_title">Hide paid promotion label</string>
<string name="revanced_hide_paid_promotion_label_summary_on">Paid promotion label is hidden</string>
<string name="revanced_hide_paid_promotion_label_summary_off">Paid promotion label is shown</string>
<!-- 'View products' should be translated with the same localized wording that YouTube displays. -->
<string name="revanced_hide_view_products_banner_title">Hide \'View products\' banner</string>
<string name="revanced_hide_view_products_banner_summary_on">Banner in video overlay is hidden</string>
<string name="revanced_hide_view_products_banner_summary_off">Banner in video overlay is shown</string>
<string name="revanced_hide_self_sponsor_ads_title">Hide self sponsored cards</string>
<string name="revanced_hide_self_sponsor_ads_summary_on">Self sponsored cards are hidden</string>
<string name="revanced_hide_self_sponsor_ads_summary_off">Self sponsored cards are shown</string>
<string name="revanced_hide_products_banner_title">Hide \'View products\' banner</string>
<string name="revanced_hide_products_banner_summary_on">Banner is hidden</string>
<string name="revanced_hide_products_banner_summary_off">Banner is shown</string>
<string name="revanced_hide_end_screen_store_banner_title">Hide end screen store banner</string>
<string name="revanced_hide_end_screen_store_banner_summary_on">Store banner is hidden</string>
<string name="revanced_hide_end_screen_store_banner_summary_off">Store banner is shown</string>
<string name="revanced_hide_player_store_shelf_title">Hide player shopping shelf</string>
<string name="revanced_hide_player_store_shelf_summary_on">Shopping shelf is hidden</string>
<string name="revanced_hide_player_store_shelf_summary_off">Shopping shelf is shown</string>
<string name="revanced_hide_shopping_links_title">Hide shopping links</string>
<string name="revanced_hide_shopping_links_summary_on">Shopping links in video description are hidden</string>
<string name="revanced_hide_shopping_links_summary_off">Shopping links in video description are shown</string>
<string name="revanced_hide_tagged_products_title">Hide tagged products</string>
<string name="revanced_hide_tagged_products_summary_on">Tagged products in video description are hidden</string>
<string name="revanced_hide_tagged_products_summary_off">Tagged products in video description are shown</string>
<!-- 'Visit store' should be translated with the same localized wording that YouTube displays. -->
<string name="revanced_hide_visit_store_button_title">Hide \'Visit store\' button</string>
<string name="revanced_hide_visit_store_button_summary_on">Button in channel page is hidden</string>
@@ -472,11 +478,6 @@ This feature is only available for older devices"</string>
<string name="revanced_hide_web_search_results_title">Hide web search results</string>
<string name="revanced_hide_web_search_results_summary_on">Web search results are hidden</string>
<string name="revanced_hide_web_search_results_summary_off">Web search results are shown</string>
<string name="revanced_hide_merchandise_banners_title">Hide merchandise banners</string>
<string name="revanced_hide_merchandise_banners_summary_on">Merchandise banners are hidden</string>
<string name="revanced_hide_merchandise_banners_summary_off">Merchandise banners are shown</string>
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
<string name="revanced_hide_fullscreen_ads_feature_not_available_toast">Hide fullscreen ads only works with older devices</string>
</patch>
<patch id="ad.getpremium.hideGetPremiumPatch">
<string name="revanced_hide_get_premium_title">Hide YouTube Premium promotions</string>
@@ -888,10 +889,10 @@ To show the Audio track menu, change \'Spoof video streams\' to iOS TV"</string>
<string name="revanced_hide_shorts_sound_metadata_label_title">Hide sound metadata label</string>
<string name="revanced_hide_shorts_sound_metadata_label_summary_on">Metadata label is hidden</string>
<string name="revanced_hide_shorts_sound_metadata_label_summary_off">Metadata label is shown</string>
<string name="revanced_hide_shorts_full_video_link_label_title">Hide full video link label</string>
<string name="revanced_hide_shorts_full_video_link_label_title">Hide video link label</string>
<string name="revanced_hide_shorts_full_video_link_label_summary_on">Video link label is hidden</string>
<string name="revanced_hide_shorts_full_video_link_label_summary_off">Video link label is shown</string>
<string name="revanced_hide_shorts_sound_button_title">Hide sound button</string>
<string name="revanced_hide_shorts_sound_button_title">Hide Sound button</string>
<string name="revanced_hide_shorts_sound_button_summary_on">Sound button is hidden</string>
<string name="revanced_hide_shorts_sound_button_summary_off">Sound button is shown</string>
<string name="revanced_hide_shorts_navigation_bar_title">Hide navigation bar</string>