brew vendor-gems: commit updates.
This commit is contained in:
parent
baa2626201
commit
c11b664e78
@ -24,7 +24,7 @@ kernel = (class << ::Kernel; self; end)
|
|||||||
end
|
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/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/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/tzinfo-2.0.6/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.8/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/zeitwerk-2.6.8/lib")
|
||||||
|
|||||||
@ -331,11 +331,12 @@ module I18n
|
|||||||
# keys are Symbols.
|
# keys are Symbols.
|
||||||
def normalize_keys(locale, key, scope, separator = nil)
|
def normalize_keys(locale, key, scope, separator = nil)
|
||||||
separator ||= I18n.default_separator
|
separator ||= I18n.default_separator
|
||||||
locale = locale.to_sym if locale
|
|
||||||
|
|
||||||
result = [locale]
|
[
|
||||||
result.concat(normalize_key(scope, separator)) if scope
|
*normalize_key(locale, separator),
|
||||||
result.concat(normalize_key(key, separator))
|
*normalize_key(scope, separator),
|
||||||
|
*normalize_key(key, separator)
|
||||||
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns true when the passed locale, which can be either a String or a
|
# Returns true when the passed locale, which can be either a String or a
|
||||||
@ -98,7 +98,7 @@ module I18n
|
|||||||
# Parse the load path and extract all locales.
|
# Parse the load path and extract all locales.
|
||||||
def available_locales
|
def available_locales
|
||||||
if lazy_load?
|
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
|
else
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
@ -47,7 +47,7 @@ module I18n
|
|||||||
|
|
||||||
class MissingTranslation < ArgumentError
|
class MissingTranslation < ArgumentError
|
||||||
module Base
|
module Base
|
||||||
PERMITTED_KEYS = [:scope].freeze
|
PERMITTED_KEYS = [:scope, :default].freeze
|
||||||
|
|
||||||
attr_reader :locale, :key, :options
|
attr_reader :locale, :key, :options
|
||||||
|
|
||||||
@ -63,8 +63,18 @@ module I18n
|
|||||||
end
|
end
|
||||||
|
|
||||||
def message
|
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
|
end
|
||||||
|
|
||||||
|
def normalized_option(key)
|
||||||
|
I18n.normalize_keys(locale, key, options[:scope]).join('.')
|
||||||
|
end
|
||||||
|
|
||||||
alias :to_s :message
|
alias :to_s :message
|
||||||
|
|
||||||
def to_exception
|
def to_exception
|
||||||
@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module I18n
|
module I18n
|
||||||
VERSION = "1.13.0"
|
VERSION = "1.14.0"
|
||||||
end
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user