Registry / web-framework / go-macaron-i18n

go-macaron-i18n

JSON →
library0.6.0gogounverified

Package i18n provides an Internationalization and Localization middleware for Macaron applications.

go get github.com/go-macaron/i18n
INSTALL
IMPORT
SIG · GO-MACARON-I18N
G
go-macaron-i18n
web-frameworkgov0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

i18n
github.com/go-macaron/i18n

Sets up i18n middleware with English and Chinese support.

package main import ( "gopkg.in/macaron.v1" "github.com/go-macaron/i18n" ) func main() { m := macaron.Classic() m.Use(i18n.I18n(i18n.Options{ Langs: []string{"en-US", "zh-CN"}, Names: []string{"English", "简体中文"}, })) m.Get("/", func(ctx *macaron.Context) { ctx.Write([]byte(ctx.Tr("hello"))) }) m.Run() }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.6.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
go-macaron-i18n — go get go-macaron-i18n · libregistry