Possibility of localization YTCastConfirm

This commit is contained in:
dayanch96
2022-06-12 05:17:32 +03:00
committed by GitHub
parent e870be2f52
commit 29c7f279ae
+7 -4
View File
@@ -14,6 +14,8 @@
#import "Tweaks/YouTubeHeader/YTCommonColorPalette.h" #import "Tweaks/YouTubeHeader/YTCommonColorPalette.h"
#import "Tweaks/YouTubeHeader/ASCollectionView.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_BUNDLE_ID @"com.google.ios.youtube"
#define YT_NAME @"YouTube" #define YT_NAME @"YouTube"
@@ -119,15 +121,16 @@ BOOL ytMiniPlayer() {
%hook MDXPlaybackRouteButtonController %hook MDXPlaybackRouteButtonController
- (void)didPressButton:(id)arg1 { - (void)didPressButton:(id)arg1 {
if (castConfirm()) { if (castConfirm()) {
UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:@"Casting" NSBundle *tweakBundle = uYouPlusBundle();
message:@"Are you sure you want to start casting?" UIAlertController* alertController = [%c(UIAlertController) alertControllerWithTitle:LOC(@"CASTING")
message:LOC(@"MSG_ARE_YOU_SURE")
preferredStyle:UIAlertControllerStyleAlert]; 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; %orig;
}]; }];
UIAlertAction* noButton = [%c(UIAlertAction) UIAlertAction* noButton = [%c(UIAlertAction)
actionWithTitle:@"Cancel" actionWithTitle:LOC(@"MSG_CANCEL")
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler: ^(UIAlertAction * action) { handler: ^(UIAlertAction * action) {
return; return;