Skip to content

Commit

Permalink
fix: Patch error due to invalid strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco146 committed Jul 6, 2024
1 parent 1dfce08 commit 5069303
Show file tree
Hide file tree
Showing 27 changed files with 162 additions and 165 deletions.
2 changes: 1 addition & 1 deletion api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ public final class app/revanced/util/ResourceUtilsKt {
public static final fun copyFile (Lapp/revanced/patcher/data/ResourceContext;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Z
public static final fun copyResources (Lapp/revanced/patcher/data/ResourceContext;Ljava/lang/String;[Lapp/revanced/util/ResourceGroup;)V
public static final fun copyResourcesWithRename (Lapp/revanced/patcher/data/ResourceContext;Ljava/lang/String;Ljava/util/Map;)V
public static final fun copyXmlNode (Lapp/revanced/patcher/data/ResourceContext;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public static final fun copyXmlNode (Lapp/revanced/patcher/data/ResourceContext;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lkotlin/Unit;
public static final fun copyXmlNode (Ljava/lang/String;Lapp/revanced/patcher/util/DomFileEditor;Lapp/revanced/patcher/util/DomFileEditor;)Ljava/lang/AutoCloseable;
public static final fun doRecursively (Lorg/w3c/dom/Node;Lkotlin/jvm/functions/Function1;)V
public static final fun getClassLoader ()Ljava/lang/ClassLoader;
Expand Down
9 changes: 5 additions & 4 deletions src/main/kotlin/app/revanced/util/ResourceUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,14 @@ fun ResourceContext.copyXmlNode(
resourceDirectory: String,
targetResource: String,
elementTag: String
) {
val stringsResourceInputStream =
inputStreamFromBundledResource(resourceDirectory, targetResource)!!
) = inputStreamFromBundledResource(
resourceDirectory,
targetResource
)?.let { inputStream ->

// Copy nodes from the resources node to the real resource node
elementTag.copyXmlNode(
this.xmlEditor[stringsResourceInputStream],
this.xmlEditor[inputStream],
this.xmlEditor["res/$targetResource"]
).close()
}
Expand Down
50 changes: 25 additions & 25 deletions src/main/resources/youtube/settings/host/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ Words with uppercase letters in the middle must be entered with the casing (ie:
<string name="revanced_hide_keyword_toast_invalid_broad">Keyword \'%1$s\' will hide all videos.</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_length">Invalid keyword. \'%1$s\' is less than %2$d characters</string>
<string name="revanced_hide_latest_posts_summary_off">Latest posts are shown.</string>
<string name="revanced_hide_latest_posts_summary_on">Latest posts are hidden.</string>
<string name="revanced_hide_latest_posts_title">Hide latest posts</string>
Expand Down Expand Up @@ -696,6 +697,9 @@ Words with uppercase letters in the middle must be entered with the casing (ie:
<string name="revanced_hide_quick_actions_open_playlist_button_summary_off">Open playlist button is shown.</string>
<string name="revanced_hide_quick_actions_open_playlist_button_summary_on">Open playlist button is hidden.</string>
<string name="revanced_hide_quick_actions_open_playlist_button_title">Hide open playlist button</string>
<string name="revanced_hide_quick_actions_related_videos_summary_off">Related videos are shown.</string>
<string name="revanced_hide_quick_actions_related_videos_summary_on">Related videos are hidden.</string>
<string name="revanced_hide_quick_actions_related_videos_title">Hide related videos in quick actions</string>
<string name="revanced_hide_quick_actions_save_to_playlist_button_summary_off">Save to playlist button is shown.</string>
<string name="revanced_hide_quick_actions_save_to_playlist_button_summary_on">Save to playlist button is hidden.</string>
<string name="revanced_hide_quick_actions_save_to_playlist_button_title">Hide save to playlist button</string>
Expand Down Expand Up @@ -872,6 +876,12 @@ Limitation: Official headers in search results will be hidden."</string>
<string name="revanced_hide_suggested_actions_summary_off">Suggested actions shown.</string>
<string name="revanced_hide_suggested_actions_summary_on">Suggested actions hidden.</string>
<string name="revanced_hide_suggested_actions_title">Hide suggested actions</string>
<string name="revanced_hide_suggested_video_end_screen_summary">"This setting has been deprecated.

Instead, use the 'Settings → Autoplay → Autoplay next video' setting.

Note:
• If you have any issues with 'Suggested video end screen', try restarting the app."</string>
<string name="revanced_hide_suggested_video_end_screen_summary_off">Suggested video end screen is shown.</string>
<string name="revanced_hide_suggested_video_end_screen_summary_on">"Suggested video end screen is hidden when autoplay is turned off.

Expand Down Expand Up @@ -905,6 +915,9 @@ Settings → Autoplay → Autoplay next video"</string>
<string name="revanced_hide_transcript_section_summary_off">Transcript sections are shown.</string>
<string name="revanced_hide_transcript_section_summary_on">Transcript sections are hidden.</string>
<string name="revanced_hide_transcript_section_title">Hide transcript sections</string>
<string name="revanced_hide_trending_searches_summary_off">Trending searches are shown.</string>
<string name="revanced_hide_trending_searches_summary_on">Trending searches are hidden.</string>
<string name="revanced_hide_trending_searches_title">Hide trending searches</string>
<string name="revanced_hide_video_ads_summary_off">Video ads are shown.</string>
<string name="revanced_hide_video_ads_summary_on">Video ads are hidden.</string>
<string name="revanced_hide_video_ads_title">Hide video ads</string>
Expand All @@ -923,6 +936,8 @@ Settings → Autoplay → Autoplay next video"</string>
<string name="revanced_hide_video_view_counts_multiplier_default_value">K -&gt; 1 000\nM -&gt; 1 000 000\nB -&gt; 1 000 000 000\nviews -&gt; views</string>
<string name="revanced_hide_video_view_counts_multiplier_summary">Specify your language template for the number of views shown under each video in the user interface. Each key (a letter/word in your language) -&gt; value (meaning of the key) must be on a new line. Keys go before "-&gt;" sign. If you switch app or system language you have to reset this setting.\n\nExamples:\nEnglish: 10K views = K -&gt; 1000, views -&gt; views\nSpanish: 10 K vistas = K -&gt; 1000, vistas -&gt; views</string>
<string name="revanced_hide_video_view_counts_multiplier_title">View keys</string>
<string name="revanced_hide_video_view_counts_summary">Recommended videos with views less than this number will be hidden.</string>
<string name="revanced_hide_video_view_counts_title">Number of views</string>
<string name="revanced_hide_view_products_summary_off">View products banner is shown.</string>
<string name="revanced_hide_view_products_summary_on">View products banner is hidden.</string>
<string name="revanced_hide_view_products_title">Hide view products banner</string>
Expand Down Expand Up @@ -1027,6 +1042,8 @@ Tap and hold to open whitelist setting dialog.</string>
<string name="revanced_preference_category_view_counts_filter">View count filter</string>
<string name="revanced_preference_screen_account_menu_summary">Hide or show elements in account menu and You tab.</string>
<string name="revanced_preference_screen_account_menu_title">Account menu</string>
<string name="revanced_preference_screen_account_munu_summary">Hide or show elements in account menu and You tab.</string>
<string name="revanced_preference_screen_account_munu_title">Account menu</string>
<string name="revanced_preference_screen_action_buttons_summary">Hide or show action buttons under videos.</string>
<string name="revanced_preference_screen_action_buttons_title">Action buttons</string>
<string name="revanced_preference_screen_ads_title">Ads</string>
Expand Down Expand Up @@ -1073,6 +1090,8 @@ Tap and hold to open whitelist setting dialog.</string>
<string name="revanced_preference_screen_seekbar_title">Seekbar</string>
<string name="revanced_preference_screen_settings_menu_summary">Hide elements of the YouTube settings menu.</string>
<string name="revanced_preference_screen_settings_menu_title">Settings menu</string>
<string name="revanced_preference_screen_settings_munu_summary">Hide elements in YouTube settings menu.</string>
<string name="revanced_preference_screen_settings_munu_title">Settings menu</string>
<string name="revanced_preference_screen_shorts_player_summary">Hide or show components in the shorts player.</string>
<string name="revanced_preference_screen_shorts_player_title">Shorts player</string>
<string name="revanced_preference_screen_shorts_title">Shorts</string>
Expand Down Expand Up @@ -1218,6 +1237,7 @@ Limitation: Dislikes may not appear in incognito mode."</string>
<string name="revanced_sb_guidelines_preference_sum">Guidelines contain rules and tips for creating new segments.</string>
<string name="revanced_sb_guidelines_preference_title">View guidelines</string>
<string name="revanced_sb_new_segment_choose_category">Choose the segment category</string>
<string name="revanced_sb_new_segment_confirm_content">The segment lasts from %1$02d:%2$02d to %3$02d:%4$02d (%5$d minutes %6$02d seconds)\nIs it ready to submit?</string>
<string name="revanced_sb_new_segment_confirm_contents">The segment is from\n\n%1$s\nto\n%2$s\n\n(%3$s)\n\nReady to submit?</string>
<string name="revanced_sb_new_segment_confirm_title">Are the times correct?</string>
<string name="revanced_sb_new_segment_disabled_category">Category is disabled in settings. Enable category to submit.</string>
Expand Down Expand Up @@ -1492,6 +1512,11 @@ Limitations:
• Offline downloads may not work.
• Video may not start from the last watched time."</string>
<string name="revanced_spoof_player_parameter_title">Spoof player parameter</string>
<string name="revanced_spoof_test_client_summary">"Spoof the client as a test client.

• This client is used for testing purposes, so most YouTube features are not available.
• There are no playback buffer issues in the test client."</string>
<string name="revanced_spoof_test_client_title">Spoof test client</string>
<string name="revanced_swipe_gestures_lock_mode_summary_off">"Swipe gestures are disabled in 'Lock screen' mode."</string>
<string name="revanced_swipe_gestures_lock_mode_summary_on">"Swipe gestures are enabled in 'Lock screen' mode."</string>
<string name="revanced_swipe_gestures_lock_mode_title">"Swipe gestures in 'Lock screen' mode"</string>
Expand Down Expand Up @@ -1528,29 +1553,4 @@ Limitations:
<string name="revanced_whitelist_settings_summary">Check or remove the list of channels added to the whitelist.</string>
<string name="revanced_whitelist_settings_title">Channel whitelist</string>
<string name="revanced_whitelist_sponsor_block">SponsorBlock</string>
<string name="revanced_hide_keyword_toast_invalid_length">Invalid keyword. \'%1$s\' is less than %2$d characters</string>
<string name="revanced_hide_video_view_counts_title">Number of views</string>
<string name="revanced_hide_video_view_counts_summary">Recommended videos with views less than this number will be hidden.</string>
<string name="revanced_preference_screen_account_munu_title">Account menu</string>
<string name="revanced_preference_screen_account_munu_summary">Hide or show elements in account menu and You tab.</string>
<string name="revanced_preference_screen_settings_munu_title">Settings menu</string>
<string name="revanced_preference_screen_settings_munu_summary">Hide elements in YouTube settings menu.</string>
<string name="revanced_hide_trending_searches_title">Hide trending searches</string>
<string name="revanced_hide_trending_searches_summary_on">Trending searches are hidden.</string>
<string name="revanced_hide_trending_searches_summary_off">Trending searches are shown.</string>
<string name="revanced_hide_suggested_video_end_screen_summary">"This setting has been deprecated.

Instead, use the 'Settings → Autoplay → Autoplay next video' setting.

Note:
• If you have any issues with 'Suggested video end screen', try restarting the app."</string>
<string name="revanced_hide_quick_actions_related_videos_title">Hide related videos in quick actions</string>
<string name="revanced_hide_quick_actions_related_videos_summary_on">Related videos are hidden.</string>
<string name="revanced_hide_quick_actions_related_videos_summary_off">Related videos are shown.</string>
<string name="revanced_sb_new_segment_confirm_content">The segment lasts from %1$02d:%2$02d to %3$02d:%4$02d (%5$d minutes %6$02d seconds)\nIs it ready to submit?</string>
<string name="revanced_spoof_test_client_title">Spoof test client</string>
<string name="revanced_spoof_test_client_summary">"Spoof the client as a test client.

• This client is used for testing purposes, so most YouTube features are not available.
• There are no playback buffer issues in the test client."</string>
</resources>
8 changes: 4 additions & 4 deletions src/main/resources/youtube/translations/ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@
<string name="revanced_hide_keyword_toast_invalid_broad">الكلمة الرئيسية \'%1$s\' ستؤدي إلى إخفاء جميع مقاطع الفيديو.</string>
<string name="revanced_hide_keyword_toast_invalid_common">الكلمة الرئيسية غير صالحة. لا يمكن استخدام: \'%s\' كعامل تصفية</string>
<string name="revanced_hide_keyword_toast_invalid_keyword">الكلمة الرئيسية غير صالحة. \'%1$s\' أقل من %2$d حرف.</string>
<string name="revanced_hide_keyword_toast_invalid_length">الكلمة الرئيسية غير صالحة. \'%1$s\' أقل من %2$d حرفًا</string>
<string name="revanced_hide_latest_posts_summary_off">يتم عرض أحدث المشاركات.</string>
<string name="revanced_hide_latest_posts_summary_on">تم إخفاء أحدث المشاركات.</string>
<string name="revanced_hide_latest_posts_title">إخفاء آخر المشاركات</string>
Expand Down Expand Up @@ -927,6 +928,8 @@
<string name="revanced_hide_video_view_counts_multiplier_default_value">K -&gt; 1 000\nM -&gt; 1 000 000\nB -&gt; 1 000 000 000\nمشاهد -&gt; مشاهد</string>
<string name="revanced_hide_video_view_counts_multiplier_summary">حدد قالب اللغة الخاص بك لعدد مرات المشاهدة الموضحة أسفل كل فيديو في واجهة المستخدم. كل مفتاح (حرف/كلمة في لغتك) -&gt; قيمة (معنى المفتاح) يجب أن يكون على سطر جديد. المفاتيح تذهب قبل \"-&gt;\" علامة. إذا قمت بتبديل التطبيق أو لغة النظام، فيجب عليك إعادة تعيين هذا الإعداد.\n\nأمثلة:\nEnglish: 10K views = K -&gt; 1000, views -&gt; views\nSpanish: 10 K vistas = K -&gt; 1000, vistas -&gt; views</string>
<string name="revanced_hide_video_view_counts_multiplier_title">عرض المفاتيح</string>
<string name="revanced_hide_video_view_counts_summary">سيتم إخفاء الفيديوهات الموصى بها والتي حصلت على مشاهدات أقل من هذا الرقم.</string>
<string name="revanced_hide_video_view_counts_title">عدد المشاهدات</string>
<string name="revanced_hide_view_products_summary_off">يتم عرض لافتة عرض المنتجات.</string>
<string name="revanced_hide_view_products_summary_on">تم إخفاء لافتة عرض المنتجات.</string>
<string name="revanced_hide_view_products_title">إخفاء لافتة عرض المنتجات</string>
Expand Down Expand Up @@ -1213,6 +1216,7 @@
<string name="revanced_sb_guidelines_preference_sum">الإرشادات تحتوي على نصائح حول تقديم المقاطع.</string>
<string name="revanced_sb_guidelines_preference_title">عرض الإرشادات</string>
<string name="revanced_sb_new_segment_choose_category">اختر فئة المقطع</string>
<string name="revanced_sb_new_segment_confirm_content">المقطع يدوم من %1$02d:%2$02d إلى %3$02d:%4$02d (%5$d دقيقة %6$02d ثانية)\nهل هو جاهز للإرسال؟</string>
<string name="revanced_sb_new_segment_confirm_contents">المقطع من\n\n%1$s\nإلى\n%2$s\n\n(%3$s)\n\nجاهز للإرسال؟</string>
<string name="revanced_sb_new_segment_confirm_title">هل الأوقات صحيحة؟</string>
<string name="revanced_sb_new_segment_disabled_category">الفئة معطلة في الإعدادات. تمكين الفئة للإرسال.</string>
Expand Down Expand Up @@ -1536,8 +1540,4 @@
<string name="revanced_whitelist_settings_summary">التحقق من قائمة القنوات المضافة إلى القائمة البيضاء أو إزالتها.</string>
<string name="revanced_whitelist_settings_title">قائمة القناة البيضاء</string>
<string name="revanced_whitelist_sponsor_block">SponsorBlock</string>
<string name="revanced_hide_keyword_toast_invalid_length">الكلمة الرئيسية غير صالحة. \'%1$s\' أقل من %2$d حرفًا</string>
<string name="revanced_hide_video_view_counts_title">عدد المشاهدات</string>
<string name="revanced_hide_video_view_counts_summary">سيتم إخفاء الفيديوهات الموصى بها والتي حصلت على مشاهدات أقل من هذا الرقم.</string>
<string name="revanced_sb_new_segment_confirm_content">المقطع يدوم من %1$02d:%2$02d إلى %3$02d:%4$02d (%5$d دقيقة %6$02d ثانية)\nهل هو جاهز للإرسال؟</string>
</resources>
Loading

0 comments on commit 5069303

Please sign in to comment.