本地化 MPMoviePlayerViewController 的“完成”按钮

发布于 2024-12-19 23:20:41 字数 927 浏览 3 评论 0原文

我正在使用 MPMoviePlayerViewController 来呈现视频。一切都按预期工作,但如果我将设备的语言切换为德语,则“完成”按钮未本地化。

我尝试访问该按钮并将其设置为我自己的按钮实现,如下所示:

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];

以前曾提出过类似的问题,但从未收到任何答案:objective-c 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沉溺在你眼里的海 2024-12-26 23:20:41

检查 Info.plist 中的 CFBundleDevelopmentRegion

check the CFBundleDevelopmentRegion in your Info.plist

城歌 2024-12-26 23:20:41

您可以更改 xml 中的 Info.plist(作为源代码打开)并放置您的翻译。例如:

<key>CFBundleDevelopmentRegion</key>
<string>es</string>

将其放入西班牙语(西班牙语不会出现在列表中)

You can change the Info.plist in xml (Open as source code) and put your translation. For example:

<key>CFBundleDevelopmentRegion</key>
<string>es</string>

To put it in spanish (Spanish doesn't appear in the list)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文