i18n 0.4.0 → 1.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/MIT-LICENSE +0 -0
 - data/README.md +127 -0
 - data/lib/i18n/backend/base.rb +189 -111
 - data/lib/i18n/backend/cache.rb +58 -22
 - data/lib/i18n/backend/cache_file.rb +36 -0
 - data/lib/i18n/backend/cascade.rb +9 -10
 - data/lib/i18n/backend/chain.rb +95 -42
 - data/lib/i18n/backend/fallbacks.rb +68 -22
 - data/lib/i18n/backend/flatten.rb +13 -8
 - data/lib/i18n/backend/gettext.rb +33 -25
 - data/lib/i18n/backend/interpolation_compiler.rb +12 -14
 - data/lib/i18n/backend/key_value.rb +112 -10
 - data/lib/i18n/backend/lazy_loadable.rb +184 -0
 - data/lib/i18n/backend/memoize.rb +13 -7
 - data/lib/i18n/backend/metadata.rb +12 -6
 - data/lib/i18n/backend/pluralization.rb +64 -25
 - data/lib/i18n/backend/simple.rb +44 -18
 - data/lib/i18n/backend/transliterator.rb +43 -33
 - data/lib/i18n/backend.rb +5 -3
 - data/lib/i18n/config.rb +91 -10
 - data/lib/i18n/exceptions.rb +118 -22
 - data/lib/i18n/gettext/helpers.rb +14 -4
 - data/lib/i18n/gettext/po_parser.rb +7 -7
 - data/lib/i18n/gettext.rb +6 -5
 - data/lib/i18n/interpolate/ruby.rb +53 -0
 - data/lib/i18n/locale/fallbacks.rb +33 -26
 - data/lib/i18n/locale/tag/parents.rb +8 -8
 - data/lib/i18n/locale/tag/rfc4646.rb +0 -2
 - data/lib/i18n/locale/tag/simple.rb +2 -4
 - data/lib/i18n/locale.rb +2 -0
 - data/lib/i18n/middleware.rb +17 -0
 - data/lib/i18n/tests/basics.rb +58 -0
 - data/lib/i18n/tests/defaults.rb +52 -0
 - data/lib/i18n/tests/interpolation.rb +167 -0
 - data/lib/i18n/tests/link.rb +66 -0
 - data/lib/i18n/tests/localization/date.rb +122 -0
 - data/lib/i18n/tests/localization/date_time.rb +103 -0
 - data/lib/i18n/tests/localization/procs.rb +118 -0
 - data/lib/i18n/tests/localization/time.rb +103 -0
 - data/lib/i18n/tests/localization.rb +19 -0
 - data/lib/i18n/tests/lookup.rb +81 -0
 - data/lib/i18n/tests/pluralization.rb +35 -0
 - data/lib/i18n/tests/procs.rb +66 -0
 - data/lib/i18n/tests.rb +14 -0
 - data/lib/i18n/utils.rb +55 -0
 - data/lib/i18n/version.rb +3 -1
 - data/lib/i18n.rb +200 -87
 - metadata +64 -56
 - data/CHANGELOG.textile +0 -135
 - data/README.textile +0 -93
 - data/lib/i18n/backend/active_record/missing.rb +0 -65
 - data/lib/i18n/backend/active_record/store_procs.rb +0 -38
 - data/lib/i18n/backend/active_record/translation.rb +0 -93
 - data/lib/i18n/backend/active_record.rb +0 -61
 - data/lib/i18n/backend/cldr.rb +0 -100
 - data/lib/i18n/core_ext/hash.rb +0 -29
 - data/lib/i18n/core_ext/string/interpolate.rb +0 -98
 
    
        data/lib/i18n.rb
    CHANGED
    
    | 
         @@ -1,22 +1,57 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            #  
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            # Copyright:: Copyright (c) 2008 The Ruby i18n Team
         
     | 
| 
       9 
     | 
    
         
            -
            # License::   MIT
         
     | 
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'concurrent/map'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'concurrent/hash'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            require 'i18n/version'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'i18n/utils'
         
     | 
| 
       10 
8 
     | 
    
         
             
            require 'i18n/exceptions'
         
     | 
| 
       11 
     | 
    
         
            -
            require 'i18n/ 
     | 
| 
      
 9 
     | 
    
         
            +
            require 'i18n/interpolate/ruby'
         
     | 
| 
       12 
10 
     | 
    
         | 
| 
       13 
11 
     | 
    
         
             
            module I18n
         
     | 
| 
       14 
12 
     | 
    
         
             
              autoload :Backend, 'i18n/backend'
         
     | 
| 
       15 
13 
     | 
    
         
             
              autoload :Config,  'i18n/config'
         
     | 
| 
       16 
14 
     | 
    
         
             
              autoload :Gettext, 'i18n/gettext'
         
     | 
| 
       17 
15 
     | 
    
         
             
              autoload :Locale,  'i18n/locale'
         
     | 
| 
      
 16 
     | 
    
         
            +
              autoload :Tests,   'i18n/tests'
         
     | 
| 
      
 17 
     | 
    
         
            +
              autoload :Middleware,   'i18n/middleware'
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              RESERVED_KEYS = %i[
         
     | 
| 
      
 20 
     | 
    
         
            +
                cascade
         
     | 
| 
      
 21 
     | 
    
         
            +
                deep_interpolation
         
     | 
| 
      
 22 
     | 
    
         
            +
                default
         
     | 
| 
      
 23 
     | 
    
         
            +
                exception_handler
         
     | 
| 
      
 24 
     | 
    
         
            +
                fallback
         
     | 
| 
      
 25 
     | 
    
         
            +
                fallback_in_progress
         
     | 
| 
      
 26 
     | 
    
         
            +
                fallback_original_locale
         
     | 
| 
      
 27 
     | 
    
         
            +
                format
         
     | 
| 
      
 28 
     | 
    
         
            +
                object
         
     | 
| 
      
 29 
     | 
    
         
            +
                raise
         
     | 
| 
      
 30 
     | 
    
         
            +
                resolve
         
     | 
| 
      
 31 
     | 
    
         
            +
                scope
         
     | 
| 
      
 32 
     | 
    
         
            +
                separator
         
     | 
| 
      
 33 
     | 
    
         
            +
                throw
         
     | 
| 
      
 34 
     | 
    
         
            +
              ]
         
     | 
