LoginSignup
0
0

More than 5 years have passed since last update.

Locale Dir Setting

Posted at

Default Locale Setting

# config/applicaiton.rb
  class Application < Rails::Application
    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
  end
config/locales
├── en.yml
├── ja.yml
└── ja_model.yml
└── ja_recapcha.yml

In default setting, Rails only includes 'rb' file, or 'yml' file located in 'config/locale'. This is kind of inconvenient.

My setting

# config/applicaiton.rb
  class Application < Rails::Application
    config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
  end

My locales is placed like:

config/locales
├── en.yml
├── gem
│   └── recaptcha.yml
├── ja.yml
└── models
    ├── user.yml
    └── profile.yml
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0