locales

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 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 locales says the terminal's own messages in the language the app shows. Apps supply other languages in their catalogs, under the key github.com/nsgo-dev/nsgo/base/terminal/locales.

Index

Constants

View Source
const Source = "en"

Source is the language the messages are written in.

Variables

View Source
var Catalog = i18n.NewCatalog("en", "zh-Hans")

Catalog holds the messages' languages: en, the source, zh-Hans, and those other packages supply.

View Source
var Parameters = map[string][]string{
	"ProcessExitedWithCode": {"code"},
}

Parameters names the parameters of each message that has some, by its method, for the TSX declarations of the messages (tsx.RegisterMessages).

Functions

func Clear

func Clear(cx *core.Scope) string

Clear says "Clear" in the language the app shows under cx.

Clear the terminal's screen above its prompt and its scrollback.

func Copy

func Copy(cx *core.Scope) string

Copy says "Copy" in the language the app shows under cx.

Copy the terminal's selected text from its context menu.

func Disconnected

func Disconnected(cx *core.Scope) string

Disconnected says "Disconnected" in the language the app shows under cx.

The line a terminal connected to a stream, such as an SSH session, writes once the stream ended.

func KeyAlt

func KeyAlt(cx *core.Scope) string

KeyAlt says "Alt" in the language the app shows under cx.

The Alt key on the bar of keys over a touch screen's keyboard, which applies to the next key.

func KeyControl

func KeyControl(cx *core.Scope) string

KeyControl says "Ctrl" in the language the app shows under cx.

The Control key on the bar of keys over a touch screen's keyboard, which applies to the next key.

func KeyDown

func KeyDown(cx *core.Scope) string

KeyDown says "Down arrow" in the language the app shows under cx.

What screen readers say of the down arrow key on the bar of keys.

func KeyEnd

func KeyEnd(cx *core.Scope) string

KeyEnd says "End" in the language the app shows under cx.

The End key on the bar of keys.

func KeyEscape

func KeyEscape(cx *core.Scope) string

KeyEscape says "Esc" in the language the app shows under cx.

The Escape key on the bar of keys over a touch screen's keyboard, as keyboards label it.

func KeyHome

func KeyHome(cx *core.Scope) string

KeyHome says "Home" in the language the app shows under cx.

The Home key on the bar of keys.

func KeyLeft

func KeyLeft(cx *core.Scope) string

KeyLeft says "Left arrow" in the language the app shows under cx.

What screen readers say of the left arrow key on the bar of keys.

func KeyPageDown

func KeyPageDown(cx *core.Scope) string

KeyPageDown says "Page down" in the language the app shows under cx.

What screen readers say of the Page Down key on the bar of keys.

func KeyPageUp

func KeyPageUp(cx *core.Scope) string

KeyPageUp says "Page up" in the language the app shows under cx.

What screen readers say of the Page Up key on the bar of keys.

func KeyRight

func KeyRight(cx *core.Scope) string

KeyRight says "Right arrow" in the language the app shows under cx.

What screen readers say of the right arrow key on the bar of keys.

func KeyTab

func KeyTab(cx *core.Scope) string

KeyTab says "Tab" in the language the app shows under cx.

The Tab key on the bar of keys over a touch screen's keyboard.

func KeyUp

func KeyUp(cx *core.Scope) string

KeyUp says "Up arrow" in the language the app shows under cx.

What screen readers say of the up arrow key on the bar of keys.

func Paste

func Paste(cx *core.Scope) string

Paste says "Paste" in the language the app shows under cx.

Paste into the terminal from its context menu.

func ProcessExited

func ProcessExited(cx *core.Scope) string

ProcessExited says "[Process exited]" in the language the app shows under cx.

The line a terminal writes under a program's output once the program ended with code 0.

func ProcessExitedWithCode

func ProcessExitedWithCode(cx *core.Scope, code int) string

