locales

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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:

  • ashkenazi_komatz - courtesy Chaim Leib Halbert
  • ashkenazi_litvish - courtesy Andrey Rozenberg
  • ashkenazi_poylish - courtesy Andrey Rozenberg
  • ashkenazi_standard - courtesy Andrey Rozenberg
  • ashkenazi_romanian - 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
  • pl - courtesy Filip Bialek
  • pt - courtesy Zushe Ledovitch
  • ru - courtesy David Leibovych
  • ro - courtesy Florin-Ciprian Bodin
  • uk - courtesy Lyubov Kuzmyn

Documentation

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
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).

"en", "sephardic" and "" are pass-through locales. 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