| 
      
 35 
     | 
    
         
            +
              EMPTY_HASH = {}.freeze
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
              def self.new_double_nested_cache # :nodoc:
         
     | 
| 
      
 38 
     | 
    
         
            +
                Concurrent::Map.new { |h, k| h[k] = Concurrent::Map.new }
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              # Marks a key as reserved. Reserved keys are used internally,
         
     | 
| 
      
 42 
     | 
    
         
            +
              # and can't also be used for interpolation. If you are using any
         
     | 
| 
      
 43 
     | 
    
         
            +
              # extra keys as I18n options, you should call I18n.reserve_key
         
     | 
| 
      
 44 
     | 
    
         
            +
              # before any I18n.translate (etc) calls are made.
         
     | 
| 
      
 45 
     | 
    
         
            +
              def self.reserve_key(key)
         
     | 
| 
      
 46 
     | 
    
         
            +
                RESERVED_KEYS << key.to_sym
         
     | 
| 
      
 47 
     | 
    
         
            +
                @reserved_keys_pattern = nil
         
     | 
| 
      
 48 
     | 
    
         
            +
              end
         
     | 
| 
       18 
49 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
               
     | 
| 
      
 50 
     | 
    
         
            +
              def self.reserved_keys_pattern # :nodoc:
         
     | 
