プロジェクト

全般

プロフィール

Vote #68719

完了

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

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
高め
担当者:
-
カテゴリ:
I18n_37
対象バージョン:
開始日:
2010/12/01
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
28
issue_org_id:
7013
author_id:
1026
assigned_to_id:
0
comments:
36
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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?


journals

I see this issue as well - it affects other pages / macro components too. I think it has something to do with i18n...
--------------------------------------------------------------------------------
Funnily enough, if the count value is '1' then that shows. But no other number does.
--------------------------------------------------------------------------------
I wonder if the problem is in the pluralizer?
--------------------------------------------------------------------------------
I don't see this problem on trunk. Can you give a list of your installed gems please?
--------------------------------------------------------------------------------
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)

--------------------------------------------------------------------------------
also using the redmine_backlog plugin
--------------------------------------------------------------------------------
<pre>
# 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)

</pre>
--------------------------------------------------------------------------------
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)

--------------------------------------------------------------------------------
I've just made a fresh install and everything was ok.
After I install backlog plugin its when the problems start.
--------------------------------------------------------------------------------
I have no additional plugins installed as far as I can recall. These are all that are present in the Redmin vendor/plugins directory"

<pre>
# 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
</pre>
--------------------------------------------------------------------------------
Downgraded i18n gem to 0.4.2 and it solved the problem
--------------------------------------------------------------------------------
I downgraded i18n from 0.5.0 to 0.4.2, but the problem is still there.
--------------------------------------------------------------------------------
UPDATE: Nevermind - I didn't actually downgrade the i18n gem... still at 0.5.0. My apologies.
--------------------------------------------------------------------------------
i18n downgrade to 0.4.2 worked for me as well.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
gem install i18n -v 0.4.2
check if you have another version install gem uninstall i18n
--------------------------------------------------------------------------------
The problem is fixed !!!, the solution is :

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

Thank !!

--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
The solution would be to change the locales so that they use the new i18n interpolation syntax (#6495).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
If the old version of i18n is vendored with rails-2.3.5 per #6495 then why is not Rails using it?
--------------------------------------------------------------------------------
In @activesupport-2.3.5/lib/active_support/vendor.rb@:

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

will pick any gem instead of the vendored lib.
--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------
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}

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Wouldn't it be better to fix the .yml files so that they work with current versions of i18n?
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
r4516 merged into 1.0-stable in r4532. Locales will be left with the old syntax in 1.0-stable.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------


related_issues

relates,Closed,8420,Consider removing #7013 workaround
duplicates,Closed,7063,r4471: template error?
duplicates,Closed,7112,Redmine doesn't work properly with some gems installed
duplicates,Closed,7125,Placeholders shown instead of numeric values.
duplicates,Closed,7534,upgrade from 0.8.7 to 1.1.0 - now lots of template variables aren't replaced

Admin Redmine さんが3年以上前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョン1.0.5_28 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0