Skip to content

Commit

Permalink
feat(YouTube/Hide feed components): add syntax to match whole keyword…
Browse files Browse the repository at this point in the history
…s and not substrings
  • Loading branch information
inotia00 committed Aug 31, 2024
1 parent 15a9d7c commit 28ede81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/resources/youtube/settings/host/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,24 @@ Store"</string>
<string name="revanced_hide_keyword_content_comments_summary_off">Comments are not filtered.</string>
<string name="revanced_hide_keyword_content_phrases_title">Keywords to hide</string>
<string name="revanced_hide_keyword_content_phrases_summary">"Keywords and phrases to hide, separated by new lines.

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)."</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.

Limitations:
Some Shorts may not be hidden.
• Shorts cannot be hidden by channel name.
• Some UI components may not be hidden.
• Searching for a keyword may show no results."</string>
<string name="revanced_hide_keyword_toast_invalid_common">Invalid keyword. Cannot use: \'%s\' as a filter</string>
<string name="revanced_hide_keyword_toast_invalid_keyword">Invalid keyword. \'%1$s\' is less than %2$d characters.</string>
<string name="revanced_hide_keyword_toast_invalid_broad">Keyword \'%1$s\' will hide all videos.</string>
<string name="revanced_hide_keyword_content_about_whole_words_title">Match whole words</string>
<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.&lt;br>&lt;br>For example,&lt;br>&lt;b>\"ai\"&lt;/b> will hide the video: &lt;b>How does AI work?&lt;/b>&lt;br>but will not hide: &lt;b>What does fair use mean?&lt;/b></string>
<string name="revanced_hide_keyword_toast_invalid_common">Cannot use keyword: %s.</string>
<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_conflicting">Keyword has conflicting declarations: %s.</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>

<!-- PreferenceScreen: Feed, PreferenceCategory: Feed, PreferenceScreen: Video filter, PreferenceCategory: Recommended video -->
<string name="revanced_preference_category_recommended_video">Recommended video</string>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/youtube/settings/xml/revanced_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<SwitchPreference android:title="@string/revanced_hide_keyword_content_comments_title" android:key="revanced_hide_keyword_content_comments" android:summaryOn="@string/revanced_hide_keyword_content_comments_summary_on" android:summaryOff="@string/revanced_hide_keyword_content_comments_summary_off" />
<app.revanced.integrations.shared.settings.preference.ResettableEditTextPreference android:title="@string/revanced_hide_keyword_content_phrases_title" android:key="revanced_hide_keyword_content_phrases" android:summary="@string/revanced_hide_keyword_content_phrases_summary" android:inputType="textMultiLine" />
<Preference android:title="@string/revanced_hide_keyword_content_about_title" android:selectable="false" android:summary="@string/revanced_hide_keyword_content_about_summary" />
<app.revanced.integrations.youtube.settings.preference.HtmlPreference android:title="@string/revanced_hide_keyword_content_about_whole_words_title" android:selectable="false" android:summary="@string/revanced_hide_keyword_content_about_whole_words_summary" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/revanced_preference_category_recommended_video" android:layout="@layout/revanced_settings_preferences_category">
<SwitchPreference android:title="@string/revanced_hide_recommended_video_title" android:key="revanced_hide_recommended_video" android:summary="@string/revanced_hide_recommended_video_summary" />
Expand Down

0 comments on commit 28ede81

Please sign in to comment.