language

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, key string, texts map[string]Text) string

Get ... 現在の言語環境の言語を取得する

func SetKey

func SetKey(ctx context.Context, key Key) context.Context

SetKey ... 種類を設定する

Types

type Key

type Key string

Key ... 言語の種類

const (
	// KeyJapanese ... 言語: 日本語
	KeyJapanese Key = "ja"
	// KeyEnglish ... 言語: 英語
	KeyEnglish Key = "en"
	// KeyTraditionalChinese ... 言語: 中国語(繁)
	KeyTraditionalChinese Key = "zh-hant"
)

func GetKey

func GetKey(ctx context.Context) Key

GetKey ... 種類を取得する

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware ... 言語のミドルウェア

func NewMiddleware

func NewMiddleware(headerKey string, defaultKey Key) *Middleware

NewMiddleware ... Middlewareを作成する

func (*Middleware) Handle

func (m *Middleware) Handle(next http.Handler) http.Handler

Handle ... 言語を設定する

type Text

type Text map[Key]string

Text ... 文言

Jump to

Keyboard shortcuts

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