wski18n

package
v0.0.0-...-b1ca4bc Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DEFAULT_LOCALE = "en_US"
)

Variables

View Source
var SUPPORTED_LOCALES = []string{
	"de_DE",
	"en_US",
	"es_ES",
	"fr_FR",
	"it_IT",
	"ja_JA",
	"ko_KR",
	"pt_BR",
	"zh_Hans",
	"zh_Hant",
}

Functions

func CurLocale

func CurLocale() string

func GetResourcePath

func GetResourcePath() string

func Init

func Init(detector Detector) string

func InitWithLocale

func InitWithLocale(locale string)

func LangOfLocale

func LangOfLocale(locale string) string

func Locale

func Locale(detector Detector) string

func SetResourcePath

func SetResourcePath(path string)

Types

type Detector

type Detector interface {
	DetectLocale() string
	DetectLanguage() string
}

type JibberJabberDetector

type JibberJabberDetector struct{}

func (*JibberJabberDetector) DetectLanguage

func (d *JibberJabberDetector) DetectLanguage() string

func (*JibberJabberDetector) DetectLocale

func (d *JibberJabberDetector) DetectLocale() string

Jump to

Keyboard shortcuts

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