tr icon indicating copy to clipboard operation
tr copied to clipboard

Refactor

Open Arinzeokeke opened this issue 7 years ago • 1 comments
trafficstars

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

Arinzeokeke avatar Dec 17 '17 22:12 Arinzeokeke

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.

tucnak avatar Dec 18 '17 22:12 tucnak