Project

General

Profile

Rails 2.2 and I18n

Added by Jean-Philippe Lang almost 16 years ago

The work done last weeks in the rails-2.2 branch was merged into the trunk a few minutes ago (r2493).
So current trunk now requires Rails 2.2.2 to be installed. Installing the appropriate gem is pretty straightforward:

gem install rails -v=2.2.2

Here are some important notes for people who want to upgrade their trunk checkout:

  • If you had frozen Rails in your working copy, make sure to remove it before restarting the application (simply remove /vendor/rails). Otherwise the application will use this old frozen Rails version, and won't start.
  • As requested in #2628, Redmine now uses cookies to store session data by default. This prevents tons of files from being saved in /tmp/sessions and improves overall response time.
    To insure data integrity, the cookie store needs a secret to be generated before the first time you start the application. A rake task was added to make this step easier. You just need to run the following command from your Redmine directory:
    rake config/initializers/session_store.rb

Another big change was done on the internationalization support. Redmine now uses the new I18n module shipped with Rails 2.2, instead of the GLoc plugin. Translation files can be found under /config/locales. Contributors are now invited to submit their translation updates based on these files.

The 0.8-stable branch and the forthcoming 0.8.x releases will still use Rails 2.1.2.


Comments

Added by Eric Davis almost 16 years ago

Looks good, my crusiecontrol.rb server is reporting all passing tests after installing the gem. Thanks for your work on this.

Since GLoc was changed, what do you recommend plugin developers do to support both the 0.8.x and 0.9.x (trunk) branches? Should we start maintaining two versions of code until 0.9.x is released?

Eric

Added by Jean-Philippe Lang almost 16 years ago

Well, there's still some work before 0.9 can be released. But if some of your users run the trunk, you may want to make your plugins work with Rails 2.2. I think most of the code should run with Rails 2.2 without any change.

Concerning i18n, I tried to preserve the behaviour of the GLoc's l method which is heavily used in views. So if you keep your lang file in /lang and add the new locales in /config/locales, GLoc (0.8.x) and Rails I18n (0.9.x) should both should be supported. Some methods like lwr are no longer supported but can be added back if it's a real need.

I've only made some tests with the sample plugin. I'll do some more testing with the few plugins that sit in the Redmine repository. Let me know if there's anything that can be done to ease 0.8 and 0.9 support for plugins.

Added by Jean-Philippe Lang almost 16 years ago

For what it's worth, the embedded plugin works with latest trunk with no changes.

Added by Eric Davis over 15 years ago

Great, I just tested one of my plugins and it looks like all it needs is to have the language files moved. I was thinking I would have to wrap GLoc in my plugin's init and send the request to Rail's i18n.