Xcode 6.0 : It provides wonderful features for Internationalisation and Localisation. ("Localizing with Xcode 6" video). For quick usage I write some useful steps.
Step 1 :
click on project -> info -> scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.
for xcode 6 : click on project -> change target to -> info > scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.
Step 2 :
click on 'Supporting Files' -> right click -> New File -> select Resource on left-side list -> select 'Strings Files' -> next -> name it 'Localizable' -> create
Step 3 :
click on newly created file -> go to Utilities -> file inspector -> click on 'Localize..' -> check all language
Step 4 :
open Localizable.strings(English) write "help" = "I can't help you";
here "help" is a key "I can't help you" is a value. You may change them as your wish.
open Localizable.strings(French) or the language you have set. write accordingly and you can translate "I can't help you" to any said language.
Step 5 :
// for test
NSString *str = NSLocalizedString(@"help", Nil);
NSLog(@"%@",str);
We have done it. You may check.
Now, to test goto settings of device -> general -> International -> language -> select said language or the language you have chosen (There are limited languages). Run your app. Hope this will help you. It help me.
我建议阅读I18n 文档。您永远不需要询问用户他们使用哪种语言,因为这可以通过 API 调用获得,因此您应该采取明智的做法并使用他们设备上已有的首选语言。
I would suggest reading the I18n docs. You will never need to ask the user which language they use as this is obtainable through an API call, so you should do the smart thing and use whichever language they have preferred already on their device.
发布评论
评论(3)
Xcode 6.0:
它为国际化和本地化提供了出色的功能。(“使用 Xcode 6 进行本地化”视频)。为了快速使用,我编写了一些有用的步骤。
第一步:
点击项目->信息->向下滚动->本地化 ->单击“+”并添加您所需的语言 ->按要求检查->结束。
对于 Xcode 6:单击项目 ->将目标更改为 ->信息>向下滚动->本地化 ->单击“+”并添加您所需的语言 ->按要求检查->结束。
第2步:
点击“支持文件”->右键单击->新文件 ->选择左侧列表中的资源 ->选择“字符串文件”->下一个->将其命名为“可本地化”->创建
第3步:
点击新创建的文件->转到实用程序 ->文件检查器 ->单击“本地化..”->检查所有语言
第4步:
打开Localized.strings(English)
写
"help" = "我帮不了你";
这里“帮助”是关键
“我帮不了你”是一种价值观。您可以根据自己的意愿更改它们。
打开 Localized.strings(French) 或您设置的语言。
相应地写下,你可以将“我帮不了你”翻译成任何
说语言。
第5步:
我们已经做到了。
你可以检查一下。
现在,测试设备的转到设置 ->一般->国际->语言->选择所述语言或您选择的语言(语言有限)。
运行您的应用程序。
希望这会对您有所帮助。它帮助我。
Xcode 6.0 :
It provides wonderful features for Internationalisation and Localisation. ("Localizing with Xcode 6" video). For quick usage I write some useful steps.
Step 1 :
click on project -> info -> scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.
for xcode 6 : click on project -> change target to -> info > scroll down -> localizations -> click on '+' and add your required language -> check as required -> Finish.
Step 2 :
click on 'Supporting Files' -> right click -> New File -> select Resource on left-side list -> select 'Strings Files' -> next -> name it 'Localizable' -> create
Step 3 :
click on newly created file -> go to Utilities -> file inspector -> click on 'Localize..' -> check all language
Step 4 :
open Localizable.strings(English)
write
"help" = "I can't help you";
here "help" is a key
"I can't help you" is a value. You may change them as your wish.
open Localizable.strings(French) or the language you have set.
write accordingly and you can translate "I can't help you" to any
said language.
Step 5 :
We have done it.
You may check.
Now, to test goto settings of device -> general -> International -> language -> select said language or the language you have chosen (There are limited languages).
Run your app.
Hope this will help you. It help me.
我建议阅读I18n 文档。您永远不需要询问用户他们使用哪种语言,因为这可以通过 API 调用获得,因此您应该采取明智的做法并使用他们设备上已有的首选语言。
I would suggest reading the I18n docs. You will never need to ask the user which language they use as this is obtainable through an API call, so you should do the smart thing and use whichever language they have preferred already on their device.
这些是您本地化工作的重要资源:
These are great resources for your localization efforts: