fnando / i18n-js

It's a small library to provide the I18n translations on the Javascript. It comes with Rails support.
MIT License
3.75k stars 519 forks source link

Support multiple locales dirs in listen backend. #661

Closed morgoth closed 1 year ago

morgoth commented 1 year ago

In addition allow to configure Listen by passing options.

The usecase: having multiple places from where the locales are loaded. We're using https://github.com/tiramizoo/fractual_i18n but it can be any other generic case.

This helps us to configure backend via:

  I18nJS.listen(
    locales_dir: [Rails.root.join("config/locales"), Rails.root.join("app/views")],
    options: {only: %r{.yml$}}
  )
morgoth commented 1 year ago

@fnando what do you think about this PR? Can we have it merged?