boolshabbat_p=(weekday==Saturday);// Is it a Saturday?
// Treat Adar in a non-leap year as if it were Adar II.
if((month==12)&&!leap_year_p)
month=13;
switch(month)
{
case1:/* Nissan */
switch(day)
{
case1:
if(shabbat_p)
holidays<<
i18n
("These are Jewish holidays and mostly do not have translations. They may have different spellings in your language; otherwise, just translate the sound to your characters",
"Sh. HaHodesh");
break;
case14:
if(!shabbat_p)
// If it's Shabbat, we have three pieces of info.
// This is the least important.
holidays<<i18n("Erev Pesach");
/* Fall thru */
case8:
case9:
case10:
case11:
case12:
case13:
// The Saturday before Pesach (8th-14th)
if(shabbat_p)
holidays<<i18n("Sh. HaGadol");
break;
case15:
case16:
case21:
case22:
if(!israel_p||(day==15)||(day==21))
{
holidays<<i18n("Pesach");
break;
}
elseif(day==22)
break;
/* else fall through */
case17:
case18:
case19:
case20:
if(CholP)
holidays<<i18n("Chol Hamoed");
break;
case27:
// Yom HaShoah only exists since Israel was established.
if(year>1948+3760)
holidays<<i18n("Yom HaShoah");
break;
}
if((day>15)&&OmerP)
// Count the Omer, starting after the first day of Pesach.
holidays<<Sfirah(day-15);
break;
case2:/* Iyar */
switch(day)
{
case2:
case3:
case4:
case5:
// Yom HaAtzmaut is on the 5th, unless that's a Saturday, in which
// case it is moved back two days to Thursday. Yom HaZikaron is
// the day before Yom HaAtzmaut.
if(year>=1948+3760)
{// only after Israel established.
switch(weekday)
{
caseWednesday:
if(day==5)
holidays<<i18n("Yom HaAtzmaut");
else
holidays<<i18n("Yom HaZikaron");
break;
caseThursday:
// This can't be 2 Iyar.
holidays<<i18n("Yom HaAtzmaut");
break;
caseFriday:
caseSaturday:
// These are never either of them.
break;
default:
// All other days follow the normal rules.
if(day==4)
holidays<<i18n("Yom HaZikaron");
elseif(day==5)
holidays<<i18n("Yom HaAtzmaut");
}
}
break;
case28:
// only since the 1967 war
if(year>1967+3760)
holidays<<i18n("Yom Yerushalayim");
break;
case18:
holidays<<i18n("Lag BaOmer");
break;
}
if((day!=18)&&OmerP)
// Sfirah the whole month. But Lag BaOmer is already mentioned.
holidays<<Sfirah(day+15);
break;
case3:/* Sivan */
switch(day)
{
case1:
case2:
case3:
case4:
// Sfirah until Shavuot
if(OmerP)
holidays<<Sfirah(day+44);
break;
case5:
// Don't need to mention Sfira(49) if there's already two other
// pieces of information
if(OmerP&&!shabbat_p)
holidays<<Sfirah(49);
holidays<<i18n("Erev Shavuot");
break;
case6:
case7:
if(!israel_p||(day==6))
holidays<<i18n("Shavuot");
break;
}
break;
case4:/* Tamuz */
// 17th of Tamuz, except Shabbat pushes it to Sunday.
if((!shabbat_p&&(day==17))
||((weekday==1)&&(day==18)))
holidays<<i18n("Tzom Tammuz");
break;
case5:/* Ab */
if(shabbat_p&&(3<=day)&&(day<=16))
// The shabbat before and after Tisha B'Av are special
if(day<=9)
holidays<<i18n("Sh. Hazon");
else
holidays<<i18n("Sh. Nahamu");
elseif((!shabbat_p&&(day==9))
||((weekday==1)&&(day==10)))
// 9th of Av, except Shabbat pushes it to Sunday.
holidays<<i18n("Tisha B'Av");
break;
case6:/* Elul */
if((day>=20)&&(day<=26)&&shabbat_p)
holidays<<i18n("S'lichot");
elseif(day==29)
holidays<<i18n("Erev R.H.");
break;
case7:/* Tishrei */
switch(day)
{
case1:
case2:
holidays<<i18n("Rosh Hashana");
break;
case3:
if(shabbat_p)
holidays<<i18n("Sh. Shuvah");
else
holidays<<i18n("Tzom Gedalia");
break;
case4:
if(weekday==1)
holidays<<i18n("Tzom Gedalia");
/* fall through */
case5:
case6:
case7:
case8:
if(shabbat_p)
holidays<<i18n("Sh. Shuvah");
break;
case9:
holidays<<i18n("Erev Y.K.");
break;
case10:
holidays<<i18n("Yom Kippur");
break;
case14:
holidays<<i18n("Erev Sukkot");
break;
case15:
case16:
if(!israel_p||(day==15))
{
holidays<<i18n("Sukkot");
break;
}
/* else fall through */
case17:
case18:
case19:
case20:
if(CholP)
holidays<<i18n("Chol Hamoed");
break;
case21:
holidays<<i18n("Hoshana Rabah");
break;
case22:
holidays<<i18n("Shmini Atzeret");
break;
case23:
if(!israel_p)
holidays<<i18n("Simchat Torah");
break;
}
break;
case8:/* Cheshvan */
break;
case9:/* Kislev */
if(day==24)
holidays<<i18n("Erev Hanukah");
elseif(day>=25)
holidays<<i18n("Hanukah");
break;
case10:/* Tevet */
if(day<=(kvia==0?3:2))
// Need to know length of Kislev to determine last day of Chanukah
holidays<<i18n("Hanukah");
elseif(((day==10)&&!shabbat_p)
||((day==11)&&(weekday==1)))
// 10th of Tevet. Shabbat pushes it to Sunday
holidays<<i18n("Tzom Tevet");
break;
case11:/* Shvat */
switch(day)
{
// The info for figuring out Shabbat Shirah is from the Gnu code. I
// assume it's correct.
// static char *song = i18n("Sh. Shirah";
case10:
if((kvia!=0)&&shabbat_p)
holidays<<i18n("Sh. Shirah");
break;
case11:
case12:
case13:
case14:
case16:
if(shabbat_p)
holidays<<i18n("Sh. Shirah");
break;
case15:
if(shabbat_p)
holidays<<i18n("Sh. Shirah");
holidays<<i18n("Tu B'Shvat");
case17:
if((kvia==0)&&shabbat_p)
holidays<<i18n("Sh. Shirah");
break;
case25:
case26:
case27:
case28:
case29:
case30:
// The last shabbat on or before 1 Adar or 1 AdarII
if(shabbat_p&&!leap_year_p)
holidays<<i18n("Sh. Shekalim");
break;
}
break;
case12:/* Adar I */
if(day==14)
// Eat Purim Katan Candy
holidays<<i18n("Purim Katan");
elseif((day>=25)&&shabbat_p)
// The last shabbat on or before 1 Adar II.
holidays<<i18n("Sh. Shekalim");
break;
case13:/* Adar II or Adar */
switch(day)
{
case1:
if(shabbat_p)
holidays<<i18n("Sh. Shekalim");
break;
case11:
case12:
// Ta'anit ester is on the 13th. But shabbat moves it back to
// Thursday.
if(weekday==Thursday)
holidays<<i18n("Ta'anit Ester");
/* Fall thru */
case7:
case8:
case9:
case10:
// The Shabbat before purim is Shabbat Zachor
if(shabbat_p)
holidays<<i18n("Sh. Zachor");
break;
case13:
if(shabbat_p)
holidays<<i18n("Sh. Zachor");
else
holidays<<i18n("Erev Purim");
// It's Ta'anit Esther, unless it's a Friday or Saturday