From 181bcb1221f6b3add7d0ce20499a07b78db2490d Mon Sep 17 00:00:00 2001 From: ILoveOpenSourceApplications <117499019+ILoveOpenSourceApplications@users.noreply.github.com> Date: Sun, 19 Jan 2025 13:16:03 +0530 Subject: [PATCH] chore: Clarify strings (#130) * chore: Clarify string * feat: Apply code review suggestions * fix typo * Make dislikes description consistent * Revert removal of Shorts dislikes disclaimer * feat: Apply code review suggestions * feat: Apply code review suggestions --------- Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com> --- .../general/OpenChannelOfLiveAvatarPatch.java | 8 +++--- .../extension/youtube/settings/Settings.java | 4 +-- .../patches/music/utils/patch/PatchList.kt | 4 +-- .../patches/reddit/utils/patch/PatchList.kt | 2 +- .../general/layoutswitch/LayoutSwitchPatch.kt | 10 +++---- .../{channel => livering}/Fingerprints.kt | 2 +- .../OpenChannelOfLiveAvatarPatch.kt | 14 +++++----- .../patches/youtube/utils/patch/PatchList.kt | 22 ++++++++-------- .../youtube/settings/host/values/strings.xml | 26 ++++++++++--------- .../youtube/settings/xml/revanced_prefs.xml | 12 ++++----- 10 files changed, 53 insertions(+), 51 deletions(-) rename patches/src/main/kotlin/app/revanced/patches/youtube/general/{channel => livering}/Fingerprints.kt (96%) rename patches/src/main/kotlin/app/revanced/patches/youtube/general/{channel => livering}/OpenChannelOfLiveAvatarPatch.kt (90%) diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/general/OpenChannelOfLiveAvatarPatch.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/general/OpenChannelOfLiveAvatarPatch.java index 2334d738f..4acf4e346 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/general/OpenChannelOfLiveAvatarPatch.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/general/OpenChannelOfLiveAvatarPatch.java @@ -7,8 +7,8 @@ import app.revanced.extension.youtube.utils.VideoUtils; @SuppressWarnings("unused") public final class OpenChannelOfLiveAvatarPatch { - private static final boolean OPEN_CHANNEL_OF_LIVE_AVATAR = - Settings.OPEN_CHANNEL_OF_LIVE_AVATAR.get(); + private static final boolean CHANGE_LIVE_RING_CLICK_ACTION = + Settings.CHANGE_LIVE_RING_CLICK_ACTION.get(); private static volatile String videoId = ""; private static volatile boolean liveChannelAvatarClicked = false; @@ -19,7 +19,7 @@ public final class OpenChannelOfLiveAvatarPatch { public static boolean openChannelOfLiveAvatar() { try { - if (!OPEN_CHANNEL_OF_LIVE_AVATAR) { + if (!CHANGE_LIVE_RING_CLICK_ACTION) { return false; } if (!liveChannelAvatarClicked) { @@ -42,7 +42,7 @@ public final class OpenChannelOfLiveAvatarPatch { public static void openChannelOfLiveAvatar(String newlyLoadedVideoId) { try { - if (!OPEN_CHANNEL_OF_LIVE_AVATAR) { + if (!CHANGE_LIVE_RING_CLICK_ACTION) { return; } if (newlyLoadedVideoId.isEmpty()) { diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java index d0308ca88..5bfbf8bc4 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/settings/Settings.java @@ -156,7 +156,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting REMOVE_VIEWER_DISCRETION_DIALOG = new BooleanSetting("revanced_remove_viewer_discretion_dialog", FALSE); public static final EnumSetting CHANGE_LAYOUT = new EnumSetting<>("revanced_change_layout", FormFactor.ORIGINAL, true); - public static final BooleanSetting OPEN_CHANNEL_OF_LIVE_AVATAR = new BooleanSetting("revanced_open_channel_of_live_avatar", FALSE, true); + public static final BooleanSetting CHANGE_LIVE_RING_CLICK_ACTION = new BooleanSetting("revanced_change_live_ring_click_action", FALSE, true); public static final BooleanSetting SPOOF_APP_VERSION = new BooleanSetting("revanced_spoof_app_version", false, true, "revanced_spoof_app_version_user_dialog_message"); public static final StringSetting SPOOF_APP_VERSION_TARGET = new StringSetting("revanced_spoof_app_version_target", PatchStatus.SpoofAppVersionDefaultString(), true, parent(SPOOF_APP_VERSION)); @@ -236,7 +236,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting CHANGE_YOUTUBE_HEADER = new BooleanSetting("revanced_change_youtube_header", TRUE, true); public static final BooleanSetting ENABLE_WIDE_SEARCH_BAR = new BooleanSetting("revanced_enable_wide_search_bar", FALSE, true); public static final BooleanSetting ENABLE_WIDE_SEARCH_BAR_WITH_HEADER = new BooleanSetting("revanced_enable_wide_search_bar_with_header", TRUE, true); - public static final BooleanSetting ENABLE_WIDE_SEARCH_BAR_IN_YOU_TAB = new BooleanSetting("revanced_enable_wide_search_bar_in_you_tab", FALSE, true); + public static final BooleanSetting ENABLE_WIDE_SEARCH_BAR_IN_YOU_TAB = new BooleanSetting("revanced_enable_wide_search_bar_in_you_tab", FALSE, true, "revanced_enable_wide_search_bar_in_you_tab_user_dialog_message"); public static final BooleanSetting HIDE_TOOLBAR_CAST_BUTTON = new BooleanSetting("revanced_hide_toolbar_cast_button", TRUE, true); public static final BooleanSetting HIDE_TOOLBAR_CREATE_BUTTON = new BooleanSetting("revanced_hide_toolbar_create_button", FALSE, true); public static final BooleanSetting HIDE_TOOLBAR_NOTIFICATION_BUTTON = new BooleanSetting("revanced_hide_toolbar_notification_button", FALSE, true); diff --git a/patches/src/main/kotlin/app/revanced/patches/music/utils/patch/PatchList.kt b/patches/src/main/kotlin/app/revanced/patches/music/utils/patch/PatchList.kt index 6997a432b..bb89a82b8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/utils/patch/PatchList.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/utils/patch/PatchList.kt @@ -31,7 +31,7 @@ internal enum class PatchList( ), CUSTOM_BRANDING_NAME_FOR_YOUTUBE_MUSIC( "Custom branding name for YouTube Music", - "Renames the YouTube Music app to the name specified in patch options." + "Changes the YouTube Music app name to the name specified in patch options." ), CUSTOM_HEADER_FOR_YOUTUBE_MUSIC( "Custom header for YouTube Music", @@ -63,7 +63,7 @@ internal enum class PatchList( ), ENABLE_OPUS_CODEC( "Enable OPUS codec", - "Adds an options to enable the OPUS audio codec if the player response includes it." + "Adds an option to enable the OPUS audio codec if the player response includes it." ), ENABLE_DEBUG_LOGGING( "Enable debug logging", diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/patch/PatchList.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/patch/PatchList.kt index 71d43a7f3..98a0e3fae 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/utils/patch/PatchList.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/utils/patch/PatchList.kt @@ -11,7 +11,7 @@ internal enum class PatchList( ), CUSTOM_BRANDING_NAME_FOR_REDDIT( "Custom branding name for Reddit", - "Renames the Reddit app to the name specified in patch options." + "Changes the Reddit app name to the name specified in patch options." ), DISABLE_SCREENSHOT_POPUP( "Disable screenshot popup", diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/general/layoutswitch/LayoutSwitchPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/general/layoutswitch/LayoutSwitchPatch.kt index ec4891efa..26ec6af6d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/general/layoutswitch/LayoutSwitchPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/general/layoutswitch/LayoutSwitchPatch.kt @@ -6,7 +6,7 @@ import app.revanced.patcher.patch.bytecodePatch import app.revanced.patches.shared.createPlayerRequestBodyWithModelFingerprint import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.youtube.utils.extension.Constants.GENERAL_PATH -import app.revanced.patches.youtube.utils.patch.PatchList.LAYOUT_SWITCH +import app.revanced.patches.youtube.utils.patch.PatchList.CHANGE_LAYOUT import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference import app.revanced.patches.youtube.utils.settings.settingsPatch import app.revanced.util.fingerprint.definingClassOrThrow @@ -24,8 +24,8 @@ private const val EXTENSION_CLASS_DESCRIPTOR = @Suppress("unused") val layoutSwitchPatch = bytecodePatch( - LAYOUT_SWITCH.title, - LAYOUT_SWITCH.summary, + CHANGE_LAYOUT.title, + CHANGE_LAYOUT.summary, ) { compatibleWith(COMPATIBLE_PACKAGE) @@ -71,9 +71,9 @@ val layoutSwitchPatch = bytecodePatch( arrayOf( "PREFERENCE_SCREEN: GENERAL", "PREFERENCE_CATEGORY: GENERAL_EXPERIMENTAL_FLAGS", - "SETTINGS: LAYOUT_SWITCH" + "SETTINGS: CHANGE_LAYOUT" ), - LAYOUT_SWITCH + CHANGE_LAYOUT ) // endregion diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/Fingerprints.kt similarity index 96% rename from patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/Fingerprints.kt rename to patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/Fingerprints.kt index 9a8dc13b4..873ef9df8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/Fingerprints.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.general.channel +package app.revanced.patches.youtube.general.livering import app.revanced.patches.youtube.utils.resourceid.elementsImage import app.revanced.util.fingerprint.legacyFingerprint diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/OpenChannelOfLiveAvatarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/OpenChannelOfLiveAvatarPatch.kt similarity index 90% rename from patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/OpenChannelOfLiveAvatarPatch.kt rename to patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/OpenChannelOfLiveAvatarPatch.kt index 27ed05a0a..8c8a1a95f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/general/channel/OpenChannelOfLiveAvatarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/general/livering/OpenChannelOfLiveAvatarPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.general.channel +package app.revanced.patches.youtube.general.livering import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -7,7 +7,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.bytecodePatch import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE import app.revanced.patches.youtube.utils.extension.Constants.GENERAL_PATH -import app.revanced.patches.youtube.utils.patch.PatchList.OPEN_CHANNEL_OF_LIVE_AVATAR +import app.revanced.patches.youtube.utils.patch.PatchList.CHANGE_LIVE_RING_CLICK_ACTION import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference import app.revanced.patches.youtube.utils.settings.settingsPatch @@ -23,9 +23,9 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "$GENERAL_PATH/OpenChannelOfLiveAvatarPatch;" @Suppress("unused") -val layoutSwitchPatch = bytecodePatch( - OPEN_CHANNEL_OF_LIVE_AVATAR.title, - OPEN_CHANNEL_OF_LIVE_AVATAR.summary, +val openChannelOfLiveAvatarPatch = bytecodePatch( + CHANGE_LIVE_RING_CLICK_ACTION.title, + CHANGE_LIVE_RING_CLICK_ACTION.summary, ) { compatibleWith(COMPATIBLE_PACKAGE) @@ -79,9 +79,9 @@ val layoutSwitchPatch = bytecodePatch( arrayOf( "PREFERENCE_SCREEN: GENERAL", "PREFERENCE_CATEGORY: GENERAL_EXPERIMENTAL_FLAGS", - "SETTINGS: OPEN_CHANNEL_OF_LIVE_AVATAR" + "SETTINGS: CHANGE_LIVE_RING_CLICK_ACTION" ), - OPEN_CHANNEL_OF_LIVE_AVATAR + CHANGE_LIVE_RING_CLICK_ACTION ) // endregion diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/patch/PatchList.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/patch/PatchList.kt index 7808865a4..295d97ecd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/patch/PatchList.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/patch/PatchList.kt @@ -21,6 +21,14 @@ internal enum class PatchList( "Bypass URL redirects", "Adds an option to bypass URL redirects and open the original URL directly." ), + CHANGE_LAYOUT( + "Change layout", + "Adds an option to change the dp in order to use a tablet or phone layout." + ), + CHANGE_LIVE_RING_CLICK_ACTION( + "Change live ring click action", + "Adds an option to open the channel instead of the live stream when clicking on the live ring." + ), CHANGE_PLAYER_FLYOUT_MENU_TOGGLES( "Change player flyout menu toggles", "Adds an option to use text toggles instead of switch toggles within the additional settings menu." @@ -43,7 +51,7 @@ internal enum class PatchList( ), CUSTOM_BRANDING_NAME_FOR_YOUTUBE( "Custom branding name for YouTube", - "Renames the YouTube app to the name specified in patch options." + "Changes the YouTube app name to the name specified in patch options." ), CUSTOM_DOUBLE_TAP_LENGTH( "Custom double tap length", @@ -83,7 +91,7 @@ internal enum class PatchList( ), ENABLE_OPUS_CODEC( "Enable OPUS codec", - "Adds an options to enable the OPUS audio codec if the player response includes it." + "Adds an option to enable the OPUS audio codec if the player response includes it." ), ENABLE_DEBUG_LOGGING( "Enable debug logging", @@ -153,10 +161,6 @@ internal enum class PatchList( "Hook download actions", "Adds support to download videos with an external downloader app using the in-app download button." ), - LAYOUT_SWITCH( - "Layout switch", - "Adds an option to spoof the dpi in order to use a tablet or phone layout." - ), MATERIALYOU( "MaterialYou", "Applies the MaterialYou theme for Android 12+ devices." @@ -169,13 +173,9 @@ internal enum class PatchList( "Navigation bar components", "Adds options to hide or change components related to the navigation bar." ), - OPEN_CHANNEL_OF_LIVE_AVATAR( - "Open channel of live avatar", - "Adds an option to open channel instead of video when clicking on live avatar." - ), OPEN_LINKS_EXTERNALLY( "Open links externally", - "Adds an option to always open links in your browser instead of in the in-app-browser." + "Adds an option to always open links in your browser instead of the in-app browser." ), OVERLAY_BUTTONS( "Overlay buttons", diff --git a/patches/src/main/resources/youtube/settings/host/values/strings.xml b/patches/src/main/resources/youtube/settings/host/values/strings.xml index efabe2245..e722f2ca6 100644 --- a/patches/src/main/resources/youtube/settings/host/values/strings.xml +++ b/patches/src/main/resources/youtube/settings/host/values/strings.xml @@ -437,9 +437,9 @@ This does not bypass the age restriction. It just accepts it automatically."Phone (Max 480 dp) Tablet Tablet (Min 600 dp) - Open channel of live avatar - Channel opens when the live avatar is clicked. - Live stream opens when the live avatar is clicked. + Change live ring click action + Channel opens when the live ring is clicked. + Live stream opens when the live ring is clicked. Spoof app version Version spoofed Version not spoofed @@ -694,9 +694,11 @@ If this setting do not take effect, try switching to Incognito mode." To access settings, please use the following path: You tab → View channel → Menu → Settings" - "Wide search bar is disabled in the You tab. - -Enabling this setting will disable the Settings button in the You tab." + Wide search bar is disabled in the You tab. + "Enabling this setting will disable the Settings button in the You tab. + +In this case, you may need to use the following path to access the settings: +You tab → View channel → Menu → Settings" Hide Cast button Cast button is hidden. Cast button is shown. @@ -1653,14 +1655,14 @@ A different codec will be applied after about 20 seconds of buffering." Dislikes are shown. Dislikes are not shown. Show dislikes on Shorts - Dislikes shown on Shorts. - "Dislikes shown on Shorts. + Dislikes are shown on Shorts. + "Dislikes are shown on Shorts. Limitation: Dislikes may not appear if the user is not logged in or in incognito mode." - Dislikes hidden on Shorts. + Dislikes are hidden on Shorts. Dislikes as percentage - Dislikes shown as a percentage. - Dislikes shown as a number. + Dislikes are shown as a percentage. + Dislikes are shown as a number. Compact Like button Like button styled for minimum width. Like button styled for best appearance. @@ -1923,7 +1925,7 @@ Click to see how to issue an API key." Enable debug buffer logging Debug logs include the buffer. Debug logs do not include the buffer. - Open links in browser + Open links externally Opens links in the external browser. Opens links in the in-app browser. Sanitize sharing links diff --git a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml index fea513cbb..bac38b8c6 100644 --- a/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/patches/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -301,11 +301,11 @@ - + - +