Documentation
¶
Overview ¶
Package locales says base'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/locales.
Index ¶
- Constants
- Variables
- func BreadcrumbsMore(cx *core.Scope) string
- func CalendarMonth(cx *core.Scope, d time.Time) string
- func CalendarMonthName(cx *core.Scope, d time.Time) string
- func CalendarNext(cx *core.Scope) string
- func CalendarPrevious(cx *core.Scope) string
- func CalendarWeekday(cx *core.Scope, d time.Time) string
- func CollapseMerge(cx *core.Scope) string
- func ColorAlpha(cx *core.Scope) string
- func ColorBlue(cx *core.Scope) string
- func ColorBrightnessPercent(cx *core.Scope) string
- func ColorCopy(cx *core.Scope) string
- func ColorEyeDropper(cx *core.Scope) string
- func ColorFormat(cx *core.Scope) string
- func ColorGreen(cx *core.Scope) string
- func ColorHex(cx *core.Scope) string
- func ColorHue(cx *core.Scope) string
- func ColorHueDegrees(cx *core.Scope) string
- func ColorLightnessPercent(cx *core.Scope) string
- func ColorOpacityPercent(cx *core.Scope) string
- func ColorRed(cx *core.Scope) string
- func ColorSaturationBrightness(cx *core.Scope) string
- func ColorSaturationPercent(cx *core.Scope) string
- func CommandList(cx *core.Scope) string
- func CommandLoading(cx *core.Scope) string
- func CommandNoMatches(cx *core.Scope) string
- func CommandSearch(cx *core.Scope) string
- func CommandSearchPlaceholder(cx *core.Scope) string
- func DiffDiscardChanges(cx *core.Scope) string
- func DiffExpandAll(cx *core.Scope) string
- func DiffStage(cx *core.Scope) string
- func DiffUnchangedLines(cx *core.Scope, n int) string
- func ExpandMerge(cx *core.Scope) string
- func FlowLabel(cx *core.Scope, nodes int, edges int) string
- func ListClear(cx *core.Scope) string
- func ListNothingFound(cx *core.Scope) string
- func ListSearch(cx *core.Scope) string
- func SortBy(cx *core.Scope, column string) string
- func Supply(lang string, t Translation)
- type Messages
- func (msgs Messages) BreadcrumbsMore() string
- func (msgs Messages) CalendarMonth(d time.Time) string
- func (msgs Messages) CalendarMonthName(d time.Time) string
- func (msgs Messages) CalendarNext() string
- func (msgs Messages) CalendarPrevious() string
- func (msgs Messages) CalendarWeekday(d time.Time) string
- func (msgs Messages) CollapseMerge() string
- func (msgs Messages) ColorAlpha() string
- func (msgs Messages) ColorBlue() string
- func (msgs Messages) ColorBrightnessPercent() string
- func (msgs Messages) ColorCopy() string
- func (msgs Messages) ColorEyeDropper() string
- func (msgs Messages) ColorFormat() string
- func (msgs Messages) ColorGreen() string
- func (msgs Messages) ColorHex() string
- func (msgs Messages) ColorHue() string
- func (msgs Messages) ColorHueDegrees() string
- func (msgs Messages) ColorLightnessPercent() string
- func (msgs Messages) ColorOpacityPercent() string
- func (msgs Messages) ColorRed() string
- func (msgs Messages) ColorSaturationBrightness() string
- func (msgs Messages) ColorSaturationPercent() string
- func (msgs Messages) CommandList() string
- func (msgs Messages) CommandLoading() string
- func (msgs Messages) CommandNoMatches() string
- func (msgs Messages) CommandSearch() string
- func (msgs Messages) CommandSearchPlaceholder() string
- func (msgs Messages) DiffDiscardChanges() string
- func (msgs Messages) DiffExpandAll() string
- func (msgs Messages) DiffStage() string
- func (msgs Messages) DiffUnchangedLines(n int) string
- func (msgs Messages) ExpandMerge() string
- func (msgs Messages) FlowLabel(nodes int, edges int) string
- func (msgs Messages) ListClear() string
- func (msgs Messages) ListNothingFound() string
- func (msgs Messages) ListSearch() string
- func (msgs Messages) SortBy(column string) 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{
"SortBy": {"column"},
"DiffUnchangedLines": {"n"},
"CalendarMonth": {"d"},
"CalendarMonthName": {"d"},
"CalendarWeekday": {"d"},
"FlowLabel": {"nodes", "edges"},
}
Parameters names the parameters of each message that has some, by its method, for the TSX declarations of the messages (tsx.RegisterMessages).
Functions ¶
func BreadcrumbsMore ¶
BreadcrumbsMore says "More" in the language the app shows under cx.
What screen readers say of the button listing a breadcrumb path's collapsed ancestors.
func CalendarMonth ¶
CalendarMonth says "{d, date, ::yMMMM}" in the language the app shows under cx.
A date in a calendar's header, grid of months or weekday headings.
func CalendarMonthName ¶
CalendarMonthName says "{d, date, ::MMM}" in the language the app shows under cx.
A date in a calendar's header, grid of months or weekday headings.
func CalendarNext ¶
CalendarNext says "Next month" in the language the app shows under cx.
What a styled picker says for this part.
func CalendarPrevious ¶
CalendarPrevious says "Previous month" in the language the app shows under cx.
What a styled picker says for this part.
func CalendarWeekday ¶
CalendarWeekday says "{d, date, ::EEEEE}" in the language the app shows under cx.
A date in a calendar's header, grid of months or weekday headings.
func CollapseMerge ¶
CollapseMerge says "Collapse Merge" in the language the app shows under cx.
What screen readers say of a commit graph's button hiding the commits a merge brings in.
func ColorAlpha ¶
ColorAlpha says "Opacity" in the language the app shows under cx.
What a styled picker says for this part.
func ColorBlue ¶
ColorBlue says "Blue" in the language the app shows under cx.
What a styled picker says for this part.
func ColorBrightnessPercent ¶
ColorBrightnessPercent says "Brightness percent" in the language the app shows under cx.
What a styled picker says for this part.
func ColorCopy ¶
ColorCopy says "Copy color" in the language the app shows under cx.
What a styled picker says for this part.
func ColorEyeDropper ¶
ColorEyeDropper says "Pick a color from the screen" in the language the app shows under cx.
What a styled picker says for this part.
func ColorFormat ¶
ColorFormat says "Color format" in the language the app shows under cx.
What a styled picker says for this part.
func ColorGreen ¶
ColorGreen says "Green" in the language the app shows under cx.
What a styled picker says for this part.
func ColorHex ¶
ColorHex says "Hex color" in the language the app shows under cx.
What a styled picker says for this part.
func ColorHue ¶
ColorHue says "Hue" in the language the app shows under cx.
What a styled picker says for this part.
func ColorHueDegrees ¶
ColorHueDegrees says "Hue degrees" in the language the app shows under cx.
What a styled picker says for this part.
func ColorLightnessPercent ¶
ColorLightnessPercent says "Lightness percent" in the language the app shows under cx.
What a styled picker says for this part.
func ColorOpacityPercent ¶
ColorOpacityPercent says "Opacity percent" in the language the app shows under cx.
What a styled picker says for this part.
func ColorRed ¶
ColorRed says "Red" in the language the app shows under cx.
What a styled picker says for this part.
func ColorSaturationBrightness ¶
ColorSaturationBrightness says "Saturation and brightness" in the language the app shows under cx.
What a styled picker says for this part.
func ColorSaturationPercent ¶
ColorSaturationPercent says "Saturation percent" in the language the app shows under cx.
What a styled picker says for this part.
func CommandList ¶
CommandList says "Commands" in the language the app shows under cx.
What screen readers say of a command palette's list of results.
func CommandLoading ¶
CommandLoading says "Loading…" in the language the app shows under cx.
What a command palette says while a search is under way.
func CommandNoMatches ¶
CommandNoMatches says "No matching commands" in the language the app shows under cx.
What a command palette says while no command matches its query.
func CommandSearch ¶
CommandSearch says "Search commands" in the language the app shows under cx.
What screen readers say of a command palette's search field.
func CommandSearchPlaceholder ¶
CommandSearchPlaceholder says "Search commands…" in the language the app shows under cx.
The hint in a command palette's empty search field.
func DiffDiscardChanges ¶
DiffDiscardChanges says "Discard Changes…" in the language the app shows under cx.
The button that, after asking, throws away the lines of a diff's change.
func DiffExpandAll ¶
DiffExpandAll says "Expand all" in the language the app shows under cx.
What screen readers say of the button showing all of a diff's collapsed lines.
func DiffStage ¶
DiffStage says "Stage" in the language the app shows under cx.
The button staging the lines of a diff's change for a commit.
func DiffUnchangedLines ¶
DiffUnchangedLines says "{n, plural, one {# unchanged line} other {# unchanged lines}}" in the language the app shows under cx.
What a diff says of the unchanged lines it collapses.
func ExpandMerge ¶
ExpandMerge says "Expand Merge" in the language the app shows under cx.
What screen readers say of a commit graph's button showing the commits a merge brings in.
func FlowLabel ¶
FlowLabel says "{nodes, plural, one {# node} other {# nodes}}, {edges, plural, one {# edge} other {# edges}}" in the language the app shows under cx.
What screen readers say of a flow diagram the app gives no label, its counts of nodes and edges.
func ListClear ¶
ListClear says "Clear" in the language the app shows under cx.
What a styled picker says for this part.
func ListNothingFound ¶
ListNothingFound says "Nothing found" in the language the app shows under cx.
What a styled picker says for this part.
func ListSearch ¶
ListSearch says "Search" in the language the app shows under cx.
What a styled picker says for this part.
func SortBy ¶
SortBy says "Sort by {column}" in the language the app shows under cx.
What screen readers say of a data table column's sort button.
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) BreadcrumbsMore ¶
BreadcrumbsMore is the package's BreadcrumbsMore in the language of msgs.
func (Messages) CalendarMonth ¶
CalendarMonth is the package's CalendarMonth in the language of msgs.
func (Messages) CalendarMonthName ¶
CalendarMonthName is the package's CalendarMonthName in the language of msgs.
func (Messages) CalendarNext ¶
CalendarNext is the package's CalendarNext in the language of msgs.
func (Messages) CalendarPrevious ¶
CalendarPrevious is the package's CalendarPrevious in the language of msgs.
func (Messages) CalendarWeekday ¶
CalendarWeekday is the package's CalendarWeekday in the language of msgs.
func (Messages) CollapseMerge ¶
CollapseMerge is the package's CollapseMerge in the language of msgs.
func (Messages) ColorAlpha ¶
ColorAlpha is the package's ColorAlpha in the language of msgs.
func (Messages) ColorBrightnessPercent ¶
ColorBrightnessPercent is the package's ColorBrightnessPercent in the language of msgs.
func (Messages) ColorEyeDropper ¶
ColorEyeDropper is the package's ColorEyeDropper in the language of msgs.
func (Messages) ColorFormat ¶
ColorFormat is the package's ColorFormat in the language of msgs.
func (Messages) ColorGreen ¶
ColorGreen is the package's ColorGreen in the language of msgs.
func (Messages) ColorHueDegrees ¶
ColorHueDegrees is the package's ColorHueDegrees in the language of msgs.
func (Messages) ColorLightnessPercent ¶
ColorLightnessPercent is the package's ColorLightnessPercent in the language of msgs.
func (Messages) ColorOpacityPercent ¶
ColorOpacityPercent is the package's ColorOpacityPercent in the language of msgs.
func (Messages) ColorSaturationBrightness ¶
ColorSaturationBrightness is the package's ColorSaturationBrightness in the language of msgs.
func (Messages) ColorSaturationPercent ¶
ColorSaturationPercent is the package's ColorSaturationPercent in the language of msgs.
func (Messages) CommandList ¶
CommandList is the package's CommandList in the language of msgs.
func (Messages) CommandLoading ¶
CommandLoading is the package's CommandLoading in the language of msgs.
func (Messages) CommandNoMatches ¶
CommandNoMatches is the package's CommandNoMatches in the language of msgs.
func (Messages) CommandSearch ¶
CommandSearch is the package's CommandSearch in the language of msgs.
func (Messages) CommandSearchPlaceholder ¶
CommandSearchPlaceholder is the package's CommandSearchPlaceholder in the language of msgs.
func (Messages) DiffDiscardChanges ¶
DiffDiscardChanges is the package's DiffDiscardChanges in the language of msgs.
func (Messages) DiffExpandAll ¶
DiffExpandAll is the package's DiffExpandAll in the language of msgs.
func (Messages) DiffUnchangedLines ¶
DiffUnchangedLines is the package's DiffUnchangedLines in the language of msgs.
func (Messages) ExpandMerge ¶
ExpandMerge is the package's ExpandMerge in the language of msgs.
func (Messages) ListNothingFound ¶
ListNothingFound is the package's ListNothingFound in the language of msgs.
func (Messages) ListSearch ¶
ListSearch is the package's ListSearch in the language of msgs.
type Translation ¶
type Translation struct {
Texts map[string]string
SortBy func(column string) string
DiffUnchangedLines func(n int) string
CalendarMonth func(d time.Time) string
CalendarMonthName func(d time.Time) string
CalendarWeekday func(d time.Time) string
FlowLabel func(nodes int, edges 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.