module Nuggets::I18n
Constants
- DIACRITICS
Public Class Methods
args_for_map_diacritics()
click to toggle source
# File lib/nuggets/i18n.rb 97 def self.args_for_map_diacritics 98 @args_for_map_diacritics ||= begin 99 map = ::Hash.new { |h, k| h[k] = [] } 100 101 DIACRITICS.each { |a| a.each { |i| map[i].concat(a) } } 102 map.each { |k, v| v.uniq!; map[k] = "(#{::Regexp.union(*v).source})" } 103 104 [::Regexp.union(*map.keys.sort_by { |k| -k.length }), map.method(:[])] 105 end 106 end