From 86364a8cdee21583cb7472e237f6e352d5306ceb Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 31 May 2009 17:35:05 -0300 Subject: [PATCH] Trying to fix GetText issues --- app/controllers/application.rb | 13 ++++--------- app/helpers/application_helper.rb | 6 +++--- config/environment.rb | 1 + 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 45105e5..ca79db1 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -66,9 +66,10 @@ class ApplicationController < ActionController::Base before_init_gettext :maybe_save_locale after_init_gettext :check_locale - if Noosfero.available_locales.size == 1 - GetText.locale = Noosfero.available_locales.first - end + #if Noosfero.available_locales.size == 1 + #GetText.locale = Noosfero.available_locales.first + #end + include GetText init_gettext 'noosfero' include NeedsProfile @@ -84,12 +85,6 @@ class ApplicationController < ActionController::Base verify :method => :post, :only => actions, :redirect_to => redirect end - # Fix some problems with Single Table Inheritance - require_dependency 'textile_article' - require_dependency 'tiny_mce_article' - require_dependency 'text_article' - require_dependency 'article' - protected # TODO: move this logic somewhere else (Domain class?) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 51d08c5..ea9a139 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -330,9 +330,9 @@ module ApplicationHelper end def theme_include(template) - file = ('../../public' + theme_path + '/' + template + '.rhtml') - if File.exists?(RAILS_ROOT + '/app/views/' + file) - render :file => file + file = (RAILS_ROOT + '/public' + theme_path + '/' + template + '.rhtml') + if File.exists?(file) + render :file => file, :use_full_path => false end end diff --git a/config/environment.rb b/config/environment.rb index 3e16d86..e1703d0 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -11,6 +11,7 @@ RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION require File.join(File.dirname(__FILE__), 'boot') # locally-developed modules +require 'locale' require 'gettext/rails' require 'acts_as_filesystem' require 'acts_as_having_settings' -- libgit2 0.21.2