Documentation
¶
Overview ¶
Package locales says the text view'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/textview/locales.
Index ¶
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{}
Parameters names the parameters of each message that has some, by its method, for the TSX declarations of the messages (tsx.RegisterMessages).
Functions ¶
func AlertCaution ¶
AlertCaution says "Caution" in the language the app shows under cx.
The title of a Markdown alert of an action's risks ("> [!CAUTION]").
func AlertImportant ¶
AlertImportant says "Important" in the language the app shows under cx.
The title of a Markdown alert of what users need to know ("> [!IMPORTANT]").
func AlertNote ¶
AlertNote says "Note" in the language the app shows under cx.
The title of a Markdown alert of information users should notice ("> [!NOTE]").
func AlertTip ¶
AlertTip says "Tip" in the language the app shows under cx.
The title of a Markdown alert of advice ("> [!TIP]").
func AlertWarning ¶
AlertWarning says "Warning" in the language the app shows under cx.
The title of a Markdown alert of what needs attention at once ("> [!WARNING]").
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) AlertCaution ¶
AlertCaution is the package's AlertCaution in the language of msgs.
func (Messages) AlertImportant ¶
AlertImportant is the package's AlertImportant in the language of msgs.
func (Messages) AlertWarning ¶
AlertWarning is the package's AlertWarning 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.