lang

package
v0.0.0-...-b1976e4 Latest Latest
Warning

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

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

Documentation

Overview

Package lang handles localization of language UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(lang Language)

Set sets the active language for the process.

Types

type Language

type Language string

Language is used to declare the language for UI purpose.

const (
	En   Language = "en"
	Es   Language = "es"
	Fr   Language = "fr"
	FrCa Language = "fr_ca"
)

Known languages.

TODO(maruel): Add new languages when translating the application.

func Active

func Active() Language

Active returns the active language for the process.

type Map

type Map map[Language]string

Map is the mapping of strings based on the language.

func (Map) Formatf

func (m Map) Formatf(args ...interface{}) string

Formatf returns fmt.Sprintf(m.String(), args...) as a shortcut.

func (Map) Get

func (m Map) Get(lang Language) string

Get returns the string for the language if present, defaults to En.

func (Map) String

func (m Map) String() string

Jump to

Keyboard shortcuts

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