Skip to content
/ i9n Public

an easy and powerful golang module make your i18n work twice faster, so name it i9n

License

Notifications You must be signed in to change notification settings

feitian124/i9n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  1. extract strings need to be translated in source code
  2. generate resources and translate them by someone
  3. load these resource
  4. 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

About

an easy and powerful golang module make your i18n work twice faster, so name it i9n

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published