Xcode项目本地化到葡萄牙语(巴西),为什么还要显示英语?

时间:2022-12-20 15:21:33

My Xcode project is localized to "Portuguese (Brazil)", then I tried to set language to "Portuguese" and "Portuguese (Portugal)" on device and simulator, but the interface still show English, what's wrong?

我的Xcode项目本地化为“葡萄牙(巴西)”然后我试着在设备和模拟器上把语言设置为“葡萄牙语”和“葡萄牙语(葡萄牙语)”,但是界面仍然显示英语,怎么了?

Other localized languages work well, only Brazil failed to work. I wonder what language setting would Brazil people choose?

其他本地化的语言也很好用,只有巴西不行。我想知道巴西人民会选择什么样的语言环境?

5 个解决方案

#1


1  

I asked some coders, in Xcode, they just localize to "Portuguese" and skip "Portuguese (Brazil)". No idea why Apple would make such a difference between iOS and Xcode.

我问了一些编码人员,在Xcode中,他们只是本地化为“葡语”,跳过“葡语(巴西)”。不知道为什么苹果会在iOS和Xcode之间做出如此大的改变。

#2


1  

Today I had the same issue and I am able to make my project work correctly now. I would say this is happening because of the way xCode provides us options to select Portuguese Brazil.

今天我遇到了同样的问题,现在我可以正确地完成我的项目了。我想说这是因为xCode为我们提供了选择葡萄牙巴西的选项。

Actually this line from Apple Documentation helped me:

实际上,苹果文档中的这句话帮助了我:

The language ID for scripts or dialects uses subtags, as in pt-PT where pt is the code for Portuguese and PT is the code for Portugal. For example, use pt as the language ID for Portuguese as it is used in Brazil and pt-PT as the language ID for Portuguese as it is used in Portugal.

脚本或方言的语言ID使用子标记,如在pt- pt中,pt是葡萄牙语的代码,而pt是葡萄牙语的代码。例如,使用pt作为葡萄牙语的语言ID,因为它在巴西使用,而在葡萄牙使用pt- pt作为葡萄牙语的语言ID。

For Brazil Portuguese select only Portuguese language (pt) and not Brazil Portuguese. For Portugal Portuguese, you can select Portuguese Portugal (pt-PT). It will work.

对于巴西,葡萄牙语只选择葡萄牙语,而不选择巴西葡萄牙语。对于葡萄牙语,您可以选择葡萄牙语葡萄牙语(pt-PT)。它将工作。

Thanks.

谢谢。

#3


0  

I find that for languages with a bracket in the name, it does not work if you spell it out.

我发现,对于名字中有括号的语言,如果你拼写出来,它就不会起作用。

For Portuguese (Brazil), you'll have to use pt-BR.

对于葡萄牙语(巴西),您必须使用pt-BR。

e.g. ~AppleLanguages("pt-BR")

例如~ AppleLanguages(“pt-BR”)

Just like for Chinese (Traditional) & Chinese (Simplified), you have to use ~AppleLanguages("zh-Hant") and ~AppleLanguages("zh-Hans")

就像中文(繁体)和中文(简体)一样,你必须使用~AppleLanguages(“zhhant”)和~AppleLanguages(“zhh - hans”)

This works for me.

这适合我。

#4


0  

To me it looks like these languages just reversed their placed. When I use "pt" it works for brazilian portuguese, but not for Portugal portuguese. Solution is to duplicate "pt" and "pt-BR" in our translation. Weird bug.

在我看来,这些语言只是颠倒了位置。当我使用“pt”时,它适用于巴西葡萄牙语,但不适用于葡萄牙葡萄牙葡萄牙语。解决方法是在我们的翻译中复制“pt”和“pt- br”。奇怪的错误。

#5


0  

It shouldn't matter that there is no "Portuguese" option on the phones, but only "Portuguese (Brazil)" and "Portuguese (Portugal)". The localization specification is a hierarchy. The intended approach is to implement the most general aspects first (ex: Portuguese), and then add additional differentiation based on Region, Country, Script, etc as needed.

手机上没有“葡萄牙语”选项并不重要,只有“葡萄牙语(巴西)”和“葡萄牙语(葡萄牙)”。本地化规范是一个层次结构。预期的方法是首先实现最一般的方面(例如:葡萄牙语),然后根据区域、国家、脚本等需要添加额外的差异。

Some reference: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html

参考:https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html

#1


1  

I asked some coders, in Xcode, they just localize to "Portuguese" and skip "Portuguese (Brazil)". No idea why Apple would make such a difference between iOS and Xcode.

我问了一些编码人员,在Xcode中,他们只是本地化为“葡语”,跳过“葡语(巴西)”。不知道为什么苹果会在iOS和Xcode之间做出如此大的改变。

#2


1  

Today I had the same issue and I am able to make my project work correctly now. I would say this is happening because of the way xCode provides us options to select Portuguese Brazil.

今天我遇到了同样的问题,现在我可以正确地完成我的项目了。我想说这是因为xCode为我们提供了选择葡萄牙巴西的选项。

Actually this line from Apple Documentation helped me:

实际上,苹果文档中的这句话帮助了我:

The language ID for scripts or dialects uses subtags, as in pt-PT where pt is the code for Portuguese and PT is the code for Portugal. For example, use pt as the language ID for Portuguese as it is used in Brazil and pt-PT as the language ID for Portuguese as it is used in Portugal.

脚本或方言的语言ID使用子标记,如在pt- pt中,pt是葡萄牙语的代码,而pt是葡萄牙语的代码。例如,使用pt作为葡萄牙语的语言ID,因为它在巴西使用,而在葡萄牙使用pt- pt作为葡萄牙语的语言ID。

For Brazil Portuguese select only Portuguese language (pt) and not Brazil Portuguese. For Portugal Portuguese, you can select Portuguese Portugal (pt-PT). It will work.

对于巴西,葡萄牙语只选择葡萄牙语,而不选择巴西葡萄牙语。对于葡萄牙语,您可以选择葡萄牙语葡萄牙语(pt-PT)。它将工作。

Thanks.

谢谢。

#3


0  

I find that for languages with a bracket in the name, it does not work if you spell it out.

我发现,对于名字中有括号的语言,如果你拼写出来,它就不会起作用。

For Portuguese (Brazil), you'll have to use pt-BR.

对于葡萄牙语(巴西),您必须使用pt-BR。

e.g. ~AppleLanguages("pt-BR")

例如~ AppleLanguages(“pt-BR”)

Just like for Chinese (Traditional) & Chinese (Simplified), you have to use ~AppleLanguages("zh-Hant") and ~AppleLanguages("zh-Hans")

就像中文(繁体)和中文(简体)一样,你必须使用~AppleLanguages(“zhhant”)和~AppleLanguages(“zhh - hans”)

This works for me.

这适合我。

#4


0  

To me it looks like these languages just reversed their placed. When I use "pt" it works for brazilian portuguese, but not for Portugal portuguese. Solution is to duplicate "pt" and "pt-BR" in our translation. Weird bug.

在我看来,这些语言只是颠倒了位置。当我使用“pt”时,它适用于巴西葡萄牙语,但不适用于葡萄牙葡萄牙葡萄牙语。解决方法是在我们的翻译中复制“pt”和“pt- br”。奇怪的错误。

#5


0  

It shouldn't matter that there is no "Portuguese" option on the phones, but only "Portuguese (Brazil)" and "Portuguese (Portugal)". The localization specification is a hierarchy. The intended approach is to implement the most general aspects first (ex: Portuguese), and then add additional differentiation based on Region, Country, Script, etc as needed.

手机上没有“葡萄牙语”选项并不重要,只有“葡萄牙语(巴西)”和“葡萄牙语(葡萄牙)”。本地化规范是一个层次结构。预期的方法是首先实现最一般的方面(例如:葡萄牙语),然后根据区域、国家、脚本等需要添加额外的差异。

Some reference: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html

参考:https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html