i18n

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MPL-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package i18n picks Turkish or English messages. Messages are written inline as pairs:

i18n.S("Server deleted", "Sunucu silindi")

The language comes from --lang, GYRO_LANG, the profile, then LC_ALL / LC_MESSAGES / LANG (tr* → Turkish, otherwise English).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect() string

Detect reads the locale from the environment.

func F

func F(en, tr string, a ...any) string

F formats the message in the current language.

func Lang

func Lang() string

Lang returns the current language code.

func Normalize

func Normalize(v string) string

Normalize maps tr_TR.UTF-8, tr, turkish ... to "tr"; anything else to "en".

func S

func S(en, tr string) string

S returns the message in the current language.

func Set

func Set(l string)

Set forces a language ("tr" or "en").

func TR

func TR() bool

TR reports Turkish output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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