Summary | Date_Holidays split up breaks translation support for non-christian drivers |
Queue | Kronolith |
Queue Version | 2.2 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | info (at) pmrogan (dot) de |
Created | 09/01/2008 (6163 days ago) |
Due | |
Updated | 01/12/2010 (5665 days ago) |
Assigned | 09/01/2008 (6163 days ago) |
Resolved | 01/27/2009 (6015 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | 2.3.1 |
Patch | No |
Date_Holidays in CVS has a new addTranslation() method that takes care
of locale/translation support. Beside that, all translations are using
UTF-8 now. Not being merged until there is a new release.
Bug: #7272http://git.horde.org/diff.php/kronolith/lib/Driver/holidays.php?rt=horde-git&r1=9910e685f9ac27e8205ecd78230c60ea0c58c4e8&r2=ef2da06a532372d82dfa061822ebab30aaa201a0
'Date-string has wrong format'. The solution of arnaud worked for me
too.
State ⇒ Resolved
to stable branch.
Milestone ⇒ 2.3.1
Taken from
line that reads
$holidays = $dh->getHolidayForDate($date->timestamp(), $GLOBALS['l
anguage'], true);
must be changed to
$holidays = $dh->getHolidayForDate($date->format('Y-m-d'), $GLOBALS['
language'], true);
if you pass it a timestamp.
The original issue has been fixed in Date_Holiday though.
$holidays = $dh->getHolidayForDate($date->format('Y-m-d'), $GLOBALS['
language'], true);
a fr_FR locale and Christian driver (yes it wasn't working with
christian driver on my setup))
PEAR forum, there is a separate issue that results in no holidays
being displayed and the same locale error being posted to the log. In
this situation, the locale error is a phantom.
In kronolith/lib/Driver/holidays.php, on line 83 (version 2.3), the
line that reads
$holidays = $dh->getHolidayForDate($date->timestamp(), $GLOBALS['l
anguage'], true);
must be changed to
$holidays = $dh->getHolidayForDate($date->format('Y-m-d'), $GLOBALS['
language'], true);
Because the date format is wrong, $dh gets set to an error; which end
up getting reported as a locale error, even though the real problem is
something else.
[kronolith] Factory was unable to produce driver object for driver
Germany in year 2008 with locale de_DE [pid 18661 on line 69 of
"<bla>/kronolith-h3-2.3/lib/Driver/holidays.php"]
Holidays-Driver of course is installed. If I remove the
Holdays::IsError-Clause, it works but does not log any more errors nor
does it display the holidays.
From pear list:
Date_Holidays 0.20.1 alpha
Date_Holidays_Austria 0.1.2 alpha
Date_Holidays_Brazil 0.1.2 alpha
Date_Holidays_Denmark 0.1.1 alpha
Date_Holidays_Discordian 0.1.1 alpha
Date_Holidays_EnglandWales 0.1.1 alpha
Date_Holidays_Germany 0.1.1 alpha
Date_Holidays_Iceland 0.1.1 alpha
Date_Holidays_Ireland 0.1.1 alpha
Date_Holidays_Japan 0.1.0 alpha
Date_Holidays_Netherlands 0.1.1 alpha
Date_Holidays_Norway 0.1.1 alpha
Date_Holidays_PHPdotNet 0.1.2 alpha
Date_Holidays_Romania 0.1.1 alpha
Date_Holidays_Slovenia 0.1.2 alpha
Date_Holidays_Sweden 0.1.1 alpha
Date_Holidays_UNO 0.1.2 beta
Date_Holidays_USA 0.1.1 alpha
Date_Holidays_Ukraine 0.1.1 alpha
mrubinsk
12:17:14 date_holidays is kicking my butt
mrubinsk
12:17:32
oh, it doesn't *have* a en_us file
mrubinsk
12:17:40
well, that sucks
mrubinsk
12:17:58
...as does the new directory structure
yunosh
12:19:14
yeah, ken is keeping implenting all kind of bc breaking changes (which
is fine), without actually implementing my requests that would make it
much easier dealing with those
mrubinsk
12:23:10
ah well, I'm giving up on this for now. It's completely unusable for
me anyway, without any en_us files.
mrubinsk
12:23:44
not to mention the files that *are* there are present in different
places...for de for instance, we have
mrubinsk
12:24:05
data/Date_Holidays/lang/Christian/de_DE.*
mrubinsk
12:24:07
and
mrubinsk
12:24:25
data/Date_Holidays_Germany/lang/Christian/de_DE*
mrubinsk
12:24:28
very confusing :)
yunosh
12:26:06
uh, and that shouldn't happen :)
yunosh
12:26:22
probably some left-overs from earlier versions
yunosh
12:26:37
pear list-files is the definite reference
mrubinsk
12:27:44
...and both files are there in that list :)
yunosh
12:28:06
heh
mrubinsk
12:28:14
hence the confusion :)
yunosh
12:28:34
actually, it should be data/Date_Holidays_Christian/lang/de_DE.*
mrubinsk
12:29:45
...but I thought that Christian was part of the base driver?
yunosh
12:30:07
oh, is it?
yunosh
12:30:12
i thought all have been separated out
mrubinsk
12:30:19
there isn't a Date_Holiday_Christian package
mrubinsk
12:30:23
Holidays
yunosh
12:30:26
ah, k then
yunosh
12:30:34
then the first path looks correct to me
yunosh
12:30:53
unless there are extensions to the christian driver in the germany package
yunosh
12:31:06
which is well possible, from a holiday standpoint
yunosh
12:31:44
but that would make it completely impossible to correctly load translations
mrubinsk
12:31:49
exactly
yunosh
12:32:10
that sucks pretty much
mrubinsk
12:32:21
yup
mrubinsk
12:32:57
...and a diff on the two de files shows no differences
mrubinsk
12:33:10
which *might* be a good sign for us
yunosh
12:33:13
well, if he doesn't get it implement it properly, we might want to
fork it, and use gettext for the translations
mrubinsk
12:34:24
I'll dump the pertinent parts of this conversation onto the ticket
Assigned to
State ⇒ Assigned
Priority ⇒ 2. Medium
Patch ⇒ No
State ⇒ Unconfirmed
Milestone ⇒
Queue ⇒ Kronolith
Summary ⇒ Data_Holidays split up breaks translation support for non-christian drivers
Type ⇒ Bug
Priority ⇒ 1. Low
migrated to dedicated sub packages.
As a result the location of the translation files has changed as well.
That's why _getTranslationFileLocation in
kronolith/lib/Driver/holidays.php fails to load the correct
translation file.
For example the translation files for the german driver were moved
from $PEAR_INSTALL_DIR/data/Date_Holidays/lang/Germany/ to
$PEAR_INSTALL_DIR/data/Date_Holidays_Germany/lang/Germany/.