i18n

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 27

Documentation

Index

Constants

View Source
const (
	DEFAULT_LOCALE   = "en_US"
	DEFAULT_LANGUAGE = "en"
)

Variables

View Source
var (
	RESOUCES_PATH = filepath.Join("cf", "i18n", "resources")
)
View Source
var SUPPORTED_LOCALES = map[string]string{
	"de": "de_DE",
	"en": "en_US",
	"es": "es_ES",
	"fr": "fr_FR",
	"it": "it_IT",
	"ja": "ja_JA",
	"ko": "ko_KO",
	"pt": "pt_BR",
	"ru": "ru_RU",
	"zh": "zh_CN",
}

Functions

func GetResourcesPath

func GetResourcesPath() string

func SupportedLocaleLanguageTags added in v0.6.0

func SupportedLocaleLanguageTags() []language.Tag

Types

type TranslateFunc added in v0.6.0

type TranslateFunc func(translateID string, args ...interface{}) string

func Init

func Init(packageName string, i18nDirname string) TranslateFunc

func Tfunc added in v0.6.0

func Tfunc(sources ...string) TranslateFunc

Tfunc will return a method of TranslateFunc type to be used to tranlation messages

Jump to

Keyboard shortcuts

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