Documentation
¶
Index ¶
- Constants
- Variables
- func CreateI18nFile(path string, objs ...interface{}) error
- func GetLanguages() ([]string, error)
- func GetSystemLanguage() (string, error)
- func GoogleTranslate(googleApiKey string, text string, foreignLanguage string) (string, error)
- func SetLanguage(lang string) error
- func Translate(msg string, args ...interface{}) string
- func TranslateFor(language, msg string) string
Constants ¶
View Source
const ( DEFAULT_LANGUAGE = "en" FlagNameAppLanguage = "app.language" )
Variables ¶
View Source
var ( FlagLanguage *string I18nFile *ini.File )
Functions ¶
func CreateI18nFile ¶
func GetLanguages ¶ added in v1.8.0
GetLanguages lists all available languages
func GetSystemLanguage ¶ added in v1.8.0
GetSystemLanguage return BCP 47 standard language name
func GoogleTranslate ¶
func SetLanguage ¶ added in v1.8.0
SetLanguage sets the language file to translation
func TranslateFor ¶ added in v1.8.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.