From 29c7f279ae21f2e7d895387022a33d84caf4f6cc Mon Sep 17 00:00:00 2001 From: dayanch96 <38832025+dayanch96@users.noreply.github.com> Date: Sun, 12 Jun 2022 05:17:32 +0300 Subject: [PATCH] Possibility of localization YTCastConfirm --- uYouPlus.xm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index bccb12a..3cb06ae 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -14,6 +14,8 @@ #import "Tweaks/YouTubeHeader/YTCommonColorPalette.h" #import "Tweaks/YouTubeHeader/ASCollectionView.h" +#define LOC(x) [tweakBundle localizedStringForKey:x value:nil table:nil] + #define YT_BUNDLE_ID @"com.google.ios.youtube" #define YT_NAME @"YouTube" @@ -119,15 +121,16 @@ BOOL ytMiniPlayer() { %hook MDXPlaybackRouteButtonController - (void)didPressButton:(id)arg1 { if (castConfirm()) { - UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting" - message:@"Are you sure you want to start casting?" + NSBundle *tweakBundle = uYouPlusBundle(); + UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:LOC(@"CASTING") + message:LOC(@"MSG_ARE_YOU_SURE") preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { + UIAlertAction* defaultAction = [%c(UIAlertAction) actionWithTitle:LOC(@"MSG_YES") style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { %orig; }]; UIAlertAction* noButton = [%c(UIAlertAction) - actionWithTitle:@"Cancel" + actionWithTitle:LOC(@"MSG_CANCEL") style:UIAlertActionStyleDefault handler: ^(UIAlertAction * action) { return;