josedonizetti / ruby-duration

Immutable type that represents some amount of time with accuracy in seconds.
http://bit.ly/ruby-duration
MIT License
124 stars 23 forks source link

Removing active-support issues causes uncaught exception #29

Open glennpratt opened 8 years ago

glennpratt commented 8 years ago
./vendor/bundler/ruby/2.2.0/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!': :en is not a valid locale (I18n::InvalidLocale)
    from ./vendor/bundler/ruby/2.2.0/gems/i18n-0.7.0/lib/i18n.rb:151:in `translate'
    from ./vendor/bundler/ruby/2.2.0/gems/ruby-duration-3.2.2/lib/duration.rb:247:in `i18n_for'
    from ./vendor/bundler/ruby/2.2.0/gems/ruby-duration-3.2.2/lib/duration.rb:193:in `format'
glennpratt commented 8 years ago

As far as I can tell, activesupport isn't providing any translations for time units and we are always providing a default.

I think we should either provide our own basic en translations or disable I18n.enforce_available_locales in our use case. For now, I will open a PR that restores active_support/i18n.