开发者

internationalization in iphone

开发者 https://www.devze.com 2023-01-30 11:05 出处:网络
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?

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

精彩评论

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