Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony多重化忽略浮动_Symfony_Pluralize - Fatal编程技术网

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. 资料来

我正在使用移植到我的框架中的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.
资料来源:

我的问题是,
1.5
的复数形式与
1
的复数形式不同。我该怎么做?当我将
1.5
作为计数参数传递时,它将获得
1
复数赋值


我认为将interval指定为
]1,something]
是可行的,但根据文档,它基本上与
[2,something]
相同(在这种情况下,我看不出使用
]1
有什么意义)。如何覆盖
1.5
复数?

根据Symfony引用,
Interval
()和TranslatorInterface(),接受
int
值,因此我认为您试图实现的是不可能的

但是,您可以覆盖Translator服务并实现您的逻辑。有关详细信息,请参阅