<small id='SAjFY'></small><noframes id='SAjFY'>

      <legend id='SAjFY'><style id='SAjFY'><dir id='SAjFY'><q id='SAjFY'></q></dir></style></legend>
    1. <tfoot id='SAjFY'></tfoot>
        <bdo id='SAjFY'></bdo><ul id='SAjFY'></ul>
      <i id='SAjFY'><tr id='SAjFY'><dt id='SAjFY'><q id='SAjFY'><span id='SAjFY'><b id='SAjFY'><form id='SAjFY'><ins id='SAjFY'></ins><ul id='SAjFY'></ul><sub id='SAjFY'></sub></form><legend id='SAjFY'></legend><bdo id='SAjFY'><pre id='SAjFY'><center id='SAjFY'></center></pre></bdo></b><th id='SAjFY'></th></span></q></dt></tr></i><div id='SAjFY'><tfoot id='SAjFY'></tfoot><dl id='SAjFY'><fieldset id='SAjFY'></fieldset></dl></div>

      如何在运行时更改 iPhone 应用程序语言?

      时间:2023-09-12

            <legend id='eUgFd'><style id='eUgFd'><dir id='eUgFd'><q id='eUgFd'></q></dir></style></legend>
            <i id='eUgFd'><tr id='eUgFd'><dt id='eUgFd'><q id='eUgFd'><span id='eUgFd'><b id='eUgFd'><form id='eUgFd'><ins id='eUgFd'></ins><ul id='eUgFd'></ul><sub id='eUgFd'></sub></form><legend id='eUgFd'></legend><bdo id='eUgFd'><pre id='eUgFd'><center id='eUgFd'></center></pre></bdo></b><th id='eUgFd'></th></span></q></dt></tr></i><div id='eUgFd'><tfoot id='eUgFd'></tfoot><dl id='eUgFd'><fieldset id='eUgFd'></fieldset></dl></div>
            <tfoot id='eUgFd'></tfoot>
          • <small id='eUgFd'></small><noframes id='eUgFd'>

                <tbody id='eUgFd'></tbody>
              • <bdo id='eUgFd'></bdo><ul id='eUgFd'></ul>

                本文介绍了如何在运行时更改 iPhone 应用程序语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                有没有办法在运行时更改应用程序语言?

                Is there a way to change the application language during runtime?

                因此,更改后 NSLocalizedString 立即返回新语言的字符串.

                So, after the change NSLocalizedString immediately returns the string for the new language.

                我现在正在做的是使用以下代码更改语言:

                What I'm doing now is changing the language using the code below:

                - (void)onChangeLanguage: (id)sender 
                {
                    NSArray *lang = [NSArray arrayWithObjects:((InfoWhatever *)sender).language, nil];
                    [[NSUserDefaults standardUserDefaults] setObject:lang forKey:@"AppleLanguages"];
                    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
                    NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
                    NSString *currentLanguage = [languages objectAtIndex:0];
                
                    NSLog(@"Current language: %@", currentLanguage);
                }
                

                语言会改变,但只有在重新启动后应用程序.

                The language will change but only after restarting the app.

                推荐答案

                我怀疑你能做到这一点,即使设置应用程序也做不到.

                I doubt you can do this, even the Settings app cannot do it.

                (当你在设置应用中更改语言时,屏幕变黑,并显示设置语言..."和一个进度轮.经过漫长的等待,你回到了 Springboard.它几乎看起来像手机重新启动.)

                (When you change the language in the Settings app, the screen goes black, and displays "setting language..." and a progress wheel. After a long wait, you are back in Springboard. It almost looks like the phone reboots.)

                这篇关于如何在运行时更改 iPhone 应用程序语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何创建多语言安卓应用程序? 下一篇:硬编码字符串“第三行",应使用@string 资源

                相关文章

              • <i id='tpP9Y'><tr id='tpP9Y'><dt id='tpP9Y'><q id='tpP9Y'><span id='tpP9Y'><b id='tpP9Y'><form id='tpP9Y'><ins id='tpP9Y'></ins><ul id='tpP9Y'></ul><sub id='tpP9Y'></sub></form><legend id='tpP9Y'></legend><bdo id='tpP9Y'><pre id='tpP9Y'><center id='tpP9Y'></center></pre></bdo></b><th id='tpP9Y'></th></span></q></dt></tr></i><div id='tpP9Y'><tfoot id='tpP9Y'></tfoot><dl id='tpP9Y'><fieldset id='tpP9Y'></fieldset></dl></div>

                <small id='tpP9Y'></small><noframes id='tpP9Y'>

                  <bdo id='tpP9Y'></bdo><ul id='tpP9Y'></ul>
                  <legend id='tpP9Y'><style id='tpP9Y'><dir id='tpP9Y'><q id='tpP9Y'></q></dir></style></legend>

                    <tfoot id='tpP9Y'></tfoot>