Merge pull request #15509 from Homebrew/dependabot/bundler/Library/Homebrew/i18n-1.14.0

build(deps): bump i18n from 1.13.0 to 1.14.0 in /Library/Homebrew
This commit is contained in:
Markus Reiter 2023-06-03 03:19:18 +02:00 committed by GitHub
commit c34e833b0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 22 additions and 10 deletions

View File

@ -28,7 +28,7 @@ GEM
hana (1.3.7)
highline (2.0.3)
hpricot (0.8.6)
i18n (1.13.0)
i18n (1.14.0)
concurrent-ruby (~> 1.0)
json (2.6.3)
json_schemer (0.2.24)

View File

@ -629,6 +629,7 @@ module I18n::MissingTranslation::Base
def keys; end
def locale; end
def message; end
def normalized_option(key); end
def options; end
def to_exception; end
def to_s; end

View File

@ -24,7 +24,7 @@ kernel = (class << ::Kernel; self; end)
end
end
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/i18n-1.13.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/i18n-1.14.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/minitest-5.18.0/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/tzinfo-2.0.6/lib")
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.8/lib")

View File

@ -331,11 +331,12 @@ module I18n
# keys are Symbols.
def normalize_keys(locale, key, scope, separator = nil)
separator ||= I18n.default_separator
locale = locale.to_sym if locale
result = [locale]
result.concat(normalize_key(scope, separator)) if scope
result.concat(normalize_key(key, separator))
[
*normalize_key(locale, separator),
*normalize_key(scope, separator),
*normalize_key(key, separator)
]
end
# Returns true when the passed locale, which can be either a String or a

View File

@ -98,7 +98,7 @@ module I18n
# Parse the load path and extract all locales.
def available_locales
if lazy_load?
I18n.load_path.map { |path| LocaleExtractor.locale_from_path(path) }
I18n.load_path.map { |path| LocaleExtractor.locale_from_path(path) }.uniq
else
super
end

View File

@ -47,7 +47,7 @@ module I18n
class MissingTranslation < ArgumentError
module Base
PERMITTED_KEYS = [:scope].freeze
PERMITTED_KEYS = [:scope, :default].freeze
attr_reader :locale, :key, :options
@ -63,8 +63,18 @@ module I18n
end
def message
"translation missing: #{keys.join('.')}"
if options[:default].is_a?(Array)
other_options = ([key, *options[:default]]).map { |k| normalized_option(k).prepend('- ') }.join("\n")
"Translation missing. Options considered were:\n#{other_options}"
else
"Translation missing: #{keys.join('.')}"
end
end
def normalized_option(key)
I18n.normalize_keys(locale, key, options[:scope]).join('.')
end
alias :to_s :message
def to_exception

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module I18n
VERSION = "1.13.0"
VERSION = "1.14.0"
end