i18n

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package i18n handles internationalization for Keymaster. It uses go-i18n to load and manage translation files, and provides a simple interface for the rest of the application to get translated strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableLocales added in v1.4.0

func GetAvailableLocales() map[string]string

GetAvailableLocales returns a map of language codes to their display names.

func GetLang added in v1.3.2

func GetLang() string

GetLang returns the currently active language code.

func Init

func Init(defaultLang string)

Init initializes the i18n bundle, discovers available locales, and sets the default language.

func SetLang

func SetLang(lang string)

SetLang changes the current language for the application.

func T

func T(messageID string, templateData ...interface{}) string

T is the main translation function. It retrieves a translated string by its ID. It supports pluralization and template variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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