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

Refactor #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Refactor #1

wants to merge 3 commits into from

Conversation

Arinzeokeke
Copy link

Hi, thanks for this! Saved me a lot of work. Did a little refactor to it to fix some issues I found while using it.

  1. Made the Init function return the Engine so it can be passed around into other functions, instead of being initialized all the time and removed the Tr and Lang functions in tr.go as they were no longer neccessary.
  2. Handle situation where a localeName doesnt exist
  3. Updated readme to reflect changes

@tucnak
Copy link
Owner

tucnak commented Dec 18, 2017

Hey,

Thanks of all, thank you for your contribution. I really liked your changes, but I'd rather keep both Tr and Lang methods. In Go it's generally accepted to have an idea of "default" something, see. net/http's DefaultClient. I believe it's no harm to have an extra global thing running for the sake of it. It certainly does work for all apps I use tr for.

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

Successfully merging this pull request may close these issues.

2 participants