Defect #7013

See {{count}} in page display rather than value with i18n 0.5.0

Added by James Byrne almost 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-12-01
Priority:HighDue date:
Assignee:-% Done:

0%

Category:I18n
Target version:1.0.5
Resolution:Fixed Affected version:

Description

At revision 4450.

After updating redmine from trunk and migrating the database I see this on the Roadmap:

{{count}} closed (100%) 0 open (0%)

and this on the (git) repository page:

b433c9c7     {{count}} months

Neither is a show stopper but they sure are irritating. Is there a way to fix this? Am I missing a gem dependency?


Related issues

Related to Redmine - Feature #8420: Consider removing #7013 workaround Closed 2011-05-21
Duplicated by Redmine - Defect #7063: r4471: template error? Closed 2010-12-07
Duplicated by Redmine - Defect #7112: Redmine doesn't work properly with some gems installed Closed 2010-12-15
Duplicated by Redmine - Defect #7125: Placeholders shown instead of numeric values. Closed 2010-12-17
Duplicated by Redmine - Defect #7534: upgrade from 0.8.7 to 1.1.0 - now lots of template variab... Closed 2011-02-03

Associated revisions

Revision 4516
Added by Jean-Philippe Lang almost 7 years ago

Manually require i18n 0.4.2 before Rails tries to load the most recent gem (#7013).

This workaround makes Redmine work even if i18n 0.5.0 gem is installed.

Revision 4532
Added by Jean-Philippe Lang almost 7 years ago

Merged r4516 from trunk (i18n 0.4.2 gem is now required: 'gem install -v=0.4.2 i18n', see #7013).

History

#1 Updated by Ethan Fremen almost 7 years ago

I see this issue as well - it affects other pages / macro components too. I think it has something to do with i18n...

#2 Updated by James Byrne almost 7 years ago

Funnily enough, if the count value is '1' then that shows. But no other number does.

#3 Updated by James Byrne almost 7 years ago

I wonder if the problem is in the pluralizer?

#4 Updated by Jean-Philippe Lang almost 7 years ago

I don't see this problem on trunk. Can you give a list of your installed gems please?

#5 Updated by Kennison Martin almost 7 years ago

I see this as well.

Added by {{author}} {{age}} ago. Updated {{value}} ago.

installed gems:

actionmailer (2.3.5)
actionpack (2.3.5)
activemodel (3.0.3)
activerecord (2.3.5)
activeresource (3.0.3, 2.3.5)
activesupport (3.0.3, 2.3.5)
builder (2.1.2)
eventmachine (0.12.10)
fastthread (1.0.7)
gearman-ruby (2.0.0)
gruff (0.3.6)
holidays (1.0.0)
i18n (0.5.0)
icalendar (1.1.5)
macaddr (1.0.0)
mysql (2.8.1)
passenger (2.2.10)
prawn (0.8.4)
prawn-core (0.8.4)
prawn-layout (0.8.4)
prawn-security (0.8.4)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rmagick (2.13.1)
uuid (2.2.0)

#6 Updated by Kennison Martin almost 7 years ago

also using the redmine_backlog plugin

#7 Updated by James Byrne almost 7 years ago

# gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

# gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.3, 2.3.8, 2.3.5)
actionpack (3.0.3, 2.3.8, 2.3.5)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.8, 2.3.5)
activeresource (3.0.3, 2.3.8, 2.3.5)
activesupport (3.0.3, 2.3.8, 2.3.5)
arel (2.0.5)
authlogic (2.1.6)
builder (2.1.2)
bundler (1.0.7)
daemon_controller (0.2.5)
erubis (2.6.6)
fastercsv (1.5.3)
fastthread (1.0.7)
file-tail (1.0.5)
i18n (0.5.0)
mail (2.2.11)
mime-types (1.16)
nokogiri (1.4.4)
passenger (3.0.0)
pg (0.9.0)
polyglot (0.3.1)
rack (1.2.1, 1.1.0, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3, 2.3.8, 2.3.5)
railties (3.0.3)
rake (0.8.7)
searchlogic (2.4.27)
spruz (0.2.2)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.23)

#8 Updated by Ivan Flores almost 7 years ago

Hi :

I have same problema en All page with total, the system information :

$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /home/sspp/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/

gem list
  • LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (3.0.3, 2.3.5)
edavis10-object_daddy (0.4.3)
i18n (0.5.0)
mail (2.2.11)
mime-types (1.16)
mocha (0.9.10)
polyglot (0.3.1)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
shoulda (2.11.3, 2.10.3)
treetop (1.4.9)

#9 Updated by Bruno Santos almost 7 years ago

I've just made a fresh install and everything was ok.
After I install backlog plugin its when the problems start.

#10 Updated by James Byrne almost 7 years ago

I have no additional plugins installed as far as I can recall. These are all that are present in the Redmin vendor/plugins directory"

# ll vendor/plugins
total 144
drwxr-xr-x 4 pas pas 4096 Feb 18  2009 acts_as_activity_provider
drwxr-xr-x 4 pas pas 4096 Feb 18  2009 acts_as_attachable
drwxr-xr-x 4 pas pas 4096 Feb 18  2009 acts_as_customizable
drwxr-xr-x 4 pas pas 4096 May  9  2008 acts_as_event
drwxr-xr-x 5 pas pas 4096 May  9  2008 acts_as_list
drwxr-xr-x 4 pas pas 4096 May  9  2008 acts_as_searchable
drwxr-xr-x 5 pas pas 4096 May  9  2008 acts_as_tree
drwxr-xr-x 5 pas pas 4096 May  9  2008 acts_as_versioned
drwxr-xr-x 4 pas pas 4096 May  9  2008 acts_as_watchable
drwxr-xr-x 6 pas pas 4096 Feb 18  2009 awesome_nested_set
drwxr-xr-x 5 pas pas 4096 May  9  2008 classic_pagination
drwxr-xr-x 4 pas pas 4096 May  5  2010 coderay-0.9.2
drwxr-xr-x 7 pas pas 4096 May  5  2010 engines
drwxr-xr-x 5 pas pas 4096 May  5  2010 gravatar
drwxr-xr-x 7 pas pas 4096 Feb 18  2009 open_id_authentication
drwxr-xr-x 3 pas pas 4096 May  5  2010 prepend_engine_views
drwxr-xr-x 5 pas pas 4096 May  9  2008 rfpdf
drwxr-xr-x 5 pas pas 4096 May  9  2008 ruby-net-ldap-0.0.4

#11 Updated by Bruno Santos almost 7 years ago

Downgraded i18n gem to 0.4.2 and it solved the problem

#12 Updated by Eric Baker almost 7 years ago

I downgraded i18n from 0.5.0 to 0.4.2, but the problem is still there.

#13 Updated by Eric Baker almost 7 years ago

UPDATE: Nevermind - I didn't actually downgrade the i18n gem... still at 0.5.0. My apologies.

#14 Updated by Kennison Martin almost 7 years ago

i18n downgrade to 0.4.2 worked for me as well.

#15 Updated by Teodor Engqvist almost 7 years ago

I got the problem when i updated my gems. When i downgrade i18n to 0.4.2 it did solve the problem.
Have you tried to uninstall i18n it will tell if there are more versions install.

#16 Updated by Teodor Engqvist almost 7 years ago

gem install i18n -v 0.4.2
check if you have another version install gem uninstall i18n

#17 Updated by Ivan Flores almost 7 years ago

The problem is fixed !!!, the solution is :

#gem install i18n -v=0.4.2
#gem uninstall i18n -v=0.5.0

Thank !!

#18 Updated by James Byrne almost 7 years ago

That will not work for me as I have another app on that server about to upgrade to Rails-3.0.0. And that requires I18n v 0.5.

If I unpack the i18n -v 0.4.2 gem into vendor in the Redmine project will that work?

#19 Updated by James Byrne almost 7 years ago

Neither unpacking the i18n v-0.4.2 gem into vendor/gems nor configuring the gem with :version => '0.4.2' had any effect. Redmine insists on using the higher numbered system i18n gem.

#20 Updated by Jean-Philippe Lang almost 7 years ago

James Byrne wrote:

Neither unpacking the i18n v-0.4.2 gem into vendor/gems nor configuring the gem with :version => '0.4.2' had any effect.
Redmine insists on using the higher numbered system i18n gem.

This is actually Rails that loads the gem and I didn't find a solution to change this behaviour.

#21 Updated by Jean-Philippe Lang almost 7 years ago

