Symfony多重化忽略浮动
我正在使用移植到我的框架中的Symfony翻译。我在文档中发现:Symfony多重化忽略浮动,symfony,pluralize,Symfony,Pluralize,我正在使用移植到我的框架中的Symfony翻译。我在文档中发现: '{0} There are no apples|{1} There is one apple|]1,19] There are %count% apples|[20,Inf[ There are many apples' The above string specifies four different intervals: exactly 0, exactly 1, 2-19, and 20 and higher. 资料来
'{0} There are no apples|{1} There is one apple|]1,19] There are %count% apples|[20,Inf[ There are many apples'
The above string specifies four different intervals: exactly 0, exactly 1, 2-19, and 20 and higher.
资料来源:
我的问题是,1.5
的复数形式与1
的复数形式不同。我该怎么做?当我将1.5
作为计数参数传递时,它将获得1
复数赋值
我认为将interval指定为
]1,something]
是可行的,但根据文档,它基本上与[2,something]
相同(在这种情况下,我看不出使用]1
有什么意义)。如何覆盖1.5
复数?根据Symfony引用,Interval
()和TranslatorInterface(),接受int
值,因此我认为您试图实现的是不可能的
但是,您可以覆盖Translator服务并实现您的逻辑。有关详细信息,请参阅