簡體   English   中英

如何在 ICU MessageFormat 中表示俄語或其他復雜復數語言的復數規則

[英]How to represent plural rules for Russian or other complex plural languages in ICU MessageFormat

鑒於復數規則的不尋常性質,我們如何在 ICU MessageFormat 中表示俄語?

MessageFormat 支持復數形式,例如{arg, plural, =1 {one} other {other}}和更復雜{arg, plural, =0 {none} =1 {one} =2 {few} other {several}}

但是,有時不經過一些計算,無法直接由數字確定要使用的文本; 我們該怎么做? 俄語有三個基於數字中最后一位數字的復數規則,但 11-14 除外。

我查看的信息:

俄語多元化

http://www.russianlessons.net/lessons/lesson11_main.php

消息格式規則

http://userguide.icu-project.org/formatparse/messages

各種語言的復數規則數

https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals

蘋果的俄語 ICU 復數示例 (яблоко)。

{arg, plural, =0 {нет яблок} one {одно яблоко} few {{arg} яблока} other {{arg} яблок}}

one適用於以 1 結尾的數字,但 11 除外

除了 12、13 和 14 之外, few有以 2、3、4 結尾的數字再次起作用

other只是“許多”形式

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM