android – geting错误/复数警告:“数量’one’匹配多个特定数字……”

背景

我在一个内部有很多翻译的应用程序上工作.

我有下一个英文复数字符串:

<plurals name="something">
    <item quantity="one">added photo</item>
    <item quantity="other">added %d photos</item>
</plurals>

和法语翻译:

<plurals name="something">
    <item quantity="one">a ajouté une photo</item>
    <item quantity="other">a ajouté %d photos</item>
</plurals>

问题

对于法语和俄语,我收到了下一个警告:

The quantity ‘one’ matches more than one specific number in this
locale,but the message did not include a formatting argument (such as
%d). This is usually an internationalization error. See full issue
explanation for more.

当选择显示细节时,它说:

很好,我不知道该怎么做才能解决它,如果有问题……

这个问题

我究竟应该用这些字符串做什么?我该怎么告诉翻译?

解决方法

在法语中,当计数为0或1时使用单数形式.在英语中,只有当count为1时才使用单数形式.0使用复数形式.

这就是您需要在法语单数模式中插入占位符(%d)的原因.

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...