Skip to content

Translate failing under Rails 2.3.8 #13

@dlineate

Description

@dlineate

When rails went from 2.3.5 => 2.3.8, activesupport's i18n library was bumped:
activesupport-2.3.5/lib/active_support/vendor/i18n-0.1.3
=>
activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7

This has revealed what I think is a bad typo in
engines/adva_cms/vendor/plugins/globalize2/lib/globalize/backend/static.rb:20
12:def translate(locale, key, options = {})
13: result, default, fallback = nil, options.delete(:default), nil
14: I18n.fallbacks[locale].each do |fallback|
15: begin
16: result = super(fallback, key, options) and break
17: rescue I18n::MissingTranslationData
18: end
19: end
20: result ||= default locale, default, options

The last line makes no sense to me. I think it isn't reached in 2.3.5 but is in 2.3.8

The exception is:
vendor/plugins/adva_cms/vendor/plugins/globalize2/lib/globalize/backend/static.rb:47:in []' vendor/plugins/adva_cms/vendor/plugins/globalize2/lib/globalize/backend/static.rb:47:intranslation'
vendor/plugins/adva_cms/vendor/plugins/globalize2/lib/globalize/backend/static.rb:23:in translate' /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/vendor/i18n-0.3.7/i18n.rb:237:int'

Without fully understanding everything, the problem goes away if I change line 20 above:
20: result ||= default # locale, default, options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions