translate

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_LANGUAGE = "en"

	FlagNameAppLanguage = "app.language"
)

Variables

View Source
var (
	FlagLanguage *string

	I18nFile *ini.File
)

Functions

func CreateI18nFile

func CreateI18nFile(path string, objs ...interface{}) error

func GetLanguages added in v1.8.0

func GetLanguages() ([]string, error)

GetLanguages lists all available languages

func GetSystemLanguage added in v1.8.0

func GetSystemLanguage() (string, error)

GetSystemLanguage return BCP 47 standard language name

func GoogleTranslate

func GoogleTranslate(googleApiKey string, text string, foreignLanguage string) (string, error)

func SetLanguage added in v1.8.0

func SetLanguage(lang string) error

SetLanguage sets the language file to translation

func Translate added in v1.8.0

func Translate(msg string, args ...interface{}) string

Translate a message to the current set language

func TranslateFor added in v1.8.0

func TranslateFor(language, msg string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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