android - 获取复数 : "The quantity ' one' matches more than one specific number. 的错误/警告 .."

标签 android string language-translation plural

背景

我在开发一个应用程序,里面有很多翻译。

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

<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.

选择显示详细信息时,它说: enter image description here

好像是,我不知道应该做什么来修复它,即使有问题...

问题

我究竟应该如何处理这些字符串?我应该告诉译员什么?

最佳答案

在法语中,当计数为 0 或 1 时使用单数形式。在英语中,仅当计数为 1 时使用单数形式。0 使用复数形式。

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

关于android - 获取复数 : "The quantity ' one' matches more than one specific number. 的错误/警告 ..",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26159556/

相关文章:

javascript - Angular-gettext 翻译服务似乎不起作用。

android - Android : Android App is not responding, close it?

python - JSONDecodeError 在 Python3 中使用谷歌翻译 API

python - 如何重新训练用于语言翻译的序列到序列神经网络模型?

.net - 是否有考虑 StringComparison 的 String.Split() ?

c - Realloc 在字符串调整大小函数中失败

linux - Bash编程如何调用 "$i+1"

android - 如何以编程方式暂停音乐播放器

java - Android Opencv 中的快速角点检测 : Corner points not drawn

android - 错误 :The SDK Build Tools revision (24. 0.3) 对于项目 ':app' 来说太低了。最低要求是 25.0.0