i18n

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

package i18n provides internationalization and localization support for Keymaster. It uses the go-i18n library to load and manage translation files, allowing the user interface to be displayed in multiple languages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLang added in v1.3.2

func GetLang() string

GetLang returns the string tag of the currently active language.

func Init

func Init(lang string)

Init initializes the i18n bundle and sets up the localizer for a specific language. It parses all embedded YAML files from the 'locales' directory.

func SetLang

func SetLang(lang string)

SetLang changes the active language of the localizer.

func T

func T(messageID string, args ...any) string

T is a convenience function to translate a message by its ID. If the i18n system has not been initialized, it will default to English. If a translation for the given ID is not found, it returns the ID itself.

Types

This section is empty.

Jump to

Keyboard shortcuts

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