开发者

internationalization in iphone

I am developing an app in English. I want to change this app 开发者_高级运维into French.

For static data I am able to do this. But For dynamic data I am unable to do this. How can I solve my problem?


You can write this "StringKey" = "You are logged in at: %@" in your localizedstrings file and in your code you do something like this myLabel.text = [NSString stringWithFormat:NSLocalizedString(@"StringKey", @""), server];


Take a look at NSLocalizedString or NSLocalizedStringWithDefaultValue.

NSLocalizedStringWithDefaultValue(@"KEY_FOR_STRING", nil, [NSBundle mainBundle], @"VISIBLE_DESCRIPTION", @"DEVELOPER_DESCRIPTION")

From above, your VISIBLE_DESCRIPTION could include %@'s, %i, etc for dynamic replacement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