ProcessExitedWithCode says "[Process exited with code {code}]" in the language the app shows under cx.

The line a terminal writes under a program's output once the program ended with another code.

func SelectAll

func SelectAll(cx *core.Scope) string

SelectAll says "Select All" in the language the app shows under cx.

Select the terminal's screen and scrollback from its context menu.

func Supply

func Supply(lang string, t Translation)

Supply adds the messages t has in lang to the catalog, over its own. nsgo writes the calls, in the package that supplies them, which runs them as it initializes.

Types

type Messages

type Messages struct {
	// contains filtered or unexported fields
}

Messages say the messages in one language, their times in the hour cycle hc the user set; with mark, the source's with their arguments marked, which a pseudo locale transforms.

func For

func For(cx *core.Scope) Messages

For returns the messages in the language the app shows under cx (i18n.Language), their times as the user reads them; a binding that says them follows both as they change.

func In

func In(locale string) Messages

In returns the messages in the catalog's language that suits locale best, as zh-Hant suits zh-TW, else in the source language.

func (Messages) Clear

func (msgs Messages) Clear() string

Clear is the package's Clear in the language of msgs.

func (Messages) Copy

func (msgs Messages) Copy() string

Copy is the package's Copy in the language of msgs.

func (Messages) Disconnected

func (msgs Messages) Disconnected() string

Disconnected is the package's Disconnected in the language of msgs.

func (Messages) KeyAlt

func (msgs Messages) KeyAlt() string

KeyAlt is the package's KeyAlt in the language of msgs.

func (Messages) KeyControl

func (msgs Messages) KeyControl() string

KeyControl is the package's KeyControl in the language of msgs.

func (Messages) KeyDown

func (msgs Messages) KeyDown() string

KeyDown is the package's KeyDown in the language of msgs.

func (Messages) KeyEnd

func (msgs Messages) KeyEnd() string

KeyEnd is the package's KeyEnd in the language of msgs.

func (Messages) KeyEscape

func (msgs Messages) KeyEscape() string

KeyEscape is the package's KeyEscape in the language of msgs.

func (Messages) KeyHome

func (msgs Messages) KeyHome() string

KeyHome is the package's KeyHome in the language of msgs.

func (Messages) KeyLeft

func (msgs Messages) KeyLeft() string

KeyLeft is the package's KeyLeft in the language of msgs.

func (Messages) KeyPageDown

func (msgs Messages) KeyPageDown() string

KeyPageDown is the package's KeyPageDown in the language of msgs.

func (Messages) KeyPageUp

func (msgs Messages) KeyPageUp() string

KeyPageUp is the package's KeyPageUp in the language of msgs.

func (Messages) KeyRight

func (msgs Messages) KeyRight() string

KeyRight is the package's KeyRight in the language of msgs.

func (Messages) KeyTab

func (msgs Messages) KeyTab() string

KeyTab is the package's KeyTab in the language of msgs.

func (Messages) KeyUp

func (msgs Messages) KeyUp() string

KeyUp is the package's KeyUp in the language of msgs.

func (Messages) Paste

func (msgs Messages) Paste() string

Paste is the package's Paste in the language of msgs.

func (Messages) ProcessExited

func (msgs Messages) ProcessExited() string

ProcessExited is the package's ProcessExited in the language of msgs.

func (Messages) ProcessExitedWithCode

func (msgs Messages) ProcessExitedWithCode(code int) string

ProcessExitedWithCode is the package's ProcessExitedWithCode in the language of msgs.

func (Messages) SelectAll

func (msgs Messages) SelectAll() string

SelectAll is the package's SelectAll in the language of msgs.

type Translation

type Translation struct {
	Texts                 map[string]string
	ProcessExitedWithCode func(code int) string
}

Translation is a language's messages another package supplies: those without arguments in Texts, by key, and a function for each of the others; a key or a field left out leaves the message to the catalog.

Jump to

Keyboard shortcuts

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