module
Version:
v0.0.0-...-2750eb5
Opens a new window with list of versions in this module.
Published: Jun 27, 2021
License: MIT
Opens a new window with license information.
README
¶
i9n
i9n is an easy and powerful golang module make your i18n work twice faster, namely i9n
.
feature
- no need write i18n resource files, use
i9n.Printf
and generate them by one command.
- support go-zero, gin out of box, other frameworks by plugins
example
→ go run cmd/main.go -l ch
用戶您好, 你要 1 个苹果还是 2 两个苹果?
→ go run cmd/main.go -l en
hi, customer. 1 apple or 2 apples?
todo
go has built in support for i18n at https://github.com/golang/text.git,
the baisc idea is:
- extract strings need to be translated in source code
- generate resources and translate them by someone
- load these resource
- manually rewrite or use
gotext rewrite
to replace fmt.Print
with message.Printer
see gotext
branch, which works after build but has issue when run go run main.go
directly
thanks
Directories
¶
|
|
internal
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.