在国际化我的应用程序之前,如何更改 Xcode 中的开发语言?

How do I change the Development language in Xcode before internationalizing my app?(在国际化我的应用程序之前,如何更改 Xcode 中的开发语言?)
本文介绍了在国际化我的应用程序之前,如何更改 Xcode 中的开发语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在接管一个完全用法语编写的应用程序.字符串在代码中用法语硬编码,情节提要中的所有消息都是法语.但是 Info.plist 中的初始开发区域留给了英语.所以我将 CFBundleDevelopmentRegion 更改为 fr 以便它与所使用的真实语言相匹配.但是 XCode 一直告诉我我的开发语言是英语:

我该如何纠正?目标是能够激活基本国际化并让它使用法语作为基本语言而不是英语.

解决方案

以下过程对我有用,但它包括手动编辑 project.pbxproj 文件:

  1. 退出 XCode
  2. 使用您喜欢的文本编辑器打开 project.pbxproj 文件
  3. 更新以下部分(developmentRegion 附近):

旧:

 developmentRegion = English;hasScannedForEncodings = 0;已知区域 = (恩,根据,);

新:

developmentRegion = fr;hasScannedForEncodings = 0;已知区域 = (FR,根据,);

我创建了一个

I'm taking over an app that was written entirely in French. Strings are hardcoded in French in the code, and all the messages in the storyboard are in French. But the initial development region in Info.plist was left to English. So I changed CFBundleDevelopmentRegion to fr so that it matches the real language that was used. But XCode keeps telling me that my Development language is English:

How can I correct that? The goal is to be able to activate Base Internationalization and have it use French as the Base language instead of English.

解决方案

The following procedure worked for me, but it includes manually editing project.pbxproj file:

  1. Quit XCode
  2. Open the project.pbxproj file with your favorite text editor
  3. Update the following section (near developmentRegion):

OLD:

    developmentRegion = English;
    hasScannedForEncodings = 0;
    knownRegions = (
        en,
        Base,
    );

NEW:

developmentRegion = fr;
            hasScannedForEncodings = 0;
            knownRegions = (
                fr,
                Base,
            );

I've created a GitHub repository with a sample project that was initially created with English as default Development Language, and then updated by the procedure above to use French as Development Language.

这篇关于在国际化我的应用程序之前,如何更改 Xcode 中的开发语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)