i18n

package module
v0.0.0-...-e930894 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2016 License: Apache-2.0 Imports: 4 Imported by: 355

README

i18n

Package i18n is for app Internationalization and Localization.

Documentation

Documentation

Overview

Package i18n is for app Internationalization and Localization.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDescriptionByIndex

func GetDescriptionByIndex(index int) string

func GetDescriptionByLang

func GetDescriptionByLang(lang string) string

func GetLangByIndex

func GetLangByIndex(index int) string

Get language by index id

func IndexLang

func IndexLang(lang string) int

Check language name if exist

func IsExist

func IsExist(lang string) bool

Check language name if exist

func ListLangDescs

func ListLangDescs() []string

func ListLangs

func ListLangs() []string

List all locale languages

func ReloadLangs

func ReloadLangs(langs ...string) error

Reload locales

func SetMessage

func SetMessage(lang, filePath string, appendFiles ...string) error

SetMessage sets the message file for localization.

func SetMessageData

func SetMessageData(lang string, data []byte) error

func SetMessageDataWithDesc

func SetMessageDataWithDesc(lang, langDesc string, data []byte) error

func SetMessageWithDesc

func SetMessageWithDesc(lang, langDesc, filePath string, appendFiles ...string) error

func Tr

func Tr(lang, format string, args ...interface{}) string

Tr translate content to target language.

Types

type Locale

type Locale struct {
	Lang string
}

A Locale describles the information of localization.

func (Locale) Index

func (l Locale) Index() int

Index get lang index of LangStore

func (Locale) Tr

func (l Locale) Tr(format string, args ...interface{}) string

Tr translate content to target language.

Directories

Path Synopsis
beei18n is a helper tool for beego/i18n package.
beei18n is a helper tool for beego/i18n package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL