Skip to content

Commit

Permalink
Merge pull request ruby-i18n#631 from movermeyer/movermeyer/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
radar authored Jul 10, 2022
2 parents 4c7343f + 8e4164a commit 829f95e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/i18n/backend/fallbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def exists?(locale, key, options = EMPTY_HASH)
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
Expand Down
4 changes: 2 additions & 2 deletions lib/i18n/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def default_locale=(locale)
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
Expand Down Expand Up @@ -106,7 +106,7 @@ def missing_interpolation_argument_handler
# 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"
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def initialize(method)
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
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/locale/tag/simple.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/i18n/tests/basics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ def teardown
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')
I18n.reload!
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
Expand Down
2 changes: 1 addition & 1 deletion test/backend/chain_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def setup
"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
Expand Down
4 changes: 2 additions & 2 deletions test/backend/fallbacks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def setup
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
Expand Down Expand Up @@ -192,7 +192,7 @@ def setup
end

# See Issue #590
class I18nBackendFallbacksSymbolReolveRestartsLookupAtOriginalLocale < I18n::TestCase
class I18nBackendFallbacksSymbolResolveRestartsLookupAtOriginalLocale < I18n::TestCase
class Backend < I18n::Backend::Simple
include I18n::Backend::Fallbacks
end
Expand Down
2 changes: 1 addition & 1 deletion test/i18n/middleware_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setup
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
Expand Down
4 changes: 2 additions & 2 deletions test/i18n_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ def call(exception, locale, key, options); key; end
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) {
I18n.transliterate("ąćó")
}
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) {
Expand Down

0 comments on commit 829f95e

Please sign in to comment.