objective-c – 占位符和NSLocalizedString

objective-c – 占位符和NSLocalizedString,第1张

概述我正在尝试翻译我的应用程序,当有半个占位符时,我发现很难翻译.我需要找到以下代码: [textView1 insertText:[NSString stringWithFormat:@"%@ è il %i/%i/%i. Il giorno delle settimana è %@. La Festa è compresa nel calcolo. \n", nomeFesta, giornoFe 我正在尝试翻译我的应用程序,当有半个占位符时,我发现很难翻译.我需要找到以下代码:

[textVIEw1 insertText:[Nsstring stringWithFormat:@"%@ è il %i/%i/%i. Il giorno delle settimana è %@. La Festa è compresa nel calcolo. \n",nomeFesta,giornoFesta,meseFesta,annoFestaModificato,ggSett]];

我把文件localizable.string(英文):

"festaCompresa" = @"%@ is the %i/%i/%i. the day of the week is %@. The holIDays is included in the calculation. \n";

然后我编辑了这段代码:

[textVIEw1 insertText:[Nsstring stringWithFormat:NSLocalizedString(@"festaCompresaW,@""),ggSett]];

这是行不通的.

解决方法 你复制粘贴代码了吗?或者你重新输入了吗?因为如果你复制粘贴它就会出现问题:

[textVIEw1 insertText:[Nsstring stringWithFormat:NSLocalizedString(@"festaCompresaW,ggSett]];

我想它应该是

[textVIEw1 insertText:[Nsstring stringWithFormat:NSLocalizedString(@"festaCompresa",ggSett]];

所以基本上是“而不是W.

另外,在Localizable.strings中你没有把@放在引号的前面,所以这个:

"festaCompresa" = @"%@ is the %i/%i/%i. the day of the week is %@. The holIDays is included in the calculation. \n";

应该这样:

"festaCompresa" = "%@ is the %i/%i/%i. the day of the week is %@. The holIDays is included in the calculation. \n";

希望能帮助到你

总结

以上是内存溢出为你收集整理的objective-c – 占位符和NSLocalizedString全部内容,希望文章能够帮你解决objective-c – 占位符和NSLocalizedString所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1018234.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存