mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(YouTube - Keyword filter): Add syntax to match whole keywords and not substrings (#3592)
This commit is contained in:
parent
009c3e4170
commit
f5fb3512cf
2 changed files with 14 additions and 8 deletions
|
@ -138,8 +138,10 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
||||||
SwitchPreference("revanced_hide_keyword_content_search"),
|
SwitchPreference("revanced_hide_keyword_content_search"),
|
||||||
TextPreference("revanced_hide_keyword_content_phrases", inputType = InputType.TEXT_MULTI_LINE),
|
TextPreference("revanced_hide_keyword_content_phrases", inputType = InputType.TEXT_MULTI_LINE),
|
||||||
NonInteractivePreference("revanced_hide_keyword_content_about"),
|
NonInteractivePreference("revanced_hide_keyword_content_about"),
|
||||||
),
|
NonInteractivePreference(key = "revanced_hide_keyword_content_about_whole_words",
|
||||||
),
|
tag = "app.revanced.integrations.youtube.settings.preference.HtmlPreference")
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences(
|
||||||
|
|
|
@ -244,14 +244,18 @@ This is because Crowdin requires temporarily flattening this file and removing t
|
||||||
<string name="revanced_hide_keyword_content_phrases_title">Keywords to hide</string>
|
<string name="revanced_hide_keyword_content_phrases_title">Keywords to hide</string>
|
||||||
<!-- For localization it is preferred, but not required, if 'LeBlanc' is replaced with a localized name or a familiar word that has upper case letters in the middle of the word.
|
<!-- For localization it is preferred, but not required, if 'LeBlanc' is replaced with a localized name or a familiar word that has upper case letters in the middle of the word.
|
||||||
This is because keywords can be in any language, and showing an example in the localized script helps convey this. -->
|
This is because keywords can be in any language, and showing an example in the localized script helps convey this. -->
|
||||||
<string name="revanced_hide_keyword_content_phrases_summary">Keywords and phrases to hide, separated by new lines\n\nWords with uppercase letters in the middle must be entered with the casing (ie: iPhone, TikTok, LeBlanc)</string>
|
<string name="revanced_hide_keyword_content_phrases_summary">Keywords and phrases to hide, separated by new lines\n\nKeywords can be channel names or any text shown in video titles\n\nWords with uppercase letters in the middle must be entered with the casing (ie: iPhone, TikTok, LeBlanc)</string>
|
||||||
<string name="revanced_hide_keyword_content_about_title">About keyword filtering</string>
|
<string name="revanced_hide_keyword_content_about_title">About keyword filtering</string>
|
||||||
<string name="revanced_hide_keyword_content_about_summary">Home/Subscription/Search results are filtered to hide content that matches keyword phrases\n\nLimitations\n• Some Shorts may not be hidden\n• Some UI components may not be hidden\n• Searching for a keyword may show no results</string>
|
<string name="revanced_hide_keyword_content_about_summary">Home/Subscription/Search results are filtered to hide content that matches keyword phrases\n\nLimitations\n• Shorts cannot be hidden by channel name\n• Some UI components may not be hidden\n• Searching for a keyword may show no results</string>
|
||||||
|
<string name="revanced_hide_keyword_content_about_whole_words_title">Match whole words</string>
|
||||||
|
<!-- Translations _must_ use a localized example. For languages that do not use spaces between words (Chinese, Japanese, etc) the English AI example should be used since no localized examples exist. Or if using machine translations, or if nobody wants to think of a localized example, then the English 'ai' example should be left as-is. -->
|
||||||
|
<string name="revanced_hide_keyword_content_about_whole_words_summary">Surrounding a keyword/phrase with double-quotes will prevent partial matches of video titles and channel names<br><br>For example,<br><b>\"ai\"</b> will hide the video: <b>How does AI work?</b><br>but will not hide: <b>What does fair use mean?</b></string>
|
||||||
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
|
<!-- 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_keyword_toast_invalid_common">Invalid keyword. Cannot use: \'%s\' as a filter</string>
|
<string name="revanced_hide_keyword_toast_invalid_common">Cannot use keyword: %s</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_keyword_toast_invalid_common_whole_word_required">Add quotes to use keyword: %s</string>
|
||||||
<string name="revanced_hide_keyword_toast_invalid_length">Invalid keyword. \'%1$s\' is less than %2$d characters</string>
|
<string name="revanced_hide_keyword_toast_invalid_conflicting">Keyword has conflicting declarations: %s</string>
|
||||||
<string name="revanced_hide_keyword_toast_invalid_broad">Keyword \'%s\' will hide all videos</string>
|
<string name="revanced_hide_keyword_toast_invalid_length">Keyword is too short and requires quotes: %s</string>
|
||||||
|
<string name="revanced_hide_keyword_toast_invalid_broad">Keyword will hide all videos: %s</string>
|
||||||
</patch>
|
</patch>
|
||||||
<patch id="ad.general.HideAdsResourcePatch">
|
<patch id="ad.general.HideAdsResourcePatch">
|
||||||
<string name="revanced_hide_general_ads_title">Hide general ads</string>
|
<string name="revanced_hide_general_ads_title">Hide general ads</string>
|
||||||
|
|
Loading…
Reference in a new issue