It was a case of lazy initialization problem of I18n - actually not
lazy enough. Apparently the class was initialized before the
globalite initializer ( engine_config/initializers/globalite.rb ) had
a chance to run. That meant that the CE translations were never
picked up. Adding a call to I18n.reload! after the
I18n.default_locale = "en" in the same file did the trick.
Here is the stack trace and the I18n.load_path variable when
I18n::Backend::Simple::init_translations is first called
(rdb:1) where
--> #0 I18n::Backend::Simple.init_translations
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/
backend/simple.rb:84
#1 I18n::Backend::Simple.available_locales
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n/
backend/simple.rb:74
#2 I18n.available_locales
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
activesupport-2.3.2/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:
50
#3 ActionView::Template.valid_locale?(locale#String)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:215
#4 ActionView::Template.[](file#String)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:234
#5 ActionView::Template.initialize(template_path#String,
load_path#ActionView::Template:...,...)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:113
#6 ActionView::Template::EagerPath.new(file#String)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:87
#7 Array.directory?
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:82
#8 ActionView::Template::EagerPath.|
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:81
#9 ActionView::Template::EagerPath.load!
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:64
#10 Object.new_and_loaded(value#ActionView::Template:...)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:49
#11 ActionView::Template::Path.new(path#ActionView::Template:...)
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_view/template.rb:48
#12 join
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_controller/rescue.rb:42
#13 at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_controller/rescue.rb:17
#14 at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_controller/rescue.rb:1
#15 at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_controller/base.rb:1405
#16 at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
actionpack-2.3.2/lib/action_controller/base.rb:3
#17 Rails::Initializer.process
at line /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rails-2.3.2/
lib/initializer.rb:144
(rdb:1) p I18n.load_path
["/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/locale/en.yml", "/opt/ruby-enterprise/lib/ruby/gems/1.8/
gems/activerecord-2.3.2/lib/active_record/locale/en.yml", "/opt/ruby-
enterprise/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_view/
locale/en.yml"]
Maybe it's time to move to edge.
On Jun 6, 1:27 pm, moritz <[email protected]> wrote:
> I'm trying to get to the source of the problem, but I have some
> difficulty finding the relevant code section(s) to trace.
>
> The translations under RAILS_ROOT/lang/ui/en-US.yml or RAILS_ROOT/
> vendor/plugin/community_engine/lang/ui/en-US.yml are not picked up,
> only when I put them in config/locales/en-US.yml, they show up.
>
> It's a bit odd, as (almost) the same setup runs properly under Mongrel/
> REE. I'm using CE master and rails 2.3.2 on an Ubuntu system.
>
> The other notable differences between the Passenger and Mongrel setup
> is that I have to run the former using a prefix due to limited access
> to the system - I'm using ActionController::Base.relative_url_root to
> set it, and that I needed to add
>
> ENV['GEM_PATH'] = "<local-gemrepository>:#{ENV['GEM_PATH']}"
> Gem.clear_paths
>
> to pick up local gems as described in this
> posthttp://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ru....
>
> Thanks to anybody who can point me in the right direction.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---