etnt / gettext

Erlang internationalization library.
http://www.redhoterlang.com/
MIT License
70 stars 45 forks source link

Make the callback module configurable in the application environment #5

Closed jcomellas closed 12 years ago

jcomellas commented 12 years ago

I've modified gettext.erl too add the function callback_mod/0 that tries to get the name of the callback module from the application's environment and defaults to gettext_server if the configuration key has not been set. I also changed gettext_sup.erl to use this function when initializing the supervisor instead of hardcoding the value of the callback module.

The reason for this change was to be able to set the gettext directory and default language from the app.config file of the application that uses gettext instead of having to use environment variables from the OS shell or having to directly instantiate gettext's supervisor from my application.

Please let me know if you need me to make additional changes to accept this patch.