diff --git a/package.json b/package.json index 28441f7..4c287fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hebcal/core", - "version": "3.0.3", + "version": "3.0.4", "author": "Michael J. Radwin (https://github.com/mjradwin)", "contributors": [ "Eyal Schachter (https://github.com/Scimonster)", diff --git a/po/ashkenazi.po b/po/ashkenazi.po index e6bb423..b98665f 100644 --- a/po/ashkenazi.po +++ b/po/ashkenazi.po @@ -199,3 +199,6 @@ msgstr "Parshas" msgid "Leil Selichot" msgstr "Leil Selichos" + +msgid "Shabbat Mevarchim Chodesh" +msgstr "Shabbos Mevorchim Chodesh" diff --git a/po/he.po b/po/he.po index 1ec3ed9..0890afd 100644 --- a/po/he.po +++ b/po/he.po @@ -804,3 +804,6 @@ msgstr "ראש השנה למעשר בהמה" msgid "Tish'a B'Av (observed)" msgstr "תִּשְׁעָה בְּאָב נִדחֶה" + +msgid "Shabbat Mevarchim Chodesh" +msgstr "שַׁבָּת מברכים חוֹדֶשׁ" diff --git a/src/holidays.js b/src/holidays.js index 51bd04d..09b9b1b 100644 --- a/src/holidays.js +++ b/src/holidays.js @@ -115,6 +115,7 @@ export class MevarchimChodeshEvent extends Event { */ constructor(date, monthName) { super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM); + this.monthName = monthName; } /** * Returns (translated) description of this event @@ -122,17 +123,6 @@ export class MevarchimChodeshEvent extends Event { * @return {string} */ render(locale) { - const monthName = this.getDesc().substring(mevarchimChodeshStr.length + 1); - return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + Locale.gettext(monthName, locale); - } - /** - * Returns (translated) description of this event - * @param {string} [locale] Optional locale name (defaults to active locale). - * @return {string} - */ - renderBrief(locale) { - const str = this.render(locale); - const space = str.indexOf(' '); - return str.substring(space + 1); + return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + Locale.gettext(this.monthName, locale); } } diff --git a/src/holidays.spec.js b/src/holidays.spec.js index 4ceb2c9..b98ef38 100644 --- a/src/holidays.spec.js +++ b/src/holidays.spec.js @@ -40,7 +40,7 @@ test('basename-and-url', (t) => { const mvch = new MevarchimChodeshEvent(new HDate(23, months.KISLEV, 5769), 'Tevet'); t.is(mvch.getDesc(), 'Shabbat Mevarchim Chodesh Tevet'); t.is(mvch.render(), 'Shabbat Mevarchim Chodesh Tevet'); - t.is(mvch.renderBrief(), 'Mevarchim Chodesh Tevet'); + t.is(mvch.renderBrief(), 'Shabbat Mevarchim Chodesh Tevet'); t.is(mvch.url(), undefined); });