t2() behaves differently in v8.3 and v8.4?

Permalink
I've just notices that this code:
echo t2('%d day', '%d days', $duration);

shows nothing in C5 v.8.3* and shows the value of $duration in C5 v.8.4*. To show the duration value in v8.3* I have to use:
echo $duration . ' ' . t2('%d day', '%d days', $duration);


Has the t2() changed from v.8.3 to v8.4?

linuxoid
 
mlocati replied on at Permalink Reply
mlocati
Nothing changed
linuxoid replied on at Permalink Reply
linuxoid
But why then does it behave differently?
JohntheFish replied on at Permalink Reply
JohntheFish
It may be nothing to do with t2. What you are doing to set $duration?
linuxoid replied on at Permalink Reply
linuxoid
controller:
$pickup_dt = $this->app->make('helper/form/date_time')->translate('pickup_dt', null);
$dropoff_dt = $this->app->make('helper/form/date_time')->translate('dropoff_dt', null);
$duration = ceil((strtotime($dropoff_dt) - strtotime($pickup_dt)) / (60 * 60 * 24));
$duration = ($duration < 1) ? 1 : $duration;
$this->set('duration', $duration);
linuxoid replied on at Permalink Reply
linuxoid
I've just realized I forgot the '%d' in the language file:
msgid "%d day"
msgid_plural "%d days"
msgstr[0] "сутки"
msgstr[1] "суток"
msgstr[2] "суток"


Doh! Should be this:
msgid "%d day"
msgid_plural "%d days"
msgstr[0] "%d сутки"
msgstr[1] "%d суток"
msgstr[2] "%d суток"

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.