Documentation
¶
Overview ¶
Package locales provides string translations of Hebcal holiday names, Torah/Haftarah readings, and related terms in multiple languages.
The supported locale names, in priority order, are:
- en, sephardic: Sephardic transliterations (default if unspecified)
- ashkenazi: Ashkenazic transliterations
- he: Hebrew – עברית
- he-x-NoNikud: Hebrew without nikud (vowel points)
- ashkenazi_komatz: Ashkenazic transliterations, komatz variant
- ashkenazi_litvish: Ashkenazic transliterations, Litvish variant
- ashkenazi_poylish: Ashkenazic transliterations, Poylish variant
- ashkenazi_romanian: Ashkenazic transliterations, Romanian variant
- ashkenazi_standard: Ashkenazic transliterations, standard variant
- de: German – Deutsch
- es: Spanish – Español
- fi: Finnish – Suomalainen
- fr: French – français
- hu: Hungarian – Magyar nyelv
- nl: Dutch – Nederlands
- pl: Polish – język polski
- pt: Portuguese – Português
- ro: Romanian – română
- ru: Russian – ру́сский язы́к
- uk: Ukrainian – українська
- yi: Yiddish – ייִדיש
The message catalogues are generated by @hebcal/po2catalog from the .po files in the upstream @hebcal npm packages; see the header comment in a file such as strings_he.go for the source of truth. Do not edit the generated strings_*.go files by hand.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var AllLocales = []string{
"en",
"ashkenazi",
"he",
"he-x-NoNikud",
"ashkenazi_komatz",
"ashkenazi_litvish",
"ashkenazi_poylish",
"ashkenazi_romanian",
"ashkenazi_standard",
"de",
"es",
"fi",
"fr",
"hu",
"nl",
"pl",
"pt",
"ro",
"ru",
"uk",
"yi",
}
AllLocales lists every supported Hebcal locale name, in priority order.
var Catalog = catalog.NewBuilder()
Catalog holds every Hebcal translation, keyed by BCP-47 language.Tag.
Functions ¶
func HebrewStripNikkud ¶
HebrewStripNikkud removes niqqud (vowels) from a Hebrew string
Example ¶
package main
import (
"fmt"
"github.com/hebcal/locales"
)
func main() {
src := "וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ"
dest := locales.HebrewStripNikkud(src)
fmt.Println(dest)
}
Output: והארץ היתה תהו ובהו
func LookupTranslation ¶
LookupTranslation returns the translated message for key in the given locale. It returns ok=false when no translation exists (the key is returned as-is).
"sephardic" and "" are aliases for the "en" locale. For dictionary locales, the catalogue never stores identity translations, so a Sprintf result equal to the key reliably means "not found".
Types ¶
This section is empty.
Source Files
¶
- catalog.go
- doc.go
- nikud.go
- strings_ashkenazi.go
- strings_ashkenazi_komatz.go
- strings_ashkenazi_litvish.go
- strings_ashkenazi_poylish.go
- strings_ashkenazi_romanian.go
- strings_ashkenazi_standard.go
- strings_de.go
- strings_en.go
- strings_es.go
- strings_fi.go
- strings_fr.go
- strings_he.go
- strings_he_x_NoNikud.go
- strings_hu.go
- strings_nl.go
- strings_pl.go
- strings_pt.go
- strings_ro.go
- strings_ru.go
- strings_uk.go
- strings_yi.go