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.
精彩评论