Commit 88727bf0 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Adds fallback to 'en' locale for untranslated strings (#5518).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4679 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent bebde159
I18n.default_locale = 'en'
# Adds fallback to default locale for untranslated strings
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
require 'redmine'
......@@ -109,4 +109,18 @@ class Redmine::I18nTest < ActiveSupport::TestCase
to_test.each {|lang, expected| assert_equal expected, find_language(lang)}
end
def test_fallback
::I18n.backend.store_translations(:en, {:untranslated => "Untranslated string"})
::I18n.locale = 'en'
assert_equal "Untranslated string", l(:untranslated)
::I18n.locale = 'fr'
assert_equal "Untranslated string", l(:untranslated)
::I18n.backend.store_translations(:fr, {:untranslated => "Pas de traduction"})
::I18n.locale = 'en'
assert_equal "Untranslated string", l(:untranslated)
::I18n.locale = 'fr'
assert_equal "Pas de traduction", l(:untranslated)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment