diff options
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/config/environment.rb b/config/environment.rb index ec7f61ec1..80f0f144a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -6,7 +6,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') @@ -19,6 +19,7 @@ $:.push(File.join(File.dirname(__FILE__), '../commonlib/rblib')) # ruby-ole and ruby-msg. We use a custom ruby-msg to avoid a name conflict $:.unshift(File.join(File.dirname(__FILE__), '../vendor/ruby-ole/lib')) $:.unshift(File.join(File.dirname(__FILE__), '../vendor/ruby-msg/lib')) +$:.unshift(File.join(File.dirname(__FILE__), '../vendor/plugins/globalize2/lib')) require 'memcache' @@ -50,19 +51,21 @@ Rails::Initializer.run do |config| # config.log_level = :debug # # Specify gems that this application depends on and have them installed with rake gems:install + config.gem "locale", :version => '>=2.0.5' + config.gem "gettext", :version => '>=1.9.3' config.gem "fast_gettext", :version => '>=0.4.8' config.gem "rack", :version => '1.1.0' config.gem "recaptcha", :lib => "recaptcha/rails" config.gem 'rspec', :lib => false, :version => '1.3.1' config.gem 'rspec-rails', :lib => false, :version => '1.3.3' config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org' - + #GettextI18nRails.translations_are_html_safe = true # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. config.action_controller.session = { - :key => '_wdtk_cookie_session', + :session_key => '_wdtk_cookie_session', :secret => MySociety::Config.get("COOKIE_STORE_SESSION_SECRET", 'this default is insecure as code is open source, please override for live sites in config/general; this will do for local development') } config.action_controller.session_store = :cookie_store @@ -105,13 +108,23 @@ ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", if (MySociety::Config.get("DOMAIN", "") != "") ActionController::Base.asset_host = Proc.new { |source, request| if request.fullpath.match(/^\/admin\//) - MySociety::Config.get("ADMIN_PUBLIC_URL", "/") + MySociety::Config.get("ADMIN_PUBLIC_URL", "") else MySociety::Config.get("DOMAIN", 'localhost:3000') end } end +# fallback locale and available locales +I18n.default_locale = :en +if ENV["RAILS_ENV"] == "test" + # The tests assume that the "en" and "es" locales are available + FastGettext.default_available_locales = ["en", "es"] +else + available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en') + FastGettext.default_available_locales = available_locales.split() +end + # Load monkey patches and other things from lib/ require 'tmail_extensions.rb' require 'activesupport_cache_extensions.rb' @@ -123,5 +136,4 @@ require 'activerecord_errors_extensions.rb' require 'willpaginate_hack.rb' require 'sendmail_return_path.rb' require 'tnef.rb' - - +require 'i18n_fixes.rb' |