Project

General

Profile

No i18n text displayed

Added by Carlos González-Abraham over 16 years ago

Hi,

I installed Redmine under Apache2 and mod_fcgid (ruby 1.8.6 on Linux Red Hat 3.4.6-9) a few days ago. I'm using a shared hosting account and because my hosting provider has installed rails 2.1.0 I decided to use the latest development version (I read that this version of Rails is not supported by the latest stable version). After the configuration process the application seemed to start ok, but I couldn't see any text on the pages.

After a few hours of reviewing the configuration and looking around the code, I notice that only the i18n strings weren't displayed. Initially I thought that this was probably related to some bug in the latest development version, so I tried to install a stable version:

First, I tried to install Redmine 0.7 using Rails 2.0.2 like a local gem (my hosting provider support this), but when a I tried to create the database I get the next error message:

$ rake db:migrate RAILS_ENV="production" 
...
Your config/boot.rb is outdated: Run "rake rails:update".

After this, I tried to install the same version (0.7) but freezing Rails at version 2.0.2. This time there was not problem creating the database, but again no i18n strings displayed.

At this point I remembered that I tested the 0.6 version a few months ago and everything worked ok, so my last desperate option was install this version, and guess what?, still no i18n text displayed.

Did you have a similar problem?, do you have some suggestions?

Thanks a lot.

- Carlos


Replies (10)

RE: No i18n text displayed - Added by Thomas Lecavelier over 16 years ago

Hi,

Never met that problem. Even I doubt it could mess the app, have you run the load_defaut_data rake task after migrating the schema?

RE: No i18n text displayed - Added by Carlos González-Abraham over 16 years ago

Yes, I ran the load_defaut_data rake task. Actually I replicate the production environment on my laptop (Apache2, mod_fcgid, Ruby 1.8.6, Rails 2.1.0 on Ubuntu 8.04) and after following the same installation and setup steps I followed in production server, everything works ok.

I'm newbie in RoR and Redmine world so I'm really lost about this situation. I think it's something related with Gloc but I'm not sure.

Is there a way to know what Gloc is doing?

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

Hi all,

I'm experiencing the same issue, any hints?

Thanks

RE: No i18n text displayed - Added by Thomas Lecavelier over 16 years ago

First, have a look to your log/production.log file. If there's something relevant in it, please paste it somewhere and link it here. Otherwise, try to force the verbose debug mode: in config/environnement.rb, uncomment the

config.log_level = :debug 

line, then restart your server: your log/production.log will be far more verbose, and gloc would be more verbose.

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

Thanks Thomas,

Actually, I'm on a remote server (Hostmonster), I uncommented:

config.log_level = :debug 

But I can't restart the server since I'm on a shared Apache.

There is one more issue, in fact, I'm using:

ENV['RAILS_ENV'] ||= 'production'

and the production section in database.yml, but when I run:

./script/about

I'm getting:

Environment               development

Thank you

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

PS: In the log, nothing is related to GLoc

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

Is there anyway to test the output of GLoc in a project's console (./script/console) ? that's to test the output and evaluate some keys.

Thanks.

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

Hi all,

Here a strange fact:

I launched the application's console than loaded GLoc:

./script/console
include GLoc
GLoc.set_config :default_language => :en
GLoc.clear_strings_except :en
GLoc.set_kcode
GLoc.load_localized_strings

And here a strange behavior !

>> GLoc.add_localized_strings(:en, :mm => "Mahmoud")
>> l(:mm)
GLoc reloading strings...
=> "Mahmoud"            # Correct behavior
>> l(:field_lastname)
=> ""                   # !! (it exists and checked in the language file)
>>  l_has_string?(:field_lastname)
=> true                 # !!!!

Any help would be appreciated, Thanks.

RE: No i18n text displayed - Added by Carlos González-Abraham over 16 years ago

After trying almost everything that crossed my mind to get Redmine worked, I realized that the GLoc's sentence i.iconv(value) always returned an empty string (just like Mahmoud said), so with a little hack I got Redmine works, I changed this:

(line 184 of ROOT_RAILS/vendor/plugins/gloc-1.1.0/lib/gloc.rb)

symbol_hash[key.to_sym] = i.iconv(value)

into this:

symbol_hash[key.to_sym] = value

It's important to kill the process dispatch.fcgi after do this change. I know this is no a real solution, but maybe give you an idea about the root of the problem (I think it's related with the version of iconv installed in Hostmonster).

PS: I tested this hack with english and spanish languages only.

RE: No i18n text displayed - Added by Mahmoud MHIRI over 16 years ago

Thank a lot Carlos, that's working amazingly!!

(Tested with English and French)

Thanks again!

    (1-10/10)