erikhuda/thor — pull request #434 by dg-vrnetze (2014-08-25 14:10:08+00:00)
Title: First steps to provide localization for thor

Hi there,

I use`thor` in my projects a lot and would like to provide the users a localized cli. Parts are done, but messages generated by `thor` itself are missing.

This is a very rough version, which I send to you to get some feedback. I would like to add a very thin layer to `thor` just to make it possible to localize its messages. The hard work should be done outside `thor`, e.g. by `I18n` or some other library.

For now I changed the messages in `lib/thor.rb` to give you an idea about the API. I took some code from `I18n` to make interpolation possible. Therefor it has the same functionality like `I18n` in regards of string interpolation.

In this version I use a `YAML`-file to store the translations. But this is just for my convenience during development. To speed things up, I can put that stuff into a `Hash` or some similar data structures.

Would you mind to give me some feedback? Would you merge such an PR if it matches your quality requirements etc..

Thank you very much.

Regards,
dg