6.0.0-git
2019-04-24

[#7272] Date_Holidays split up breaks translation support for non-christian drivers
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 2008-09-01 (3887 days ago)
Due
Updated 2010-01-12 (3389 days ago)
Assigned 2008-09-01 (3887 days ago)
Resolved 2009-01-27 (3739 days ago)
Milestone 2.3.1
Patch No

History
2010-01-12 23:57:53 CVS Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

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: #7272

http://git.horde.org/diff.php/kronolith/lib/Driver/holidays.php?rt=horde-git&r1=9910e685f9ac27e8205ecd78230c60ea0c58c4e8&r2=ef2da06a532372d82dfa061822ebab30aaa201a0
2009-02-02 23:01:54 mail (at) horde (dot) org Comment #9 Reply to this comment
When printing out Date_History::getErrors, I received the message 
'Date-string has wrong format'. The solution of arnaud worked for me 
too.
2009-01-27 00:45:23 Jan Schneider Comment #8
State ⇒ Resolved
Reply to this comment
New version of Date_Holidays has been released, code has been merged 
to stable branch.
2009-01-24 17:53:08 Jan Schneider Comment #7
Taken from Horde DevelopersHorde Developers
Milestone ⇒ 2.3.1
Reply to this comment
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);
This is not true, Date_Holidays_Driver is already doing exactly that 
if you pass it a timestamp.



The original issue has been fixed in Date_Holiday though.
2008-12-16 15:38:16 arnaud (at) bdefracte (dot) org Comment #6 Reply to this comment
must be changed to
  $holidays = $dh->getHolidayForDate($date->format('Y-m-d'), $GLOBALS['
language'], true);
Thanks for this solution, holidays are at last displayed again. (with 
a fr_FR locale and Christian driver (yes it wasn't working with 
christian driver on my setup))
2008-12-08 14:03:48 mike (at) msabal (dot) net Comment #5 Reply to this comment
While there may be some issues with holiday locales as reported on the 
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.


2008-10-09 13:56:25 martin (dot) tessun (at) die-tessuns (dot) de Comment #3 Reply to this comment
I get the holidays driver not to work either, but it gets a different error:

[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


2008-09-03 16:45:02 Michael Rubinsky Summary ⇒ Date_Holidays split up breaks translation support for non-christian drivers
 
2008-09-03 16:44:36 Michael Rubinsky Comment #2 Reply to this comment
From IRC discussion



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
2008-09-01 13:14:31 Jan Schneider Assigned to Jan Schneider
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Priority ⇒ 2. Medium
 
2008-09-01 12:52:30 info (at) pmrogan (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Data_Holidays split up breaks translation support for non-christian drivers
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
Reply to this comment
Since Date_Holidays version 0.19.0 the national drivers have been 
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/.




Saved Queries