The solution would be to change the locales so that they use the new i18n interpolation syntax (#6495).

#22 Updated by Jean-Philippe Lang almost 7 years ago

  • Category set to I18n
  • Priority changed from Normal to High

#23 Updated by James Byrne almost 7 years ago

If the old version of i18n is vendored with rails-2.3.5 per #6495 then why is not Rails using it?

#24 Updated by Jean-Philippe Lang almost 7 years ago

In activesupport-2.3.5/lib/active_support/vendor.rb:

begin
  gem 'i18n', '>= 0.1.3'
rescue Gem::LoadError
  $:.unshift "#{File.dirname(__FILE__)}/vendor/i18n-0.1.3/lib" 
end

will pick any gem instead of the vendored lib.

#25 Updated by Thomas von Deyen almost 7 years ago

Easily fixed.

Just replace all {{foo}} strings in your config/locales/*.yml file of your currently used language and redmine is working with i18n 0.5.0 and above.

Maybe redmine should depend on i18n 0.5 and convert all translations.

#26 Updated by Thomas von Deyen almost 7 years ago

Thomas von Deyen wrote:

Easily fixed.

Just replace all {{foo}} strings in your config/locales/*.yml file of your currently used language and redmine is working with i18n 0.5.0 and above.

Maybe redmine should depend on i18n 0.5 and convert all translations.

Sorry :)

Just replace all {{foo}} strings with %{foo}

#27 Updated by Jean-Philippe Lang almost 7 years ago

Of course it can be easily fixed. But adding a dependency in Redmine (eg. config.gem 'i18', :version => '0.5.0') won't do anything because Rails 2.3.5 will have already loaded the vendored i18n 0.1.3 if no i18n gem is installed.

I think the cleanest solution is to upgrade to latest Rails 2.3.x that natively supports the new i18n interpolation format.

#28 Updated by Csaba Molnár almost 7 years ago

I also experience the problem in this Defect with 1.0.4. At first, I solved it by replacing all {{foo}} strings with %{foo} in my .yml file. I had i18n 0.5.0 installed. However, one problem still remained. In several places, dates were displayed in the format 2010.12.{{count}}.
Downgrading to i18n 0.4.2 helped to some extent. Dates are now displayed correctly on the Tasks tab and the detail view of Tasks. But the problem still occurs on the Activity tab.
I can provide a gem list, if needed.

#29 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.5

Fix committed in trunk in r4516. I18n 0.4.2 is now required and will be loaded before rails tries to load a more recent one. Fix will be backported to 1.0-stable.

#30 Updated by mathew murphy almost 7 years ago

Wouldn't it be better to fix the .yml files so that they work with current versions of i18n?

#31 Updated by James Byrne almost 7 years ago

Jean-Philippe Lang wrote:

Fix committed in trunk in r4516. I18n 0.4.2 is now required and will be loaded before rails tries to load a more recent one. Fix will be backported to 1.0-stable.

Update to r4529 works for me with Passenger 3.0.2 and resolves issue

#32 Updated by Jean-Philippe Lang almost 7 years ago

mathew murphy wrote:

Wouldn't it be better to fix the .yml files so that they work with current versions of i18n?

The locales are now using the new syntax (r4518). But Redmine 1.1 will use i18n 0.4.2 so that plugins don't have to migrate their locales now. I18n 0.5.0 is no longer compatible with the old syntax.

#33 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from Resolved to Closed
  • Resolution set to Fixed

r4516 merged into 1.0-stable in r4532. Locales will be left with the old syntax in 1.0-stable.

#34 Updated by Jean-Philippe Lang almost 7 years ago

  • Subject changed from v-1.0.4 trunk - see {{count}} in page display rather than value to See {{count}} in page display rather than value with i18n 0.5.0

#35 Updated by David Muir over 6 years ago

I had this happen when I upgraded to 1.1.3 (from 1.0.3). I only have i18n 0.4.2 and 0.4.1 installed. I've tried the various fixes suggested, but none of them have helped.

#36 Updated by Gabriela Mota over 6 years ago

David Muir wrote:

I had this happen when I upgraded to 1.1.3 (from 1.0.3). I only have i18n 0.4.2 and 0.4.1 installed. I've tried the various fixes suggested, but none of them have helped.

I got the same problem when migrating Redmine 1.1.3 from Webrick to Passenger + Apache2.
I have i18n version 0.4.2 installed, but still seeing tags like %{author} %{age} on my Issues pages.

My list of gems:

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
i18n (0.4.2)
rack (1.1.1, 1.0.1)
rails (2.3.11)
rake (0.9.0)

Regards.

Also available in: Atom PDF