locale

package
v0.16.2 Latest Latest
Warning

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

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

README

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotDetected returns while no locale detected.
	ErrNotDetected = errors.New("not detected")
	// ErrNotSupported means current platform or language is not supported.
	ErrNotSupported = errors.New("not supported")
)

Functions

func Detect

func Detect() (tag language.Tag, err error)

Detect will detect current env's language.

func DetectAll

func DetectAll() (tags []language.Tag, err error)

DetectAll will detect current env's all available language.

Types

type Error

type Error struct {
	Op  string
	Err error
}

Error is the error returned by locale.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap implements xerrors.Wrapper

Jump to

Keyboard shortcuts

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