Posted by antrophos on September 16, 2009 at 6:01pm
| Project: | Javascript Countdown Timer |
| Version: | 6.x-2.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Only <span class="countdowntimer"> some days left.
<span style="display:none" class="datetime">2009-09-25T20:56:00+02:00</span>
<span style="display:none" class="format_num">1</span>
</span>This one works not under special circumstances.
9 Days and 0 Hours left it shows. But 9 Days and 1 hour it didn't. Instead there was "Only some days left." At the certain time.
I'm not aware of a input mistake of mine so I think it could be a bug.
Best Regards
Robert
Comments
#1
What are you using for you format_num 1 string?
#2
noch %days% Tage, %hours% Stunden, %mins% Minuten und %secs% Sekunden.#3
It looks like two things happened. The translations files are out of date, and the translation template was missing the timer.js javascript entries. I've updated the countdowntimer.pot file which tells the translators which strings to translate, but I can't
actually do the translation. So I hope someone comes along and tries:)
#4
This Text had been English, I translated it for my use case. The other Text I also had in German but translated for bug report.
It was a casual Count Down but for certain Times it showed the default text instead of the countdown ... could this be a problem with translations?
I will try the bug-fix release tomorrow.
Regards
#5
Hello again,
I'm sorry but your idea didn't fix the problem. Sure it got nothing to do with me having GMT+2 set?
I paste you the code once more just to get sure. In the attach is the screenshot.
This is inside the Block:
<p>Nur <span class="countdowntimer"> wenige Tage verbleiben.<span style="display:none" class="datetime">2009-09-25T20:56:00+02:00</span>
<span style="display:none" class="format_num">1</span>
</span></p>
This is insinde Preset 1:
noch %days% Tage, %hours% Stunden, %mins% Minuten und %secs% Sekunden.Bugreport:
I mentioned the Timer not to work while it should show Remaining: " x Days and 1 Hour and ..."
It worked fine while hour should show above or beneath 1.
The attachment shows its 19:23 local German time (GMT+1 DST+1)
Regards
#6
It works for me with your preset, and GMT+2 in the span. I still think it is related to the javascript plural
being used to change "hours" to "hour".
var hours_str = Drupal.formatPlural(hours, "1 hour", "@count hours");
Can you view source on your files/countdowntimer/timer.js and look at this section around line 138-150.
This handles the plurals and includes translation as well.
//handle all counts with units firstvar year_str = Drupal.formatPlural(years, "1 year", "@count years");
outhtml = outhtml.replace(/%years% years/, year_str);
var ydays_str = Drupal.formatPlural(ydays, "1 day", "@count days");
outhtml = outhtml.replace(/%ydays% days/, ydays_str);
var days_str = Drupal.formatPlural(days, "1 day", "@count days");
outhtml = outhtml.replace(/%days% days/, days_str);
var hours_str = Drupal.formatPlural(hours, "1 hour", "@count hours");
outhtml = outhtml.replace(/%hours% hours/, hours_str);
var mins_str = Drupal.formatPlural(minutes, "1 minute", "@count minutes");
outhtml = outhtml.replace(/%mins% minutes/, mins_str);
var secs_str = Drupal.formatPlural(seconds, "1 second", "@count seconds");
outhtml = outhtml.replace(/%secs% seconds/, secs_str);
Nur
noch 0 Tage, 01 Stunden, 01 Minuten und 52 Sekunden.
#7
Committed fix in the Dec 3, 2009 6.x-2.x-dev snapshot.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.