1

我正在尝试为日期时间间隔获取一个很好的格式化字符串。

基本上我的 %count% 为 -2 表示“两天前”,4 表示“4 天内”,0 表示“今天”,1 表示“明天”等等。

我的翻译字符串如下所示:

dateinterval: '{0} today|{1} tomorrow|{1} the day after tomorrow |{-1} yesterday|[2,Inf[ In %count% days|]-Inf,-2]%count% days ago'

这很好用,除了我在区间 ]-Inf,-2] 中有一个负号:

-3 天前 -43 天前

有没有办法让 %count% 成为翻译字符串中的绝对数字?

谢谢!

4

0 回答 0