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
- Variables
- func Copied(cx *core.Scope) string
- func Copy(cx *core.Scope) string
- func Edit(cx *core.Scope) string
- func Retry(cx *core.Scope) string
- func Supply(lang string, t Translation)
- func Thinking(cx *core.Scope, seconds int) string
- func ThinkingUntimed(cx *core.Scope) string
- func ThoughtFor(cx *core.Scope, seconds int) string
- func Thoughts(cx *core.Scope) string
- type Messages
- func (msgs Messages) Copied() string
- func (msgs Messages) Copy() string
- func (msgs Messages) Edit() string
- func (msgs Messages) Retry() string
- func (msgs Messages) Thinking(seconds int) string
- func (msgs Messages) ThinkingUntimed() string
- func (msgs Messages) ThoughtFor(seconds int) string
- func (msgs Messages) Thoughts() 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{
"Thinking": {"seconds"},
"ThoughtFor": {"seconds"},
}
Parameters names the parameters of each message that has some, by its method, for the TSX declarations of the messages (tsx.RegisterMessages).
Functions ¶
func Copied ¶
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 ¶
Copy says "Copy" in the language the app shows under cx.
What screen readers say of the button copying a message.
func Edit ¶
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 Retry ¶
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 ¶
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 ¶
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 ¶
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.
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) ThinkingUntimed ¶
ThinkingUntimed is the package's ThinkingUntimed in the language of msgs.
func (Messages) ThoughtFor ¶
ThoughtFor is the package's ThoughtFor in the language of msgs.
type Translation ¶
type Translation struct {
Texts map[string]string
Thinking func(seconds int) string
ThoughtFor func(seconds 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.