Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localize Done button of MPMoviePlayerViewController

I am using a MPMoviePlayerViewController to present videos. Everything works as expected, but if I switch the device's language to e.g. German, the "Done" button is not localized.

I tried to access the button and set it to my own button implementation like so:

MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];

NSLog(@"%@", mp.navigationItem.leftBarButtonItem); // always null, but why?

// override button with locale 
mp.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Zurück"
                                             style:UIBarButtonItemStyleDone 
                                             target:self 
                                             action:@selector(dismissMoviePlayer:)];

[self presentMoviePlayerViewControllerAnimated:mp];

A similar question has been asked before, but never received any answers: objective-c MPMoviePlayerViewController done button language.

Thanks for your help.

like image 426
alex Avatar asked Dec 07 '11 08:12

alex


1 Answers

check the CFBundleDevelopmentRegion in your Info.plist

like image 118
changx Avatar answered Nov 15 '22 02:11

changx