i18n

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package i18n translates the native desktop UI with the Web UI's own catalogs (web-ui/src/i18n/locales, copied into ./locales; a test keeps the copies in sync). Keys are the i18next dotted paths ("nav.chat"), interpolation is i18next's {{name}}, and plurals use the _one/_other suffixes when a "count" argument is given. Missing keys fall back to English, then to the key itself.

Index

Constants

View Source
const Fallback = "en"

Fallback is the language used for keys a catalog lacks.

Variables

This section is empty.

Functions

func Language

func Language() string

Language returns the selected language.

func Languages

func Languages() []string

Languages returns the available language codes, sorted.

func SetLanguage

func SetLanguage(lang string) string

SetLanguage selects the language of T. A region (es-ES) falls back to its language; an unknown language selects English. It returns the language chosen.

func T

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

T translates key in the selected language. args are name/value pairs for {{name}} placeholders: T("chat.files.changed", "count", 3).

func TL

func TL(lang, key string, args ...any) string

TL translates key in lang.

Types

This section is empty.

Jump to

Keyboard shortcuts

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