locales

package
v0.3.1 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: ? 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 locales says ui/chat's own messages in the language the app shows. Apps supply other languages in their catalogs, under the key github.com/nsgo-dev/nsgo/ui/chat/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{
	"Thinking":   {"seconds"},
	"ThoughtFor": {"seconds"},
	"Matches":    {"selected", "count"},
}

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

Functions

func Close

func Close(cx *core.Scope) string

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

The accessible label of the button closing the conversation find bar.

func Copied

func Copied(cx *core.Scope) string

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

What screen readers say of the button once the message is on the clipboard.

func Copy

func Copy(cx *core.Scope) string

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

What screen readers say of the button copying a message.

func Edit

func Edit(cx *core.Scope) string

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

What screen readers say of the button reopening a message the user sent.

func Find

func Find(cx *core.Scope) string

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

The label and placeholder of the conversation find field.

func Matches

func Matches(cx *core.Scope, selected int, count int) string

Matches says "{selected, number} of {count, number}" in the language the app shows under cx.

The selected match and total count in the conversation find bar.

func Next

func Next(cx *core.Scope) string

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

The accessible label of the next-match button.

func NoResults

func NoResults(cx *core.Scope) string

NoResults says "No results" in the language the app shows under cx.

What the conversation find bar says when the query has no matches.

func Previous

func Previous(cx *core.Scope) string

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

The accessible label of the previous-match button.

func Retry

func Retry(cx *core.Scope) string

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

What screen readers say of the button asking for the same reply again.

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.

func Thinking

func Thinking(cx *core.Scope, seconds int) string

Thinking says "Thinking… {seconds, number} s" in the language the app shows under cx.

What a reasoning block reads while it streams, with what it has cost so far.

func ThinkingUntimed

func ThinkingUntimed(cx *core.Scope) string

ThinkingUntimed says "Thinking…" in the language the app shows under cx.

What a reasoning block reads while it streams, when the app does not say what it costs.

func ThoughtFor

func ThoughtFor(cx *core.Scope, seconds int) string

ThoughtFor says "Thought for {seconds, number} s" in the language the app shows under cx.

What a reasoning block reads once it ends, with what it cost.

func Thoughts

func Thoughts(cx *core.Scope) string

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

What a reasoning block reads once it ends, when the app does not say what it cost.

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) Close

func (msgs Messages) Close() string

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

func (Messages) Copied

func (msgs Messages) Copied() string

Copied is the package's Copied 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) Edit

func (msgs Messages) Edit() string

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

func (Messages) Find

func (msgs Messages) Find() string

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

func (Messages) Matches

func (msgs Messages) Matches(selected int, count int) string

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

func (Messages) Next

func (msgs Messages) Next() string

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

func (Messages) NoResults

func (msgs Messages) NoResults() string

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

func (Messages) Previous

func (msgs Messages) Previous() string

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

func (Messages) Retry

func (msgs Messages) Retry() string

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

func (Messages) Thinking

func (msgs Messages) Thinking(seconds int) string

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

func (Messages) ThinkingUntimed

func (msgs Messages) ThinkingUntimed() string

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

func (Messages) ThoughtFor

func (msgs Messages) ThoughtFor(seconds int) string

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

func (Messages) Thoughts

func (msgs Messages) Thoughts() string

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

type Translation

type Translation struct {
	Texts      map[string]string
	Thinking   func(seconds int) string
	ThoughtFor func(seconds int) string
	Matches    func(selected int, count 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