Commit Graph

13 Commits

Author SHA1 Message Date
José Valim
8d5939c096 Fix a bug where I18n fallbacks modules where not included in the proper backend if it was set through config.i18n.backend. 2010-05-23 13:22:19 +02:00
Sven Fuchs
9a3a4d6aef Make i18n fallbacks configurable and fallback to the default locale by default in production [#4428 state:resolved]
Allows to configure locale fallbacks through config.i18n.fallbacks. The default setting
config.i18n.fallbacks = true in production.rb will make I18n.t lookup fallback to the
I18n.default_locale if a translation could not be found for the current or given locale.

config.fallbacks = true

config.fallbacks.map = { :ca => :es }
config.fallbacks.defaults = [:'es-ES', :es]

config.fallbacks = [:'es-ES', :es]

config.fallbacks = { :ca => :es }

config.fallbacks = [:'es-ES', :es, { :ca => :es }]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2010-04-17 19:26:46 +01:00
wycats
4aded43b73 Replace the placeholder base_hook API with on_load. To specify some code that
should run during framework load do:

ActiveSupport.on_load(:action_controller) do
  # Code run in the context of AC::Base
end
2010-03-29 17:08:50 -07:00
José Valim
395d6648ce Move application configuration to the application configuration object, remove railtie_name and engine_name and allow to set the configuration object. 2010-03-26 18:47:55 +01:00
wycats
39d6f9e112 Make many parts of Rails lazy. In order to facilitate this,
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.

With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.

TODO: rename base_hook
2010-03-07 06:24:30 -08:00
José Valim
fed72b5842 Rename engines_load_path to railties_load_path. 2010-02-20 15:46:55 +01:00
José Valim
6404feee50 AC railtie should configure helpers path. 2010-01-26 21:05:50 +01:00
José Valim
1177a40e68 Fix i18n locales order test. 2010-01-25 22:10:11 +01:00
José Valim
3b6f659fb6 Add active_model/railtie back to generated boot.rb, add models back to paths, load active_support/railtie since we need it and ensure default logger is set before config. 2010-01-25 01:12:22 +01:00
José Valim
e548f96b1d Rename plugin_name to railtie_name and engine_name. 2010-01-24 12:23:21 +01:00
José Valim
5cd9aad4fd Add I18n tests to engines. 2010-01-24 10:27:42 +01:00
José Valim
98240c49b0 Get rid of initializers global and create i18n railtie. 2010-01-23 01:29:29 +01:00
José Valim
c8cc8a9872 Moved more configuration away from bootstrap. 2010-01-22 20:44:38 +01:00