module I18n
rubocop:disable Style/Documentation
Public Class Methods
clear_string_sorter()
click to toggle source
# File lib/kitchen/patches/i18n.rb, line 19 def self.clear_string_sorter @string_sorter = nil end
locale=(locale)
click to toggle source
# File lib/kitchen/patches/i18n.rb, line 27 def self.locale=(locale) # We wrap the setting of locale so that we can clear the string sorter (so that it # gets reset to the new locale the next time it is used) clear_string_sorter self.original_locale = locale end
Also aliased as: original_locale=
sort_strings(first, second)
click to toggle source
# File lib/kitchen/patches/i18n.rb, line 7 def self.sort_strings(first, second) string_sorter.compare(first, second) end
string_sorter()
click to toggle source
# File lib/kitchen/patches/i18n.rb, line 11 def self.string_sorter @string_sorter ||= begin # TwitterCldr does not know about our :test locale, so substitute the English one locale = I18n.locale == :test ? :en : I18n.locale TwitterCldr::Collation::Collator.new(locale) end end