commit
829f95e1c3
|
@ -107,7 +107,7 @@ module I18n
|
|||
private
|
||||
|
||||
# Overwrite on_fallback to add specified logic when the fallback succeeds.
|
||||
def on_fallback(_original_locale, _fallback_locale, _key, _optoins)
|
||||
def on_fallback(_original_locale, _fallback_locale, _key, _options)
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -38,7 +38,7 @@ module I18n
|
|||
end
|
||||
|
||||
# Returns an array of locales for which translations are available.
|
||||
# Unless you explicitely set these through I18n.available_locales=
|
||||
# Unless you explicitly set these through I18n.available_locales=
|
||||
# the call will be delegated to the backend.
|
||||
def available_locales
|
||||
@@available_locales ||= nil
|
||||
|
@ -106,7 +106,7 @@ module I18n
|
|||
# if you don't care about arity.
|
||||
#
|
||||
# == Example:
|
||||
# You can supress raising an exception and return string instead:
|
||||
# You can suppress raising an exception and return string instead:
|
||||
#
|
||||
# I18n.config.missing_interpolation_argument_handler = Proc.new do |key|
|
||||
# "#{key} is missing"
|
||||
|
|
|
@ -24,7 +24,7 @@ module I18n
|
|||
been set is likely to display text from the wrong locale to some users.
|
||||
|
||||
If you have a legitimate reason to access i18n data outside of the user flow, you can do so by passing
|
||||
the desired locale explictly with the `locale` argument, e.g. `I18n.#{method}(..., locale: :en)`
|
||||
the desired locale explicitly with the `locale` argument, e.g. `I18n.#{method}(..., locale: :en)`
|
||||
MESSAGE
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Simple Locale tag implementation that computes subtags by simply splitting
|
||||
# the locale tag at '-' occurences.
|
||||
# the locale tag at '-' occurrences.
|
||||
module I18n
|
||||
module Locale
|
||||
module Tag
|
||||
|
|
|
@ -26,7 +26,7 @@ module I18n
|
|||
assert_equal I18n.available_locales, I18n.backend.available_locales
|
||||
end
|
||||
|
||||
test "available_locales memoizes when set explicitely" do
|
||||
test "available_locales memoizes when set explicitly" do
|
||||
I18n.backend.expects(:available_locales).never
|
||||
I18n.available_locales = [:foo]
|
||||
I18n.backend.store_translations('de', :bar => 'baz')
|
||||
|
@ -34,7 +34,7 @@ module I18n
|
|||
assert_equal [:foo], I18n.available_locales
|
||||
end
|
||||
|
||||
test "available_locales delegates to the backend when not set explicitely" do
|
||||
test "available_locales delegates to the backend when not set explicitly" do
|
||||
original_available_locales_value = I18n.backend.available_locales
|
||||
I18n.backend.expects(:available_locales).returns(original_available_locales_value).twice
|
||||
assert_equal I18n.backend.available_locales, I18n.available_locales
|
||||
|
|
|
@ -78,7 +78,7 @@ class I18nBackendChainTest < I18n::TestCase
|
|||
"Bah"], I18n.t([:formats, :plural_2, :bah], :default => 'Bah')
|
||||
end
|
||||
|
||||
test "store_translations options are not dropped while transfering to backend" do
|
||||
test "store_translations options are not dropped while transferring to backend" do
|
||||
@first.expects(:store_translations).with(:foo, {:bar => :baz}, {:option => 'persists'})
|
||||
I18n.backend.store_translations :foo, {:bar => :baz}, {:option => 'persists'}
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ class I18nBackendFallbacksTranslateTest < I18n::TestCase
|
|||
end
|
||||
|
||||
test "keeps the count option when defaulting to a different key" do
|
||||
assert_equal 'Interpolate 5 10', I18n.t(:non_existant, default: :interpolate_count, count: 10, value: 5)
|
||||
assert_equal 'Interpolate 5 10', I18n.t(:non_existent, default: :interpolate_count, count: 10, value: 5)
|
||||
end
|
||||
|
||||
test "returns the :de translation for a missing :'de-DE' when :default is a String" do
|
||||
|
@ -192,7 +192,7 @@ class I18nBackendFallbacksLocalizeTestWithMultipleThreads < I18n::TestCase
|
|||
end
|
||||
|
||||
# See Issue #590
|
||||
class I18nBackendFallbacksSymbolReolveRestartsLookupAtOriginalLocale < I18n::TestCase
|
||||
class I18nBackendFallbacksSymbolResolveRestartsLookupAtOriginalLocale < I18n::TestCase
|
||||
class Backend < I18n::Backend::Simple
|
||||
include I18n::Backend::Fallbacks
|
||||
end
|
||||
|
|
|
@ -16,7 +16,7 @@ class I18nMiddlewareTest < I18n::TestCase
|
|||
refute_equal updated_i18n_config_object_id, old_i18n_config_object_id
|
||||
end
|
||||
|
||||
test "succesfully resets i18n locale to default locale by defining new config" do
|
||||
test "successfully resets i18n locale to default locale by defining new config" do
|
||||
@middleware.call({})
|
||||
|
||||
assert_equal :fr, I18n.locale
|
||||
|
|
|
@ -386,7 +386,7 @@ class I18nTest < I18n::TestCase
|
|||
assert_equal I18n.default_locale, I18n.locale
|
||||
end
|
||||
|
||||
test "I18n.translitarate handles I18n::ArgumentError exception" do
|
||||
test "I18n.transliterate handles I18n::ArgumentError exception" do
|
||||
I18n::Backend::Transliterator.stubs(:get).raises(I18n::ArgumentError)
|
||||
I18n.exception_handler.expects(:call).raises(I18n::ArgumentError)
|
||||
assert_raises(I18n::ArgumentError) {
|
||||
|
@ -394,7 +394,7 @@ class I18nTest < I18n::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
test "I18n.translitarate raises I18n::ArgumentError exception" do
|
||||
test "I18n.transliterate raises I18n::ArgumentError exception" do
|
||||
I18n::Backend::Transliterator.stubs(:get).raises(I18n::ArgumentError)
|
||||
I18n.exception_handler.expects(:call).never
|
||||
assert_raises(I18n::ArgumentError) {
|
||||
|
|
Loading…
Reference in New Issue