Commit 86364a8cdee21583cb7472e237f6e352d5306ceb

Authored by Antonio Terceiro
Committed by Antonio Terceiro
1 parent 4e30313c

Trying to fix GetText issues

app/controllers/application.rb
... ... @@ -66,9 +66,10 @@ class ApplicationController < ActionController::Base
66 66  
67 67 before_init_gettext :maybe_save_locale
68 68 after_init_gettext :check_locale
69   - if Noosfero.available_locales.size == 1
70   - GetText.locale = Noosfero.available_locales.first
71   - end
  69 + #if Noosfero.available_locales.size == 1
  70 + #GetText.locale = Noosfero.available_locales.first
  71 + #end
  72 + include GetText
72 73 init_gettext 'noosfero'
73 74  
74 75 include NeedsProfile
... ... @@ -84,12 +85,6 @@ class ApplicationController < ActionController::Base
84 85 verify :method => :post, :only => actions, :redirect_to => redirect
85 86 end
86 87  
87   - # Fix some problems with Single Table Inheritance
88   - require_dependency 'textile_article'
89   - require_dependency 'tiny_mce_article'
90   - require_dependency 'text_article'
91   - require_dependency 'article'
92   -
93 88 protected
94 89  
95 90 # TODO: move this logic somewhere else (Domain class?)
... ...
app/helpers/application_helper.rb
... ... @@ -330,9 +330,9 @@ module ApplicationHelper
330 330 end
331 331  
332 332 def theme_include(template)
333   - file = ('../../public' + theme_path + '/' + template + '.rhtml')
334   - if File.exists?(RAILS_ROOT + '/app/views/' + file)
335   - render :file => file
  333 + file = (RAILS_ROOT + '/public' + theme_path + '/' + template + '.rhtml')
  334 + if File.exists?(file)
  335 + render :file => file, :use_full_path => false
336 336 end
337 337 end
338 338  
... ...
config/environment.rb
... ... @@ -11,6 +11,7 @@ RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
11 11 require File.join(File.dirname(__FILE__), 'boot')
12 12  
13 13 # locally-developed modules
  14 +require 'locale'
14 15 require 'gettext/rails'
15 16 require 'acts_as_filesystem'
16 17 require 'acts_as_having_settings'
... ...