Documentation ¶
Overview ¶
Package i18n contains localized strings for user facing messages.
Code generated for package i18n by go-bindata DO NOT EDIT. (@generated) sources: ../../translations/cs_CZ/LC_MESSAGES/acsengine.mo ../../translations/cs_CZ/LC_MESSAGES/acsengine.po ../../translations/de_DE/LC_MESSAGES/acsengine.mo ../../translations/de_DE/LC_MESSAGES/acsengine.po ../../translations/en_US/LC_MESSAGES/acsengine.mo ../../translations/en_US/LC_MESSAGES/acsengine.po ../../translations/en_US/LC_MESSAGES/acsengine.po.lcg ../../translations/en_US/LC_MESSAGES/en-US/lcl/acsengine.po.lcl ../../translations/en_US/LC_MESSAGES/en-US/metadata/acsengine.po.xml ../../translations/es_ES/LC_MESSAGES/acsengine.mo ../../translations/es_ES/LC_MESSAGES/acsengine.po ../../translations/fr_FR/LC_MESSAGES/acsengine.mo ../../translations/fr_FR/LC_MESSAGES/acsengine.po ../../translations/hu_HU/LC_MESSAGES/acsengine.mo ../../translations/hu_HU/LC_MESSAGES/acsengine.po ../../translations/it_IT/LC_MESSAGES/acsengine.mo ../../translations/it_IT/LC_MESSAGES/acsengine.po ../../translations/ja_JP/LC_MESSAGES/acsengine.mo ../../translations/ja_JP/LC_MESSAGES/acsengine.po ../../translations/ko_KR/LC_MESSAGES/acsengine.mo ../../translations/ko_KR/LC_MESSAGES/acsengine.po ../../translations/nl_NL/LC_MESSAGES/acsengine.mo ../../translations/nl_NL/LC_MESSAGES/acsengine.po ../../translations/pl_PL/LC_MESSAGES/acsengine.mo ../../translations/pl_PL/LC_MESSAGES/acsengine.po ../../translations/pt_BR/LC_MESSAGES/acsengine.mo ../../translations/pt_BR/LC_MESSAGES/acsengine.po ../../translations/pt_PT/LC_MESSAGES/acsengine.mo ../../translations/pt_PT/LC_MESSAGES/acsengine.po ../../translations/ru_RU/LC_MESSAGES/acsengine.mo ../../translations/ru_RU/LC_MESSAGES/acsengine.po ../../translations/sv_SE/LC_MESSAGES/acsengine.mo ../../translations/sv_SE/LC_MESSAGES/acsengine.po ../../translations/tr_TR/LC_MESSAGES/acsengine.mo ../../translations/tr_TR/LC_MESSAGES/acsengine.po ../../translations/zh_CN/LC_MESSAGES/acsengine.mo ../../translations/zh_CN/LC_MESSAGES/acsengine.po ../../translations/zh_TW/LC_MESSAGES/acsengine.mo ../../translations/zh_TW/LC_MESSAGES/acsengine.po
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func GetLanguage() string
- func Initialize(locale *gotext.Locale) error
- func LoadTranslations() (*gotext.Locale, error)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SetLanguage(language string)
- type Translator
- func (t *Translator) Errorf(msgid string, vars ...interface{}) error
- func (t *Translator) NErrorf(msgid, msgidPlural string, n int, vars ...interface{}) error
- func (t *Translator) NT(msgid, msgidPlural string, n int, vars ...interface{}) string
- func (t *Translator) T(msgid string, vars ...interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func Initialize ¶
Initialize is the translation initialization function shared by the main program and package.
func LoadTranslations ¶
LoadTranslations loads translation files and sets the locale to the system locale. It should be called by the main program.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func SetLanguage ¶
func SetLanguage(language string)
SetLanguage sets the program's current locale. If the language is not supported, then the default locale is used.
Types ¶
type Translator ¶
Translator is a wrapper over gotext's Locale and provides interface to translate text string and produce translated error
func (*Translator) Errorf ¶
func (t *Translator) Errorf(msgid string, vars ...interface{}) error
Errorf produces an error with a translated error string.
func (*Translator) NErrorf ¶
func (t *Translator) NErrorf(msgid, msgidPlural string, n int, vars ...interface{}) error
NErrorf produces an error with a translated error string in the appropriate plural form.
func (*Translator) NT ¶
func (t *Translator) NT(msgid, msgidPlural string, n int, vars ...interface{}) string
NT translates a text string into the appropriate plural form, based on GNU's gettext library.
func (*Translator) T ¶
func (t *Translator) T(msgid string, vars ...interface{}) string
T translates a text string, based on GNU's gettext library.