locales

package module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

README

locales

Translations for Hebcal events in multiple languages (Golang)

Build Status Go Report Card GoDoc

Adds support for the following locales:

  • en - only MEMO:* strings for holiday descriptions
  • ashkenazi_komatz - Ashkenazic transliterations, komatz variant - courtesy Chaim Leib Halbert
  • ashkenazi_litvish - Ashkenazic transliterations, Litvish variant - courtesy Andrey Rozenberg
  • ashkenazi_poylish - Ashkenazic transliterations, Poylish variant - courtesy Andrey Rozenberg
  • ashkenazi_standard - Ashkenazic transliterations, standard variant - courtesy Andrey Rozenberg
  • ashkenazi_romanian - Ashkenazic transliterations, Romanian variant - courtesy Florin-Ciprian Bodin
  • de - courtesy Dr Oliver Maor
  • es - courtesy Iosef Kebesh and Sebastian Thierer
  • fi - courtesy Petteri Hjort
  • fr - courtesy Marc Neiger
  • hu - courtesy Oleh Korchytskyi
  • nl
  • pl - courtesy Filip Bialek
  • pt - courtesy Zushe Ledovitch
  • ru - courtesy David Leibovych
  • ro - courtesy Florin-Ciprian Bodin
  • uk - courtesy Lyubov Kuzmyn
  • yi

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

View Source
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.

View Source
var Catalog = catalog.NewBuilder()

Catalog holds every Hebcal translation, keyed by BCP-47 language.Tag.

Functions

func HebrewStripNikkud

func HebrewStripNikkud(str string) string

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

func LookupTranslation(key string, locale string) (string, bool)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL