Documentation
¶
Overview ¶
Package i18n holds the control panel's English and Korean message catalogs (1.1.0).
Catalogs are embedded JSON files, one per language and surface (en/<surface>.json, ko/<surface>.json). A value is plain text with named {placeholders}, or {"one": ..., "other": ...} when a count changes the wording. Values never contain markup: templates own the markup and html/template escapes the result. Placeholders are filled in a single pass, so text inside an argument (a display name such as "{n}") is never interpreted.
Index ¶
Constants ¶
const ( English = "en" Korean = "ko" )
Variables ¶
var Languages = []string{English, Korean}
Languages lists the supported languages; English is the default and the fallback.
Functions ¶
func JS ¶
JS returns the js.* messages of a language (English for any missing key) for the page's JSON data block. A counted message becomes {"one": ..., "other": ...}.
func Placeholders ¶
Placeholders lists the placeholder names of a text (for the catalog tests).
Types ¶
type Entry ¶
type Entry struct {
One, Other string
}
Entry is one message. Other is always set; One is the singular form used when the count argument "n" is 1.