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
- Variables
- func Clear(cx *core.Scope) string
- func Copy(cx *core.Scope) string
- func Disconnected(cx *core.Scope) string
- func KeyAlt(cx *core.Scope) string
- func KeyControl(cx *core.Scope) string
- func KeyDown(cx *core.Scope) string
- func KeyEnd(cx *core.Scope) string
- func KeyEscape(cx *core.Scope) string
- func KeyHome(cx *core.Scope) string
- func KeyLeft(cx *core.Scope) string
- func KeyPageDown(cx *core.Scope) string
- func KeyPageUp(cx *core.Scope) string
- func KeyRight(cx *core.Scope) string
- func KeyTab(cx *core.Scope) string
- func KeyUp(cx *core.Scope) string
- func Paste(cx *core.Scope) string
- func ProcessExited(cx *core.Scope) string
- func ProcessExitedWithCode(cx *core.Scope, code int) string
- func SelectAll(cx *core.Scope) string
- func Supply(lang string, t Translation)
- type Messages
- func (msgs Messages) Clear() string
- func (msgs Messages) Copy() string
- func (msgs Messages) Disconnected() string
- func (msgs Messages) KeyAlt() string
- func (msgs Messages) KeyControl() string
- func (msgs Messages) KeyDown() string
- func (msgs Messages) KeyEnd() string
- func (msgs Messages) KeyEscape() string
- func (msgs Messages) KeyHome() string
- func (msgs Messages) KeyLeft() string
- func (msgs Messages) KeyPageDown() string
- func (msgs Messages) KeyPageUp() string
- func (msgs Messages) KeyRight() string
- func (msgs Messages) KeyTab() string
- func (msgs Messages) KeyUp() string
- func (msgs Messages) Paste() string
- func (msgs Messages) ProcessExited() string
- func (msgs Messages) ProcessExitedWithCode(code int) string
- func (msgs Messages) SelectAll() string
- type Translation
Constants ¶
const Source = "en"
Source is the language the messages are written in.
Variables ¶
var Catalog = i18n.NewCatalog("en", "zh-Hans")
Catalog holds the messages' languages: en, the source, zh-Hans, and those other packages supply.
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 ¶
Clear says "Clear" in the language the app shows under cx.
Clear the terminal's screen above its prompt and its scrollback.
func Copy ¶
Copy says "Copy" in the language the app shows under cx.
Copy the terminal's selected text from its context menu.
func Disconnected ¶
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 ¶
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 ¶
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 ¶
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 ¶
KeyEnd says "End" in the language the app shows under cx.
The End key on the bar of keys.
func KeyEscape ¶
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 ¶
KeyHome says "Home" in the language the app shows under cx.
The Home key on the bar of keys.
func KeyLeft ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
Paste says "Paste" in the language the app shows under cx.
Paste into the terminal from its context menu.
func ProcessExited ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) Disconnected ¶
Disconnected is the package's Disconnected in the language of msgs.
func (Messages) KeyControl ¶
KeyControl is the package's KeyControl in the language of msgs.
func (Messages) KeyPageDown ¶
KeyPageDown is the package's KeyPageDown in the language of msgs.
func (Messages) ProcessExited ¶
ProcessExited is the package's ProcessExited in the language of msgs.
func (Messages) ProcessExitedWithCode ¶
ProcessExitedWithCode is the package's ProcessExitedWithCode in the language of msgs.
type Translation ¶
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.