lang

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 3 Imported by: ? 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 lang gives the kit the language of the window it draws in: its words for every text the window shows, its casing and the way it is written. One window speaks one language at a time; the server speaks each request's own, never this one

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(context, english string, args ...any) string

A message whose English is said two ways, said in the window's language the way the context names

func Copy

func Copy(kind, id, field, english string) string

Registry copy in the window's language: what the language says under the structural name kind:id:field, else under the English

func Error

func Error(err error) string

The error as a person reads it in the window's language

func Errorf

func Errorf(english string, args ...any) error

An error a person reads, its English as written and its words said in the window's language where Error shows it

func InstallKeys

func InstallKeys(name func(id string) string)

Sets the function that names the keys of an action for the {key:action.id} placeholders of texts

func Keys

func Keys(text string) string

The text with every {key:action.id} placeholder replaced by the keys bound to that action, so a text names a key the way it is bound now

func N

func N(count any, one, other string, args ...any) string

A message whose words follow a count, said in the window's language

func RightToLeft

func RightToLeft() bool

Whether the window's language is written right to left

func Say

func Say(text base.Text) string

The text in the window's language, its {key:action.id} placeholders naming the keys bound now

func T

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

A message said in the window's language, its {key:action.id} placeholders naming the keys bound now

func Upper

func Upper(text string) string

The text in capitals by the casing of the window's language, Turkish and Azerbaijani keeping the dot of their i

func Use

func Use(l *base.Language)

Has the window speak the language from now on

func Version

func Version() uint64

Count of the changes to the language and the key namer so far, so text drawn from them is made again only once it moved

func Window

func Window() *base.Language

Language the window speaks, English while it has named none

Types

This section is empty.

Jump to

Keyboard shortcuts

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