Comments (2)
It looks like Sedra.getString()
doesn't implement translations as the documentation says. I'll need to clarify.
Here are two options for now:
- If you're using the simple interface, specify
locale
as part ofoptions
:
import {HebrewCalendar} from '@hebcal/core';
const options = {
locale: 'he',
sedrot: true,
noHolidays: true,
};
const events = HebrewCalendar.calendar(options);
for (const ev of events) {
const hd = ev.getDate();
const date = hd.greg();
console.log(date.toLocaleDateString(), ev.render());
}
- If you want to use the lower-level
Sedra
API, you can do this:
import {Locale, Sedra, ParshaEvent} from '@hebcal/core';
// specify default locale so you don't need to pass a locale argument to render()
Locale.useLocale('he');
const sedra = new Sedra(5780, true);
const hd = new HDate(new Date(2020, 6, 7));
const parsha = sedra.get(hd);
const ev = new ParshaEvent(hd, parsha);
console.log(ev.render());
from hebcal-es6.
OK, we've published @hebcal/[email protected]
which adds locale-awareness to Sedra.getString()
without having to use the ParshaEvent
workaround.
const {Locale, Sedra, HDate} = require('@hebcal/core');
Locale.useLocale('he');
const sedra = new Sedra(5781, false);
console.log(sedra.getString(new HDate(new Date(2021, 3, 24))));
// פרשת אַחֲרֵי מוֹת־קְדשִׁים
from hebcal-es6.
Related Issues (20)
- GPL License HOT 1
- Is Hebcal's interpretation of the Eisenberg triennial cycle in error? HOT 2
- Shabbat Chol Hamoed Sukkot bug in REST API and HTML HOT 1
- Daf Yomi: Tamid 34 should be Midot 34 HOT 1
- Custom export - missing data HOT 4
- get full month object HOT 1
- Shouldn't only candle lighting and havdalah times show up? HOT 1
- `TimedEvent` type annotations do not expose timing information HOT 1
- Wrong number of p'sukim HOT 1
- Shabbat Times Gives Date But Not Times HOT 3
- Sunrise/sunset changes by large amount between February and March HOT 4
- api for ios, for few shabat in advence HOT 1
- Weekday Torah Reading Leyning? HOT 4
- Add Yerushalmi Yomi calendar HOT 1
- Change class statics to global (file-level) const HOT 1
- Is it possible to use hDate.renderGematriya() without nikud? HOT 2
- 21 Nisan 5781 is missing ParshaEvent HOT 1
- iCloud HOT 1
- Example how to exclude holiday types with `HebrewCalendar.getHolidaysOnDate` HOT 2
- Channukah is on the wrong day HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hebcal-es6.