gnlang

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCodeLength = errors.New("invalid language code length")
View Source
var ErrUnknownCode = errors.New("unknown language code")

Functions

func Country

func Country(code string) string

Country returns the country name for the given ISO 3166-1 alpha-2 code.

func CountryCode

func CountryCode(country string) string

CountryCode returns the ISO 3166-1 alpha-2 code for the given country name.

func Lang

func Lang(code string) string

Lang returns the language name for the given ISO 639-3 code.

func LangCode

func LangCode(lang string) string

LangCode returns the ISO 639-3 code for the given language name.

func LangCode2To3Letters added in v0.6.2

func LangCode2To3Letters(code string) (string, error)

LangCode2To3Letters converts a two-letter ISO 639-1 language code to a three-letter ISO 639-3 language code.

func LangCode3To2Letters added in v0.6.2

func LangCode3To2Letters(code string) (string, error)

LangCode3To2Letters converts a three-letter ISO 639-3 language code to a two-letter ISO 639-1 language code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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