NSLocalizedString with format

前端 未结 4 658
粉色の甜心
粉色の甜心 2020-12-09 15:01

How would I use NSLocalizedString for this string:

[NSString stringWithFormat:@\"Is “%@“ still correct for “%@“ tap “OK“ otherwise tap “Change“          


        
4条回答
  •  孤城傲影
    2020-12-09 15:20

    Swift

    //Localizable.strings

    "my-localized-string" = "foo %@ baz";

    Example:

    myLabel.text = String(format: NSLocalizedString("my-localized-string", 
                                           comment: "foo %@ baz"), "bar") //foo bar baz
    

提交回复
热议问题