Onur Özgür ÖZKAN

Php, Ruby, Kebab, Git Geek

Add Ruby on Rails Locale Files From Subfolders

As you know locale files place at /config/locales folder like en.yml, tr.yml . If you want to organize your folder with sub folder. You must edit your config/application.rb

1
2
3
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
config.i18n.default_locale = :en

Best regards.