Skip to content

Commit

Permalink
Hebrew and Ashkenazi translations of "Shabbat Mevarchim Chodesh"
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jan 7, 2021
1 parent c6c2e18 commit 945d198
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions po/ashkenazi.po
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,6 @@ msgstr "Parshas"

msgid "Leil Selichot"
msgstr "Leil Selichos"

msgid "Shabbat Mevarchim Chodesh"
msgstr "Shabbos Mevorchim Chodesh"
3 changes: 3 additions & 0 deletions po/he.po
Original file line number Diff line number Diff line change
Expand Up @@ -804,3 +804,6 @@ msgstr "ראש השנה למעשר בהמה"

msgid "Tish'a B'Av (observed)"
msgstr "תִּשְׁעָה בְּאָב נִדחֶה"

msgid "Shabbat Mevarchim Chodesh"
msgstr "שַׁבָּת מברכים חוֹדֶשׁ"
14 changes: 2 additions & 12 deletions src/holidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,14 @@ export class MevarchimChodeshEvent extends Event {
*/
constructor(date, monthName) {
super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
this.monthName = monthName;
}
/**
* Returns (translated) description of this event
* @param {string} [locale] Optional locale name (defaults to active locale).
* @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);
}
}
2 changes: 1 addition & 1 deletion src/holidays.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 945d198

Please sign in to comment.