lang

package
v0.0.0-...-a44c12d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Current string
View Source
var Languages = []Lang{
	{Key: "en", Name: "English", ImgPath: "lang/en.png"},
	{Key: "fr", Name: "French", ImgPath: "lang/fr.png"},
	{Key: "es", Name: "Spanish", ImgPath: "lang/es.png"},
	{Key: "it", Name: "Italian", ImgPath: "lang/it.png"},
	{Key: "nl", Name: "Dutch", ImgPath: "lang/nl.png"},
	{Key: "de", Name: "German", ImgPath: "lang/de.png"},
	{Key: "ru", Name: "Russian", ImgPath: "lang/ru.png"},
	{Key: "pt", Name: "Portuguese", ImgPath: "lang/pt.png"},
	{Key: "ro", Name: "Romanian", ImgPath: "lang/ro.png"},
	{Key: "jp", Name: "Japanese", ImgPath: "lang/jp.png"},
	{Key: "ko", Name: "Korean", ImgPath: "lang/ko.png"},
	{Key: "zh_s", Name: "Chinese Simplified", ImgPath: "lang/zh.png"},
	{Key: "zh_t", Name: "Chinese Traditional", ImgPath: "lang/zh.png"},
}

don't use map[string] the ordering is not guaranteed

Functions

func Load

func Load() error

func TimeAgo

func TimeAgo(date time.Time) string

func Translate

func Translate(eng string) string

Types

type Lang

type Lang struct {
	Key     string
	Name    string
	ImgPath string
}

func Get

func Get(key string) *Lang

Jump to

Keyboard shortcuts

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