| 
      
 51 
     | 
    
         
            +
                @reserved_keys_pattern ||= /%\{(#{RESERVED_KEYS.join("|")})\}/
         
     | 
| 
      
 52 
     | 
    
         
            +
              end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
              module Base
         
     | 
| 
       20 
55 
     | 
    
         
             
                # Gets I18n configuration object.
         
     | 
| 
       21 
56 
     | 
    
         
             
                def config
         
     | 
| 
       22 
57 
     | 
    
         
             
                  Thread.current[:i18n_config] ||= I18n::Config.new
         
     | 
| 
         @@ -29,7 +64,7 @@ module I18n 
     | 
|
| 
       29 
64 
     | 
    
         | 
| 
       30 
65 
     | 
    
         
             
                # Write methods which delegates to the configuration object
         
     | 
| 
       31 
66 
     | 
    
         
             
                %w(locale backend default_locale available_locales default_separator
         
     | 
| 
       32 
     | 
    
         
            -
                  exception_handler load_path).each do |method|
         
     | 
| 
      
 67 
     | 
    
         
            +
                  exception_handler load_path enforce_available_locales).each do |method|
         
     | 
| 
       33 
68 
     | 
    
         
             
                  module_eval <<-DELEGATORS, __FILE__, __LINE__ + 1
         
     | 
| 
       34 
69 
     | 
    
         
             
                    def #{method}
         
     | 
| 
       35 
70 
     | 
    
         
             
                      config.#{method}
         
     | 
| 
         @@ -45,9 +80,17 @@ module I18n 
     | 
|
| 
       45 
80 
     | 
    
         
             
                # Rails development environment. Backends can implement whatever strategy
         
     | 
| 
       46 
81 
     | 
    
         
             
                # is useful.
         
     | 
| 
       47 
82 
     | 
    
         
             
                def reload!
         
     | 
| 
      
 83 
     | 
    
         
            +
                  config.clear_available_locales_set
         
     | 
| 
       48 
84 
     | 
    
         
             
                  config.backend.reload!
         
     | 
| 
       49 
85 
     | 
    
         
             
                end
         
     | 
| 
       50 
86 
     | 
    
         | 
| 
      
 87 
     | 
    
         
            +
                # Tells the backend to load translations now. Used in situations like the
         
     | 
| 
      
 88 
     | 
    
         
            +
                # Rails production environment. Backends can implement whatever strategy
         
     | 
| 
      
 89 
     | 
    
         
            +
                # is useful.
         
     | 
| 
      
 90 
     | 
    
         
            +
                def eager_load!
         
     | 
| 
      
 91 
     | 
    
         
            +
                  config.backend.eager_load!
         
     | 
| 
      
 92 
     | 
    
         
            +
                end
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
       51 
94 
     | 
    
         
             
                # Translates, pluralizes and interpolates a given key using a given locale,
         
     | 
| 
       52 
95 
     | 
    
         
             
                # scope, and default, as well as interpolation values.
         
     | 
| 
       53 
96 
     | 
    
         
             
                #
         
     | 
| 
         @@ -87,7 +130,7 @@ module I18n 
     | 
|
| 
       87 
130 
     | 
    
         
             
                # *PLURALIZATION*
         
     | 
| 
       88 
131 
     | 
    
         
             
                #
         
     | 
| 
       89 
132 
     | 
    
         
             
                # Translation data can contain pluralized translations. Pluralized translations
         
     | 
| 
       90 
     | 
    
         
            -
                # are arrays of  
     | 
| 
      
 133 
     | 
    
         
            +
                # are arrays of singular/plural versions of translations like <tt>['Foo', 'Foos']</tt>.
         
     | 
| 
       91 
134 
     | 
    
         
             
                #
         
     | 
| 
       92 
135 
     | 
    
         
             
                # Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English
         
     | 
| 
       93 
136 
     | 
    
         
             
                # pluralization rules. Other algorithms can be supported by custom backends.
         
     | 
| 
         @@ -135,32 +178,67 @@ module I18n 
     | 
|
| 
       135 
178 
     | 
    
         
             
                # called and passed the key and options.
         
     | 
| 
       136 
179 
     | 
    
         
             
                #
         
     | 
| 
       137 
180 
     | 
    
         
             
                # E.g. assuming the key <tt>:salutation</tt> resolves to:
         
     | 
| 
       138 
     | 
    
         
            -
                #   lambda { |key, options| options[:gender] == 'm' ? "Mr.  
     | 
| 
      
 181 
     | 
    
         
            +
                #   lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
         
     | 
| 
       139 
182 
     | 
    
         
             
                #
         
     | 
| 
       140 
183 
     | 
    
         
             
                # Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith".
         
     | 
| 
       141 
184 
     | 
    
         
             
                #
         
     | 
| 
      
 185 
     | 
    
         
            +
                # Note that the string returned by lambda will go through string interpolation too,
         
     | 
| 
      
 186 
     | 
    
         
            +
                # so the following lambda would give the same result:
         
     | 
| 
      
 187 
     | 
    
         
            +
                #   lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
         
     | 
| 
      
 188 
     | 
    
         
            +
                #
         
     | 
| 
       142 
189 
     | 
    
         
             
                # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
         
     | 
| 
       143 
190 
     | 
    
         
             
                # a cache layer is put in front of I18n.translate it will generate a cache key
         
     | 
| 
       144 
     | 
    
         
            -
                # from the argument values passed to #translate.  
     | 
| 
      
 191 
     | 
    
         
            +
                # from the argument values passed to #translate. Therefore your lambdas should
         
     | 
| 
       145 
192 
     | 
    
         
             
                # always return the same translations/values per unique combination of argument
         
     | 
| 
       146 
193 
     | 
    
         
             
                # values.
         
     | 
| 
       147 
     | 
    
         
            -
                 
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
     | 
    
         
            -
             
     | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
     | 
    
         
            -
                 
     | 
| 
       154 
     | 
    
         
            -
             
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
      
 194 
     | 
    
         
            +
                #
         
     | 
| 
      
 195 
     | 
    
         
            +
                # *Ruby 2.7+ keyword arguments warning*
         
     | 
| 
      
 196 
     | 
    
         
            +
                #
         
     | 
| 
      
 197 
     | 
    
         
            +
                # This method uses keyword arguments.
         
     | 
| 
      
 198 
     | 
    
         
            +
                # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
         
     | 
| 
      
 199 
     | 
    
         
            +
                # The "hash" parameter must be passed as keyword argument.
         
     | 
| 
      
 200 
     | 
    
         
            +
                #
         
     | 
| 
      
 201 
     | 
    
         
            +
                # Good:
         
     | 
| 
      
 202 
     | 
    
         
            +
                #  I18n.t(:salutation, :gender => 'w', :name => 'Smith')
         
     | 
| 
      
 203 
     | 
    
         
            +
                #  I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
         
     | 
| 
      
 204 
     | 
    
         
            +
                #  I18n.t(:salutation, **any_hash)
         
     | 
| 
      
 205 
     | 
    
         
            +
                #
         
     | 
| 
      
 206 
     | 
    
         
            +
                # Bad:
         
     | 
| 
      
 207 
     | 
    
         
            +
                #  I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
         
     | 
| 
      
 208 
     | 
    
         
            +
                #  I18n.t(:salutation, any_hash)
         
     | 
| 
      
 209 
     | 
    
         
            +
                #
         
     | 
| 
      
 210 
     | 
    
         
            +
                def translate(key = nil, throw: false, raise: false, locale: nil, **options) # TODO deprecate :raise
         
     | 
| 
      
 211 
     | 
    
         
            +
                  locale ||= config.locale
         
     | 
| 
      
 212 
     | 
    
         
            +
                  raise Disabled.new('t') if locale == false
         
     | 
| 
      
 213 
     | 
    
         
            +
                  enforce_available_locales!(locale)
         
     | 
| 
      
 214 
     | 
    
         
            +
             
     | 
| 
      
 215 
     | 
    
         
            +
                  backend = config.backend
         
     | 
| 
      
 216 
     | 
    
         
            +
             
     | 
| 
      
 217 
     | 
    
         
            +
                  if key.is_a?(Array)
         
     | 
| 
      
 218 
     | 
    
         
            +
                    key.map do |k|
         
     | 
| 
      
 219 
     | 
    
         
            +
                      translate_key(k, throw, raise, locale, backend, options)
         
     | 
| 
      
 220 
     | 
    
         
            +
                    end
         
     | 
| 
      
 221 
     | 
    
         
            +
                  else
         
     | 
| 
      
 222 
     | 
    
         
            +
                    translate_key(key, throw, raise, locale, backend, options)
         
     | 
| 
      
 223 
     | 
    
         
            +
                  end
         
     | 
| 
       156 
224 
     | 
    
         
             
                end
         
     | 
| 
       157 
225 
     | 
    
         
             
                alias :t :translate
         
     | 
| 
       158 
226 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
                 
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
      
 227 
     | 
    
         
            +
                # Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
         
     | 
| 
      
 228 
     | 
    
         
            +
                # this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
         
     | 
| 
      
 229 
     | 
    
         
            +
                def translate!(key, **options)
         
     | 
| 
      
 230 
     | 
    
         
            +
                  translate(key, **options, raise: true)
         
     | 
| 
       161 
231 
     | 
    
         
             
                end
         
     | 
| 
       162 
232 
     | 
    
         
             
                alias :t! :translate!
         
     | 
| 
       163 
233 
     | 
    
         | 
| 
      
 234 
     | 
    
         
            +
                # Returns true if a translation exists for a given key, otherwise returns false.
         
     | 
| 
      
 235 
     | 
    
         
            +
                def exists?(key, _locale = nil, locale: _locale, **options)
         
     | 
| 
      
 236 
     | 
    
         
            +
                  locale ||= config.locale
         
     | 
| 
      
 237 
     | 
    
         
            +
                  raise Disabled.new('exists?') if locale == false
         
     | 
| 
      
 238 
     | 
    
         
            +
                  raise I18n::ArgumentError if key.is_a?(String) && key.empty?
         
     | 
| 
      
 239 
     | 
    
         
            +
                  config.backend.exists?(locale, key, options)
         
     | 
| 
      
 240 
     | 
    
         
            +
                end
         
     | 
| 
      
 241 
     | 
    
         
            +
             
     | 
| 
       164 
242 
     | 
    
         
             
                # Transliterates UTF-8 characters to ASCII. By default this method will
         
     | 
| 
       165 
243 
     | 
    
         
             
                # transliterate only Latin strings to an ASCII approximation:
         
     | 
| 
       166 
244 
     | 
    
         
             
                #
         
     | 
| 
         @@ -190,14 +268,14 @@ module I18n 
     | 
|
| 
       190 
268 
     | 
    
         
             
                #
         
     | 
| 
       191 
269 
     | 
    
         
             
                # Setting a Hash using Ruby:
         
     | 
| 
       192 
270 
     | 
    
         
             
                #
         
     | 
| 
       193 
     | 
    
         
            -
                #     store_translations(:de, : 
     | 
| 
       194 
     | 
    
         
            -
                # 
     | 
| 
       195 
     | 
    
         
            -
                # 
     | 
| 
       196 
     | 
    
         
            -
                # 
     | 
| 
       197 
     | 
    
         
            -
                # 
     | 
| 
       198 
     | 
    
         
            -
                # 
     | 
| 
       199 
     | 
    
         
            -
                # 
     | 
| 
       200 
     | 
    
         
            -
                # 
     | 
| 
      
 271 
     | 
    
         
            +
                #     store_translations(:de, i18n: {
         
     | 
| 
      
 272 
     | 
    
         
            +
                #                          transliterate: {
         
     | 
| 
      
 273 
     | 
    
         
            +
                #                            rule: {
         
     | 
| 
      
 274 
     | 
    
         
            +
                #                              'ü' => 'ue',
         
     | 
| 
      
 275 
     | 
    
         
            +
                #                              'ö' => 'oe'
         
     | 
| 
      
 276 
     | 
    
         
            +
                #                            }
         
     | 
| 
      
 277 
     | 
    
         
            +
                #                          }
         
     | 
| 
      
 278 
     | 
    
         
            +
                #                        })
         
     | 
| 
       201 
279 
     | 
    
         
             
                #
         
     | 
| 
       202 
280 
     | 
    
         
             
                # Setting a Proc:
         
     | 
| 
       203 
281 
     | 
    
         
             
                #
         
     | 
| 
         @@ -212,66 +290,89 @@ module I18n 
     | 
|
| 
       212 
290 
     | 
    
         
             
                #     I18n.transliterate("Jürgen") # => "Juergen"
         
     | 
| 
       213 
291 
     | 
    
         
             
                #     I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen"
         
     | 
| 
       214 
292 
     | 
    
         
             
                #     I18n.transliterate("Jürgen", :locale => :de) # => "Juergen"
         
     | 
| 
       215 
     | 
    
         
            -
                def transliterate( 
     | 
| 
       216 
     | 
    
         
            -
                   
     | 
| 
       217 
     | 
    
         
            -
                   
     | 
| 
       218 
     | 
    
         
            -
                   
     | 
| 
       219 
     | 
    
         
            -
             
     | 
| 
       220 
     | 
    
         
            -
                  replacement  = options && options.delete(:replacement)
         
     | 
| 
      
 293 
     | 
    
         
            +
                def transliterate(key, throw: false, raise: false, locale: nil, replacement: nil, **options)
         
     | 
| 
      
 294 
     | 
    
         
            +
                  locale ||= config.locale
         
     | 
| 
      
 295 
     | 
    
         
            +
                  raise Disabled.new('transliterate') if locale == false
         
     | 
| 
      
 296 
     | 
    
         
            +
                  enforce_available_locales!(locale)
         
     | 
| 
      
 297 
     | 
    
         
            +
             
     | 
| 
       221 
298 
     | 
    
         
             
                  config.backend.transliterate(locale, key, replacement)
         
     | 
| 
       222 
299 
     | 
    
         
             
                rescue I18n::ArgumentError => exception
         
     | 
| 
       223 
     | 
    
         
            -
                  raise exception  
     | 
| 
       224 
     | 
    
         
            -
                  handle_exception(exception, locale, key, options)
         
     | 
| 
      
 300 
     | 
    
         
            +
                  handle_exception((throw && :throw || raise && :raise), exception, locale, key, options)
         
     | 
| 
       225 
301 
     | 
    
         
             
                end
         
     | 
| 
       226 
302 
     | 
    
         | 
| 
       227 
303 
     | 
    
         
             
                # Localizes certain objects, such as dates and numbers to local formatting.
         
     | 
| 
       228 
     | 
    
         
            -
                def localize(object,  
     | 
| 
       229 
     | 
    
         
            -
                  locale  
     | 
| 
       230 
     | 
    
         
            -
                   
     | 
| 
      
 304 
     | 
    
         
            +
                def localize(object, locale: nil, format: nil, **options)
         
     | 
| 
      
 305 
     | 
    
         
            +
                  locale ||= config.locale
         
     | 
| 
      
 306 
     | 
    
         
            +
                  raise Disabled.new('l') if locale == false
         
     | 
| 
      
 307 
     | 
    
         
            +
                  enforce_available_locales!(locale)
         
     | 
| 
      
 308 
     | 
    
         
            +
             
     | 
| 
      
 309 
     | 
    
         
            +
                  format ||= :default
         
     | 
| 
       231 
310 
     | 
    
         
             
                  config.backend.localize(locale, object, format, options)
         
     | 
| 
       232 
311 
     | 
    
         
             
                end
         
     | 
| 
       233 
312 
     | 
    
         
             
                alias :l :localize
         
     | 
| 
       234 
313 
     | 
    
         | 
| 
       235 
314 
     | 
    
         
             
                # Executes block with given I18n.locale set.
         
     | 
| 
       236 
315 
     | 
    
         
             
                def with_locale(tmp_locale = nil)
         
     | 
| 
       237 
     | 
    
         
            -
                  if tmp_locale
         
     | 
| 
      
 316 
     | 
    
         
            +
                  if tmp_locale == nil
         
     | 
| 
      
 317 
     | 
    
         
            +
                    yield
         
     | 
| 
      
 318 
     | 
    
         
            +
                  else
         
     | 
| 
       238 
319 
     | 
    
         
             
                    current_locale = self.locale
         
     | 
| 
       239 
     | 
    
         
            -
                    self.locale 
     | 
| 
      
 320 
     | 
    
         
            +
                    self.locale = tmp_locale
         
     | 
| 
      
 321 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 322 
     | 
    
         
            +
                      yield
         
     | 
| 
      
 323 
     | 
    
         
            +
                    ensure
         
     | 
| 
      
 324 
     | 
    
         
            +
                      self.locale = current_locale
         
     | 
| 
      
 325 
     | 
    
         
            +
                    end
         
     | 
| 
       240 
326 
     | 
    
         
             
                  end
         
     | 
| 
       241 
     | 
    
         
            -
                  yield
         
     | 
| 
       242 
     | 
    
         
            -
                ensure
         
     | 
| 
       243 
     | 
    
         
            -
                  self.locale = current_locale if tmp_locale
         
     | 
| 
       244 
327 
     | 
    
         
             
                end
         
     | 
| 
       245 
328 
     | 
    
         | 
| 
       246 
     | 
    
         
            -
             
     | 
| 
       247 
329 
     | 
    
         
             
                # Merges the given locale, key and scope into a single array of keys.
         
     | 
| 
       248 
330 
     | 
    
         
             
                # Splits keys that contain dots into multiple keys. Makes sure all
         
     | 
| 
       249 
331 
     | 
    
         
             
                # keys are Symbols.
         
     | 
| 
       250 
332 
     | 
    
         
             
                def normalize_keys(locale, key, scope, separator = nil)
         
     | 
| 
       251 
333 
     | 
    
         
             
                  separator ||= I18n.default_separator
         
     | 
| 
       252 
334 
     | 
    
         | 
| 
       253 
     | 
    
         
            -
                   
     | 
| 
       254 
     | 
    
         
            -
             
     | 
| 
       255 
     | 
    
         
            -
             
     | 
| 
       256 
     | 
    
         
            -
             
     | 
| 
       257 
     | 
    
         
            -
                   
     | 
| 
      
 335 
     | 
    
         
            +
                  [
         
     | 
| 
      
 336 
     | 
    
         
            +
                    *normalize_key(locale, separator),
         
     | 
| 
      
 337 
     | 
    
         
            +
                    *normalize_key(scope, separator),
         
     | 
| 
      
 338 
     | 
    
         
            +
                    *normalize_key(key, separator)
         
     | 
| 
      
 339 
     | 
    
         
            +
                  ]
         
     | 
| 
      
 340 
     | 
    
         
            +
                end
         
     | 
| 
      
 341 
     | 
    
         
            +
             
     | 
| 
      
 342 
     | 
    
         
            +
                # Returns true when the passed locale, which can be either a String or a
         
     | 
| 
      
 343 
     | 
    
         
            +
                # Symbol, is in the list of available locales. Returns false otherwise.
         
     | 
| 
      
 344 
     | 
    
         
            +
                def locale_available?(locale)
         
     | 
| 
      
 345 
     | 
    
         
            +
                  I18n.config.available_locales_set.include?(locale)
         
     | 
| 
      
 346 
     | 
    
         
            +
                end
         
     | 
| 
      
 347 
     | 
    
         
            +
             
     | 
| 
      
 348 
     | 
    
         
            +
                # Raises an InvalidLocale exception when the passed locale is not available.
         
     | 
| 
      
 349 
     | 
    
         
            +
                def enforce_available_locales!(locale)
         
     | 
| 
      
 350 
     | 
    
         
            +
                  if locale != false && config.enforce_available_locales
         
     | 
| 
      
 351 
     | 
    
         
            +
                    raise I18n::InvalidLocale.new(locale) if !locale_available?(locale)
         
     | 
| 
      
 352 
     | 
    
         
            +
                  end
         
     | 
| 
      
 353 
     | 
    
         
            +
                end
         
     | 
| 
      
 354 
     | 
    
         
            +
             
     | 
| 
      
 355 
     | 
    
         
            +
                def available_locales_initialized?
         
     | 
| 
      
 356 
     | 
    
         
            +
                  config.available_locales_initialized?
         
     | 
| 
       258 
357 
     | 
    
         
             
                end
         
     | 
| 
       259 
358 
     | 
    
         | 
| 
       260 
     | 
    
         
            -
              # making these private until Ruby 1.9.2 can send to protected methods again
         
     | 
| 
       261 
     | 
    
         
            -
              # see http://redmine.ruby-lang.org/repositories/revision/ruby-19?rev=24280
         
     | 
| 
       262 
359 
     | 
    
         
             
              private
         
     | 
| 
       263 
360 
     | 
    
         | 
| 
       264 
     | 
    
         
            -
                 
     | 
| 
       265 
     | 
    
         
            -
             
     | 
| 
       266 
     | 
    
         
            -
             
     | 
| 
       267 
     | 
    
         
            -
             
     | 
| 
       268 
     | 
    
         
            -
             
     | 
| 
       269 
     | 
    
         
            -
                   
     | 
| 
       270 
     | 
    
         
            -
             
     | 
| 
      
 361 
     | 
    
         
            +
                def translate_key(key, throw, raise, locale, backend, options)
         
     | 
| 
      
 362 
     | 
    
         
            +
                  result = catch(:exception) do
         
     | 
| 
      
 363 
     | 
    
         
            +
                    backend.translate(locale, key, options)
         
     | 
| 
      
 364 
     | 
    
         
            +
                  end
         
     | 
| 
      
 365 
     | 
    
         
            +
             
     | 
| 
      
 366 
     | 
    
         
            +
                  if result.is_a?(MissingTranslation)
         
     | 
| 
      
 367 
     | 
    
         
            +
                    handle_exception((throw && :throw || raise && :raise), result, locale, key, options)
         
     | 
| 
      
 368 
     | 
    
         
            +
                  else
         
     | 
| 
      
 369 
     | 
    
         
            +
                    result
         
     | 
| 
      
 370 
     | 
    
         
            +
                  end
         
     | 
| 
       271 
371 
     | 
    
         
             
                end
         
     | 
| 
       272 
372 
     | 
    
         | 
| 
       273 
373 
     | 
    
         
             
                # Any exceptions thrown in translate will be sent to the @@exception_handler
         
     | 
| 
       274 
     | 
    
         
            -
                # which can be a Symbol, a Proc or any other Object 
     | 
| 
      
 374 
     | 
    
         
            +
                # which can be a Symbol, a Proc or any other Object unless they're forced to
         
     | 
| 
      
 375 
     | 
    
         
            +
                # be raised or thrown (MissingTranslation).
         
     | 
| 
       275 
376 
     | 
    
         
             
                #
         
     | 
| 
       276 
377 
     | 
    
         
             
                # If exception_handler is a Symbol then it will simply be sent to I18n as
         
     | 
| 
       277 
378 
     | 
    
         
             
                # a method call. A Proc will simply be called. In any other case the
         
     | 
| 
         @@ -279,44 +380,56 @@ module I18n 
     | 
|
| 
       279 
380 
     | 
    
         
             
                #
         
     | 
| 
       280 
381 
     | 
    
         
             
                # Examples:
         
     | 
| 
       281 
382 
     | 
    
         
             
                #
         
     | 
| 
       282 
     | 
    
         
            -
                #   I18n.exception_handler = : 
     | 
| 
       283 
     | 
    
         
            -
                #   I18n. 
     | 
| 
      
 383 
     | 
    
         
            +
                #   I18n.exception_handler = :custom_exception_handler              # this is the default
         
     | 
| 
      
 384 
     | 
    
         
            +
                #   I18n.custom_exception_handler(exception, locale, key, options)  # will be called like this
         
     | 
| 
       284 
385 
     | 
    
         
             
                #
         
     | 
| 
       285 
386 
     | 
    
         
             
                #   I18n.exception_handler = lambda { |*args| ... }                 # a lambda
         
     | 
| 
       286 
387 
     | 
    
         
             
                #   I18n.exception_handler.call(exception, locale, key, options)    # will be called like this
         
     | 
| 
       287 
388 
     | 
    
         
             
                #
         
     | 
| 
       288 
     | 
    
         
            -
                # 
     | 
| 
       289 
     | 
    
         
            -
                # 
     | 
| 
       290 
     | 
    
         
            -
                def handle_exception(exception, locale, key, options)
         
     | 
| 
       291 
     | 
    
         
            -
                  case  
     | 
| 
       292 
     | 
    
         
            -
                  when  
     | 
| 
       293 
     | 
    
         
            -
                     
     | 
| 
      
 389 
     | 
    
         
            +
                #   I18n.exception_handler = I18nExceptionHandler.new               # an object
         
     | 
| 
      
 390 
     | 
    
         
            +
                #   I18n.exception_handler.call(exception, locale, key, options)    # will be called like this
         
     | 
| 
      
 391 
     | 
    
         
            +
                def handle_exception(handling, exception, locale, key, options)
         
     | 
| 
      
 392 
     | 
    
         
            +
                  case handling
         
     | 
| 
      
 393 
     | 
    
         
            +
                  when :raise
         
     | 
| 
      
 394 
     | 
    
         
            +
                    raise exception.respond_to?(:to_exception) ? exception.to_exception : exception
         
     | 
| 
      
 395 
     | 
    
         
            +
                  when :throw
         
     | 
| 
      
 396 
     | 
    
         
            +
                    throw :exception, exception
         
     | 
| 
       294 
397 
     | 
    
         
             
                  else
         
     | 
| 
       295 
     | 
    
         
            -
                     
     | 
| 
      
 398 
     | 
    
         
            +
                    case handler = options[:exception_handler] || config.exception_handler
         
     | 
| 
      
 399 
     | 
    
         
            +
                    when Symbol
         
     | 
| 
      
 400 
     | 
    
         
            +
                      send(handler, exception, locale, key, options)
         
     | 
| 
      
 401 
     | 
    
         
            +
                    else
         
     | 
| 
      
 402 
     | 
    
         
            +
                      handler.call(exception, locale, key, options)
         
     | 
| 
      
 403 
     | 
    
         
            +
                    end
         
     | 
| 
       296 
404 
     | 
    
         
             
                  end
         
     | 
| 
       297 
405 
     | 
    
         
             
                end
         
     | 
| 
       298 
406 
     | 
    
         | 
| 
       299 
     | 
    
         
            -
                 
     | 
| 
       300 
     | 
    
         
            -
                # removed. Use I18n.normalize_keys instead.
         
     | 
| 
       301 
     | 
    
         
            -
                def normalize_translation_keys(locale, key, scope, separator = nil)
         
     | 
| 
       302 
     | 
    
         
            -
                  normalize_keys(locale, key, scope, separator)
         
     | 
| 
       303 
     | 
    
         
            -
                end
         
     | 
| 
      
 407 
     | 
    
         
            +
                @@normalized_key_cache = I18n.new_double_nested_cache
         
     | 
| 
       304 
408 
     | 
    
         | 
| 
       305 
409 
     | 
    
         
             
                def normalize_key(key, separator)
         
     | 
| 
       306 
     | 
    
         
            -
                  normalized_key_cache[separator][key] ||=
         
     | 
| 
      
 410 
     | 
    
         
            +
                  @@normalized_key_cache[separator][key] ||=
         
     | 
| 
       307 
411 
     | 
    
         
             
                    case key
         
     | 
| 
       308 
412 
     | 
    
         
             
                    when Array
         
     | 
| 
       309 
     | 
    
         
            -
                      key. 
     | 
| 
      
 413 
     | 
    
         
            +
                      key.flat_map { |k| normalize_key(k, separator) }
         
     | 
| 
       310 
414 
     | 
    
         
             
                    else
         
     | 
| 
       311 
415 
     | 
    
         
             
                      keys = key.to_s.split(separator)
         
     | 
| 
       312 
416 
     | 
    
         
             
                      keys.delete('')
         
     | 
| 
       313 
     | 
    
         
            -
                      keys.map! 
     | 
| 
      
 417 
     | 
    
         
            +
                      keys.map! do |k|
         
     | 
| 
      
 418 
     | 
    
         
            +
                        case k
         
     | 
| 
      
 419 
     | 
    
         
            +
                        when /\A[-+]?([1-9]\d*|0)\z/ # integer
         
     | 
| 
      
 420 
     | 
    
         
            +
                          k.to_i
         
     | 
| 
      
 421 
     | 
    
         
            +
                        when 'true'
         
     | 
| 
      
 422 
     | 
    
         
            +
                          true
         
     | 
| 
      
 423 
     | 
    
         
            +
                        when 'false'
         
     | 
| 
      
 424 
     | 
    
         
            +
                          false
         
     | 
| 
      
 425 
     | 
    
         
            +
                        else
         
     | 
| 
      
 426 
     | 
    
         
            +
                          k.to_sym
         
     | 
| 
      
 427 
     | 
    
         
            +
                        end
         
     | 
| 
      
 428 
     | 
    
         
            +
                      end
         
     | 
| 
       314 
429 
     | 
    
         
             
                      keys
         
     | 
| 
       315 
430 
     | 
    
         
             
                    end
         
     | 
| 
       316 
431 
     | 
    
         
             
                end
         
     | 
| 
       317 
     | 
    
         
            -
             
     | 
| 
       318 
     | 
    
         
            -
                def normalized_key_cache
         
     | 
| 
       319 
     | 
    
         
            -
                  @normalized_key_cache ||= Hash.new { |h,k| h[k] = {} }
         
     | 
| 
       320 
     | 
    
         
            -
                end
         
     | 
| 
       321 
432 
     | 
    
         
             
              end
         
     | 
| 
      
 433 
     | 
    
         
            +
             
     | 
| 
      
 434 
     | 
    
         
            +
              extend Base
         
     | 
| 
       322 
435 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,105 +1,113 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            --- !ruby/object:Gem::Specification 
     | 
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: i18n
         
     | 
| 
       3 
     | 
    
         
            -
            version: !ruby/object:Gem::Version 
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
              segments: 
         
     | 
| 
       6 
     | 
    
         
            -
              - 0
         
     | 
| 
       7 
     | 
    
         
            -
              - 4
         
     | 
| 
       8 
     | 
    
         
            -
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              version: 0.4.0
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.14.4
         
     | 
| 
       10 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       11 
     | 
    
         
            -
            authors: 
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
       12 
7 
     | 
    
         
             
            - Sven Fuchs
         
     | 
| 
       13 
8 
     | 
    
         
             
            - Joshua Harvey
         
     | 
| 
       14 
9 
     | 
    
         
             
            - Matt Aimonetti
         
     | 
| 
       15 
10 
     | 
    
         
             
            - Stephan Soller
         
     | 
| 
       16 
11 
     | 
    
         
             
            - Saimon Moore
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 12 
     | 
    
         
            +
            - Ryan Bigg
         
     | 
| 
      
 13 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       18 
14 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       19 
15 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
      
 16 
     | 
    
         
            +
            date: 2024-03-06 00:00:00.000000000 Z
         
     | 
| 
      
 17 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 18 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 19 
     | 
    
         
            +
              name: concurrent-ruby
         
     | 
| 
      
 20 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 21 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 22 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 23 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 24 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
      
 25 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 26 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 27 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 28 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 29 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 30 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 31 
     | 
    
         
            +
                    version: '1.0'
         
     | 
| 
       25 
32 
     | 
    
         
             
            description: New wave Internationalization support for Ruby.
         
     | 
| 
       26 
33 
     | 
    
         
             
            email: rails-i18n@googlegroups.com
         
     | 
| 
       27 
34 
     | 
    
         
             
            executables: []
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
35 
     | 
    
         
             
            extensions: []
         
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
36 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
            files:
         
     | 
| 
      
 38 
     | 
    
         
            +
            - MIT-LICENSE
         
     | 
| 
      
 39 
     | 
    
         
            +
            - README.md
         
     | 
| 
       34 
40 
     | 
    
         
             
            - lib/i18n.rb
         
     | 
| 
       35 
41 
     | 
    
         
             
            - lib/i18n/backend.rb
         
     | 
| 
       36 
     | 
    
         
            -
            - lib/i18n/backend/active_record.rb
         
     | 
| 
       37 
     | 
    
         
            -
            - lib/i18n/backend/active_record/missing.rb
         
     | 
| 
       38 
     | 
    
         
            -
            - lib/i18n/backend/active_record/store_procs.rb
         
     | 
| 
       39 
     | 
    
         
            -
            - lib/i18n/backend/active_record/translation.rb
         
     | 
| 
       40 
42 
     | 
    
         
             
            - lib/i18n/backend/base.rb
         
     | 
| 
       41 
43 
     | 
    
         
             
            - lib/i18n/backend/cache.rb
         
     | 
| 
      
 44 
     | 
    
         
            +
            - lib/i18n/backend/cache_file.rb
         
     | 
| 
       42 
45 
     | 
    
         
             
            - lib/i18n/backend/cascade.rb
         
     | 
| 
       43 
46 
     | 
    
         
             
            - lib/i18n/backend/chain.rb
         
     | 
| 
       44 
     | 
    
         
            -
            - lib/i18n/backend/cldr.rb
         
     | 
| 
       45 
47 
     | 
    
         
             
            - lib/i18n/backend/fallbacks.rb
         
     | 
| 
       46 
48 
     | 
    
         
             
            - lib/i18n/backend/flatten.rb
         
     | 
| 
       47 
49 
     | 
    
         
             
            - lib/i18n/backend/gettext.rb
         
     | 
| 
       48 
50 
     | 
    
         
             
            - lib/i18n/backend/interpolation_compiler.rb
         
     | 
| 
       49 
51 
     | 
    
         
             
            - lib/i18n/backend/key_value.rb
         
     | 
| 
      
 52 
     | 
    
         
            +
            - lib/i18n/backend/lazy_loadable.rb
         
     | 
| 
       50 
53 
     | 
    
         
             
            - lib/i18n/backend/memoize.rb
         
     | 
| 
       51 
54 
     | 
    
         
             
            - lib/i18n/backend/metadata.rb
         
     | 
| 
       52 
55 
     | 
    
         
             
            - lib/i18n/backend/pluralization.rb
         
     | 
| 
       53 
56 
     | 
    
         
             
            - lib/i18n/backend/simple.rb
         
     | 
| 
       54 
57 
     | 
    
         
             
            - lib/i18n/backend/transliterator.rb
         
     | 
| 
       55 
58 
     | 
    
         
             
            - lib/i18n/config.rb
         
     | 
| 
       56 
     | 
    
         
            -
            - lib/i18n/core_ext/hash.rb
         
     | 
| 
       57 
     | 
    
         
            -
            - lib/i18n/core_ext/string/interpolate.rb
         
     | 
| 
       58 
59 
     | 
    
         
             
            - lib/i18n/exceptions.rb
         
     | 
| 
       59 
60 
     | 
    
         
             
            - lib/i18n/gettext.rb
         
     | 
| 
       60 
61 
     | 
    
         
             
            - lib/i18n/gettext/helpers.rb
         
     | 
| 
       61 
62 
     | 
    
         
             
            - lib/i18n/gettext/po_parser.rb
         
     | 
| 
      
 63 
     | 
    
         
            +
            - lib/i18n/interpolate/ruby.rb
         
     | 
| 
       62 
64 
     | 
    
         
             
            - lib/i18n/locale.rb
         
     | 
| 
       63 
65 
     | 
    
         
             
            - lib/i18n/locale/fallbacks.rb
         
     | 
| 
       64 
66 
     | 
    
         
             
            - lib/i18n/locale/tag.rb
         
     | 
| 
       65 
67 
     | 
    
         
             
            - lib/i18n/locale/tag/parents.rb
         
     | 
| 
       66 
68 
     | 
    
         
             
            - lib/i18n/locale/tag/rfc4646.rb
         
     | 
| 
       67 
69 
     | 
    
         
             
            - lib/i18n/locale/tag/simple.rb
         
     | 
| 
      
 70 
     | 
    
         
            +
            - lib/i18n/middleware.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - lib/i18n/tests.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
            - lib/i18n/tests/basics.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
            - lib/i18n/tests/defaults.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - lib/i18n/tests/interpolation.rb
         
     | 
| 
      
 75 
     | 
    
         
            +
            - lib/i18n/tests/link.rb
         
     | 
| 
      
 76 
     | 
    
         
            +
            - lib/i18n/tests/localization.rb
         
     | 
| 
      
 77 
     | 
    
         
            +
            - lib/i18n/tests/localization/date.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
            - lib/i18n/tests/localization/date_time.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
            - lib/i18n/tests/localization/procs.rb
         
     | 
| 
      
 80 
     | 
    
         
            +
            - lib/i18n/tests/localization/time.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
            - lib/i18n/tests/lookup.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - lib/i18n/tests/pluralization.rb
         
     | 
| 
      
 83 
     | 
    
         
            +
            - lib/i18n/tests/procs.rb
         
     | 
| 
      
 84 
     | 
    
         
            +
            - lib/i18n/utils.rb
         
     | 
| 
       68 
85 
     | 
    
         
             
            - lib/i18n/version.rb
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
            -  
     | 
| 
       72 
     | 
    
         
            -
             
     | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
      
 86 
     | 
    
         
            +
            homepage: https://github.com/ruby-i18n/i18n
         
     | 
| 
      
 87 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 88 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 89 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 90 
     | 
    
         
            +
              bug_tracker_uri: https://github.com/ruby-i18n/i18n/issues
         
     | 
| 
      
 91 
     | 
    
         
            +
              changelog_uri: https://github.com/ruby-i18n/i18n/releases
         
     | 
| 
      
 92 
     | 
    
         
            +
              documentation_uri: https://guides.rubyonrails.org/i18n.html
         
     | 
| 
      
 93 
     | 
    
         
            +
              source_code_uri: https://github.com/ruby-i18n/i18n
         
     | 
| 
      
 94 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       77 
95 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
            require_paths: 
         
     | 
| 
      
 96 
     | 
    
         
            +
            require_paths:
         
     | 
| 
       80 
97 
     | 
    
         
             
            - lib
         
     | 
| 
       81 
     | 
    
         
            -
            required_ruby_version: !ruby/object:Gem::Requirement 
     | 
| 
       82 
     | 
    
         
            -
              requirements: 
     | 
| 
      
 98 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirements:
         
     | 
| 
       83 
100 
     | 
    
         
             
              - - ">="
         
     | 
| 
       84 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       85 
     | 
    
         
            -
                   
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
       89 
     | 
    
         
            -
              requirements: 
         
     | 
| 
      
 101 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 102 
     | 
    
         
            +
                  version: 2.3.0
         
     | 
| 
      
 103 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 104 
     | 
    
         
            +
              requirements:
         
     | 
| 
       90 
105 
     | 
    
         
             
              - - ">="
         
     | 
| 
       91 
     | 
    
         
            -
                - !ruby/object:Gem::Version 
     | 
| 
       92 
     | 
    
         
            -
                   
     | 
| 
       93 
     | 
    
         
            -
                  - 1
         
     | 
| 
       94 
     | 
    
         
            -
                  - 3
         
     | 
| 
       95 
     | 
    
         
            -
                  - 6
         
     | 
| 
       96 
     | 
    
         
            -
                  version: 1.3.6
         
     | 
| 
      
 106 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 107 
     | 
    
         
            +
                  version: 1.3.5
         
     | 
| 
       97 
108 
     | 
    
         
             
            requirements: []
         
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
            signing_key: 
         
     | 
| 
       102 
     | 
    
         
            -
            specification_version: 3
         
     | 
| 
      
 109 
     | 
    
         
            +
            rubygems_version: 3.5.1
         
     | 
| 
      
 110 
     | 
    
         
            +
            signing_key:
         
     | 
| 
      
 111 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
       103 
112 
     | 
    
         
             
            summary: New wave Internationalization support for Ruby
         
     | 
| 
       104 
113 
     | 
    
         
             
            test_files: []
         
     | 
| 
       105 
     | 
    
         
            -
             
     |