i18n

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_LANGUAGE = "en"
View Source
const HZN_LANG = "HZN_LANG"

Variables

This section is empty.

Functions

func FindMatchingLanguage

func FindMatchingLanguage(tag language.Tag) language.Tag

find the default matching language for locae laguage. The fallback is English

func GetLocale

func GetLocale() (language.Tag, error)

use HZN_LANG or LANG env variables

func GetMessagePrinter

func GetMessagePrinter() *message.Printer

Get the default message printer.

func GetMessagePrinterWithLocale

func GetMessagePrinterWithLocale(locale string) *message.Printer

Get the message printer with the given locale. The fallback is English if the given locale is not a valid locale string. If it is a valid locale string, but the language is not in the supported list, go text will find the best match for it.

func InitMessagePrinter

func InitMessagePrinter(useEnglish bool) error

create a message printer with locale defined in HZN_LANG or LANG. Fallback to English

Types

This section is empty.

Jump to

Keyboard shortcuts

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