Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add i18n for multiple language. #18

Closed
tinhan opened this issue Sep 18, 2016 · 2 comments
Closed

How to add i18n for multiple language. #18

tinhan opened this issue Sep 18, 2016 · 2 comments

Comments

@tinhan
Copy link

tinhan commented Sep 18, 2016

Hi i need to add i18n in your example gowebapp How to do that ?

@josephspurrier
Copy link
Owner

That's a good question. There are a few packages out there that will help with multiple languages. I took a quick look at https://github.com/nicksnyder/go-i18n and it looks pretty solid.

The documentation is a little confusing, but you'll want to create a T() function that is available in your templates. Then you can use the same function on any flash messages. You can have a variable in the config.json that specifies the translation or build in something that changes it dynamically.

Here is basic example:
nicksnyder/go-i18n#27 (comment)

And more documentation:
https://godoc.org/github.com/nicksnyder/go-i18n/i18n

@josephspurrier
Copy link
Owner

Closing - info provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants