相关疑难解决方法(0)

NSLocalizedString with swift variable

I'm trying to localize my app using NSLocalizedString. When i import the XLIFF file, most works like a charm but something do not and some string is not localized. I have noticed that the problem is from NSLocalizedString containing something variable inside like:

NSLocalizedString(" - \(count) Notifica", comment: "sottotitolo prescrizione per le notifiche al singolare")
Run Code Online (Sandbox Code Playgroud)

or

NSLocalizedString("Notifica per \(medicina!) della prescrizione \(prescription!)\nMemo: \(memoTextView.text)", comment: "Messaggio della Local Notification")
Run Code Online (Sandbox Code Playgroud)

Maybe this is not the correct syntax for thi kind of stuff. …

localization nslocalizedstring ios xliff swift

74
推荐指数
5
解决办法
4万
查看次数

NSLocalizedString格式

我将如何使用NSLocalizedString此字符串:

[NSString stringWithFormat:@"Is “%@“ still correct for “%@“ tap “OK“ otherwise tap “Change“ to choose new contact details", individual.contactInfo, individual.name];
Run Code Online (Sandbox Code Playgroud)

在使用stringWithFormat之前我以下列方式使用它:

[NSString stringWithFormat:@"%d %@", itemCount, NSLocalizedString(@"number of items", nil)];
Run Code Online (Sandbox Code Playgroud)

objective-c nslocalizedstring

38
推荐指数
3
解决办法
2万
查看次数