zonesync 0.9.0 → 0.10.0

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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/lib/zonesync/cli.rb +9 -0
  4. data/lib/zonesync/cloudflare.rb +64 -39
  5. data/lib/zonesync/diff.rb +10 -1
  6. data/lib/zonesync/errors.rb +35 -0
  7. data/lib/zonesync/generate.rb +14 -0
  8. data/lib/zonesync/http.rb +24 -8
  9. data/lib/zonesync/logger.rb +20 -15
  10. data/lib/zonesync/manifest.rb +21 -5
  11. data/lib/zonesync/parser.rb +337 -0
  12. data/lib/zonesync/provider.rb +80 -26
  13. data/lib/zonesync/record.rb +18 -23
  14. data/lib/zonesync/route53.rb +48 -27
  15. data/lib/zonesync/sync.rb +40 -0
  16. data/lib/zonesync/validator.rb +19 -15
  17. data/lib/zonesync/version.rb +1 -1
  18. data/lib/zonesync/zonefile.rb +22 -311
  19. data/lib/zonesync.rb +27 -60
  20. data/sorbet/config +4 -0
  21. data/sorbet/rbi/annotations/.gitattributes +1 -0
  22. data/sorbet/rbi/annotations/activesupport.rbi +457 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  25. data/sorbet/rbi/gems/.gitattributes +1 -0
  26. data/sorbet/rbi/gems/activesupport@8.0.1.rbi +18474 -0
  27. data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
  28. data/sorbet/rbi/gems/base64@0.2.0.rbi +507 -0
  29. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  30. data/sorbet/rbi/gems/bigdecimal@3.1.9.rbi +9 -0
  31. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
  32. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  33. data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
  34. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  35. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
  36. data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
  37. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  38. data/sorbet/rbi/gems/hashdiff@1.1.2.rbi +353 -0
  39. data/sorbet/rbi/gems/i18n@1.14.6.rbi +2275 -0
  40. data/sorbet/rbi/gems/io-console@0.8.0.rbi +9 -0
  41. data/sorbet/rbi/gems/logger@1.6.4.rbi +940 -0
  42. data/sorbet/rbi/gems/minitest@5.25.4.rbi +1547 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  44. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  45. data/sorbet/rbi/gems/polyglot@0.3.5.rbi +42 -0
  46. data/sorbet/rbi/gems/prism@1.3.0.rbi +40040 -0
  47. data/sorbet/rbi/gems/psych@5.2.2.rbi +1785 -0
  48. data/sorbet/rbi/gems/public_suffix@6.0.1.rbi +936 -0
  49. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  50. data/sorbet/rbi/gems/rbi@0.2.2.rbi +4527 -0
  51. data/sorbet/rbi/gems/rdoc@6.10.0.rbi +12766 -0
  52. data/sorbet/rbi/gems/reline@0.6.0.rbi +9 -0
  53. data/sorbet/rbi/gems/rexml@3.4.0.rbi +4974 -0
  54. data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +10896 -0
  55. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
  56. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +5341 -0
  57. data/sorbet/rbi/gems/rspec-support@3.13.2.rbi +1630 -0
  58. data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
  59. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  60. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  61. data/sorbet/rbi/gems/stringio@3.1.2.rbi +9 -0
  62. data/sorbet/rbi/gems/tapioca@0.16.6.rbi +3611 -0
  63. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  64. data/sorbet/rbi/gems/treetop@1.6.12.rbi +1895 -0
  65. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  66. data/sorbet/rbi/gems/uri@1.0.2.rbi +2340 -0
  67. data/sorbet/rbi/gems/webmock@3.24.0.rbi +1780 -0
  68. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  69. data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
  70. data/sorbet/rbi/todo.rbi +7 -0
  71. data/sorbet/tapioca/config.yml +13 -0
  72. data/sorbet/tapioca/require.rb +4 -0
  73. data/zonesync.gemspec +3 -0
  74. metadata +100 -2
@@ -0,0 +1,2275 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `i18n` gem.
5
+ # Please instead update this file by running `bin/tapioca gem i18n`.
6
+
7
+
8
+ # Simple Locale tag implementation that computes subtags by simply splitting
9
+ # the locale tag at '-' occurrences.
10
+ #
11
+ # source://i18n//lib/i18n/version.rb#3
12
+ module I18n
13
+ extend ::I18n::Base
14
+
15
+ class << self
16
+ # source://i18n//lib/i18n/backend/cache.rb#64
17
+ def cache_key_digest; end
18
+
19
+ # source://i18n//lib/i18n/backend/cache.rb#68
20
+ def cache_key_digest=(key_digest); end
21
+
22
+ # source://i18n//lib/i18n/backend/cache.rb#56
23
+ def cache_namespace; end
24
+
25
+ # source://i18n//lib/i18n/backend/cache.rb#60
26
+ def cache_namespace=(namespace); end
27
+
28
+ # source://i18n//lib/i18n/backend/cache.rb#48
29
+ def cache_store; end
30
+
31
+ # source://i18n//lib/i18n/backend/cache.rb#52
32
+ def cache_store=(store); end
33
+
34
+ # Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+.
35
+ #
36
+ # source://i18n//lib/i18n/backend/fallbacks.rb#17
37
+ def fallbacks; end
38
+
39
+ # Sets the current fallbacks implementation. Use this to set a different fallbacks implementation.
40
+ #
41
+ # source://i18n//lib/i18n/backend/fallbacks.rb#23
42
+ def fallbacks=(fallbacks); end
43
+
44
+ # Return String or raises MissingInterpolationArgument exception.
45
+ # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler.
46
+ #
47
+ # @raise [ReservedInterpolationKey]
48
+ #
49
+ # source://i18n//lib/i18n/interpolate/ruby.rb#23
50
+ def interpolate(string, values); end
51
+
52
+ # source://i18n//lib/i18n/interpolate/ruby.rb#29
53
+ def interpolate_hash(string, values); end
54
+
55
+ # source://i18n//lib/i18n.rb#38
56
+ def new_double_nested_cache; end
57
+
58
+ # @return [Boolean]
59
+ #
60
+ # source://i18n//lib/i18n/backend/cache.rb#72
61
+ def perform_caching?; end
62
+
63
+ # Marks a key as reserved. Reserved keys are used internally,
64
+ # and can't also be used for interpolation. If you are using any
65
+ # extra keys as I18n options, you should call I18n.reserve_key
66
+ # before any I18n.translate (etc) calls are made.
67
+ #
68
+ # source://i18n//lib/i18n.rb#46
69
+ def reserve_key(key); end
70
+
71
+ # source://i18n//lib/i18n.rb#51
72
+ def reserved_keys_pattern; end
73
+ end
74
+ end
75
+
76
+ # source://i18n//lib/i18n/exceptions.rb#16
77
+ class I18n::ArgumentError < ::ArgumentError; end
78
+
79
+ # source://i18n//lib/i18n/backend.rb#4
80
+ module I18n::Backend; end
81
+
82
+ # source://i18n//lib/i18n/backend/base.rb#8
83
+ module I18n::Backend::Base
84
+ include ::I18n::Backend::Transliterator
85
+
86
+ # Returns an array of locales for which translations are available
87
+ # ignoring the reserved translation meta data key :i18n.
88
+ #
89
+ # @raise [NotImplementedError]
90
+ #
91
+ # source://i18n//lib/i18n/backend/base.rb#97
92
+ def available_locales; end
93
+
94
+ # source://i18n//lib/i18n/backend/base.rb#105
95
+ def eager_load!; end
96
+
97
+ # @return [Boolean]
98
+ #
99
+ # source://i18n//lib/i18n/backend/base.rb#71
100
+ def exists?(locale, key, options = T.unsafe(nil)); end
101
+
102
+ # Accepts a list of paths to translation files. Loads translations from
103
+ # plain Ruby (*.rb), YAML files (*.yml), or JSON files (*.json). See #load_rb, #load_yml, and #load_json
104
+ # for details.
105
+ #
106
+ # source://i18n//lib/i18n/backend/base.rb#14
107
+ def load_translations(*filenames); end
108
+
109
+ # Acts the same as +strftime+, but uses a localized version of the
110
+ # format string. Takes a key from the date/time formats translations as
111
+ # a format argument (<em>e.g.</em>, <tt>:short</tt> in <tt>:'date.formats'</tt>).
112
+ #
113
+ # @raise [ArgumentError]
114
+ #
115
+ # source://i18n//lib/i18n/backend/base.rb#78
116
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
117
+
118
+ # source://i18n//lib/i18n/backend/base.rb#101
119
+ def reload!; end
120
+
121
+ # This method receives a locale, a data hash and options for storing translations.
122
+ # Should be implemented
123
+ #
124
+ # @raise [NotImplementedError]
125
+ #
126
+ # source://i18n//lib/i18n/backend/base.rb#24
127
+ def store_translations(locale, data, options = T.unsafe(nil)); end
128
+
129
+ # @raise [I18n::ArgumentError]
130
+ #
131
+ # source://i18n//lib/i18n/backend/base.rb#28
132
+ def translate(locale, key, options = T.unsafe(nil)); end
133
+
134
+ protected
135
+
136
+ # Deep interpolation
137
+ #
138
+ # deep_interpolate { people: { ann: "Ann is %{ann}", john: "John is %{john}" } },
139
+ # ann: 'good', john: 'big'
140
+ # #=> { people: { ann: "Ann is good", john: "John is big" } }
141
+ #
142
+ # source://i18n//lib/i18n/backend/base.rb#217
143
+ def deep_interpolate(locale, data, values = T.unsafe(nil)); end
144
+
145
+ # Evaluates defaults.
146
+ # If given subject is an Array, it walks the array and returns the
147
+ # first translation that can be resolved. Otherwise it tries to resolve
148
+ # the translation directly.
149
+ #
150
+ # source://i18n//lib/i18n/backend/base.rb#128
151
+ def default(locale, object, subject, options = T.unsafe(nil)); end
152
+
153
+ # @return [Boolean]
154
+ #
155
+ # source://i18n//lib/i18n/backend/base.rb#111
156
+ def eager_loaded?; end
157
+
158
+ # Interpolates values into a given subject.
159
+ #
160
+ # if the given subject is a string then:
161
+ # method interpolates "file %{file} opened by %%{user}", :file => 'test.txt', :user => 'Mr. X'
162
+ # # => "file test.txt opened by %{user}"
163
+ #
164
+ # if the given subject is an array then:
165
+ # each element of the array is recursively interpolated (until it finds a string)
166
+ # method interpolates ["yes, %{user}", ["maybe no, %{user}", "no, %{user}"]], :user => "bartuz"
167
+ # # => ["yes, bartuz", ["maybe no, bartuz", "no, bartuz"]]
168
+ #
169
+ # source://i18n//lib/i18n/backend/base.rb#201
170
+ def interpolate(locale, subject, values = T.unsafe(nil)); end
171
+
172
+ # Loads a single translations file by delegating to #load_rb or
173
+ # #load_yml depending on the file extension and directly merges the
174
+ # data to the existing translations. Raises I18n::UnknownFileType
175
+ # for all other file extensions.
176
+ #
177
+ # @raise [UnknownFileType]
178
+ #
179
+ # source://i18n//lib/i18n/backend/base.rb#240
180
+ def load_file(filename); end
181
+
182
+ # Loads a JSON translations file. The data must have locales as
183
+ # toplevel keys.
184
+ #
185
+ # source://i18n//lib/i18n/backend/base.rb#276
186
+ def load_json(filename); end
187
+
188
+ # Loads a plain Ruby translations file. eval'ing the file must yield
189
+ # a Hash containing translation data with locales as toplevel keys.
190
+ #
191
+ # source://i18n//lib/i18n/backend/base.rb#254
192
+ def load_rb(filename); end
193
+
194
+ # Loads a YAML translations file. The data must have locales as
195
+ # toplevel keys.
196
+ #
197
+ # source://i18n//lib/i18n/backend/base.rb#261
198
+ def load_yaml(filename); end
199
+
200
+ # Loads a YAML translations file. The data must have locales as
201
+ # toplevel keys.
202
+ #
203
+ # source://i18n//lib/i18n/backend/base.rb#261
204
+ def load_yml(filename); end
205
+
206
+ # The method which actually looks up for the translation in the store.
207
+ #
208
+ # @raise [NotImplementedError]
209
+ #
210
+ # source://i18n//lib/i18n/backend/base.rb#116
211
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
212
+
213
+ # source://i18n//lib/i18n/backend/base.rb#308
214
+ def pluralization_key(entry, count); end
215
+
216
+ # Picks a translation from a pluralized mnemonic subkey according to English
217
+ # pluralization rules :
218
+ # - It will pick the :one subkey if count is equal to 1.
219
+ # - It will pick the :other subkey otherwise.
220
+ # - It will pick the :zero subkey in the special case where count is
221
+ # equal to 0 and there is a :zero subkey present. This behaviour is
222
+ # not standard with regards to the CLDR pluralization rules.
223
+ # Other backends can implement more flexible or complex pluralization rules.
224
+ #
225
+ # @raise [InvalidPluralizationData]
226
+ #
227
+ # source://i18n//lib/i18n/backend/base.rb#182
228
+ def pluralize(locale, entry, count); end
229
+
230
+ # Resolves a translation.
231
+ # If the given subject is a Symbol, it will be translated with the
232
+ # given options. If it is a Proc then it will be evaluated. All other
233
+ # subjects will be returned directly.
234
+ #
235
+ # source://i18n//lib/i18n/backend/base.rb#150
236
+ def resolve(locale, object, subject, options = T.unsafe(nil)); end
237
+
238
+ # Resolves a translation.
239
+ # If the given subject is a Symbol, it will be translated with the
240
+ # given options. If it is a Proc then it will be evaluated. All other
241
+ # subjects will be returned directly.
242
+ #
243
+ # source://i18n//lib/i18n/backend/base.rb#150
244
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
245
+
246
+ # @return [Boolean]
247
+ #
248
+ # source://i18n//lib/i18n/backend/base.rb#120
249
+ def subtrees?; end
250
+
251
+ # source://i18n//lib/i18n/backend/base.rb#289
252
+ def translate_localization_format(locale, object, format, options); end
253
+ end
254
+
255
+ # TODO Should the cache be cleared if new translations are stored?
256
+ #
257
+ # source://i18n//lib/i18n/backend/cache.rb#79
258
+ module I18n::Backend::Cache
259
+ # source://i18n//lib/i18n/backend/cache.rb#80
260
+ def translate(locale, key, options = T.unsafe(nil)); end
261
+
262
+ protected
263
+
264
+ # source://i18n//lib/i18n/backend/cache.rb#93
265
+ def _fetch(cache_key, &block); end
266
+
267
+ # source://i18n//lib/i18n/backend/cache.rb#101
268
+ def cache_key(locale, key, options); end
269
+
270
+ # source://i18n//lib/i18n/backend/cache.rb#86
271
+ def fetch(cache_key, &block); end
272
+
273
+ private
274
+
275
+ # source://i18n//lib/i18n/backend/cache.rb#108
276
+ def digest_item(key); end
277
+ end
278
+
279
+ # Overwrites the Base load_file method to cache loaded file contents.
280
+ #
281
+ # source://i18n//lib/i18n/backend/cache_file.rb#8
282
+ module I18n::Backend::CacheFile
283
+ # Optionally provide path_roots array to normalize filename paths,
284
+ # to make the cached i18n data portable across environments.
285
+ #
286
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
287
+ def path_roots; end
288
+
289
+ # Optionally provide path_roots array to normalize filename paths,
290
+ # to make the cached i18n data portable across environments.
291
+ #
292
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
293
+ def path_roots=(_arg0); end
294
+
295
+ protected
296
+
297
+ # Track loaded translation files in the `i18n.load_file` scope,
298
+ # and skip loading the file if its contents are still up-to-date.
299
+ #
300
+ # source://i18n//lib/i18n/backend/cache_file.rb#17
301
+ def load_file(filename); end
302
+
303
+ # Translate absolute filename to relative path for i18n key.
304
+ #
305
+ # source://i18n//lib/i18n/backend/cache_file.rb#28
306
+ def normalized_path(file); end
307
+ end
308
+
309
+ # source://i18n//lib/i18n/backend/cascade.rb#35
310
+ module I18n::Backend::Cascade
311
+ # source://i18n//lib/i18n/backend/cascade.rb#36
312
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
313
+ end
314
+
315
+ # Backend that chains multiple other backends and checks each of them when
316
+ # a translation needs to be looked up. This is useful when you want to use
317
+ # standard translations with a Simple backend but store custom application
318
+ # translations in a database or other backends.
319
+ #
320
+ # To use the Chain backend instantiate it and set it to the I18n module.
321
+ # You can add chained backends through the initializer or backends
322
+ # accessor:
323
+ #
324
+ # # preserves the existing Simple backend set to I18n.backend
325
+ # I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
326
+ #
327
+ # The implementation assumes that all backends added to the Chain implement
328
+ # a lookup method with the same API as Simple backend does.
329
+ #
330
+ # Fallback translations using the :default option are only used by the last backend of a chain.
331
+ #
332
+ # source://i18n//lib/i18n/backend/chain.rb#21
333
+ class I18n::Backend::Chain
334
+ include ::I18n::Backend::Transliterator
335
+ include ::I18n::Backend::Base
336
+ include ::I18n::Backend::Chain::Implementation
337
+ end
338
+
339
+ # source://i18n//lib/i18n/backend/chain.rb#22
340
+ module I18n::Backend::Chain::Implementation
341
+ include ::I18n::Backend::Transliterator
342
+ include ::I18n::Backend::Base
343
+
344
+ # source://i18n//lib/i18n/backend/chain.rb#27
345
+ def initialize(*backends); end
346
+
347
+ # source://i18n//lib/i18n/backend/chain.rb#52
348
+ def available_locales; end
349
+
350
+ # Returns the value of attribute backends.
351
+ #
352
+ # source://i18n//lib/i18n/backend/chain.rb#25
353
+ def backends; end
354
+
355
+ # Sets the attribute backends
356
+ #
357
+ # @param value the value to set the attribute backends to.
358
+ #
359
+ # source://i18n//lib/i18n/backend/chain.rb#25
360
+ def backends=(_arg0); end
361
+
362
+ # source://i18n//lib/i18n/backend/chain.rb#44
363
+ def eager_load!; end
364
+
365
+ # @return [Boolean]
366
+ #
367
+ # source://i18n//lib/i18n/backend/chain.rb#76
368
+ def exists?(locale, key, options = T.unsafe(nil)); end
369
+
370
+ # @return [Boolean]
371
+ #
372
+ # source://i18n//lib/i18n/backend/chain.rb#31
373
+ def initialized?; end
374
+
375
+ # source://i18n//lib/i18n/backend/chain.rb#82
376
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
377
+
378
+ # source://i18n//lib/i18n/backend/chain.rb#40
379
+ def reload!; end
380
+
381
+ # source://i18n//lib/i18n/backend/chain.rb#48
382
+ def store_translations(locale, data, options = T.unsafe(nil)); end
383
+
384
+ # source://i18n//lib/i18n/backend/chain.rb#56
385
+ def translate(locale, key, default_options = T.unsafe(nil)); end
386
+
387
+ protected
388
+
389
+ # source://i18n//lib/i18n/backend/chain.rb#92
390
+ def init_translations; end
391
+
392
+ # @return [Boolean]
393
+ #
394
+ # source://i18n//lib/i18n/backend/chain.rb#108
395
+ def namespace_lookup?(result, options); end
396
+
397
+ # source://i18n//lib/i18n/backend/chain.rb#98
398
+ def translations; end
399
+
400
+ private
401
+
402
+ # This is approximately what gets used in ActiveSupport.
403
+ # However since we are not guaranteed to run in an ActiveSupport context
404
+ # it is wise to have our own copy. We underscore it
405
+ # to not pollute the namespace of the including class.
406
+ #
407
+ # source://i18n//lib/i18n/backend/chain.rb#117
408
+ def _deep_merge(hash, other_hash); end
409
+ end
410
+
411
+ # source://i18n//lib/i18n/backend/fallbacks.rb#30
412
+ module I18n::Backend::Fallbacks
413
+ # @return [Boolean]
414
+ #
415
+ # source://i18n//lib/i18n/backend/fallbacks.rb#98
416
+ def exists?(locale, key, options = T.unsafe(nil)); end
417
+
418
+ # source://i18n//lib/i18n/backend/fallbacks.rb#89
419
+ def extract_non_symbol_default!(options); end
420
+
421
+ # source://i18n//lib/i18n/backend/fallbacks.rb#67
422
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
423
+
424
+ # Overwrites the Base backend translate method so that it will try each
425
+ # locale given by I18n.fallbacks for the given locale. E.g. for the
426
+ # locale :"de-DE" it might try the locales :"de-DE", :de and :en
427
+ # (depends on the fallbacks implementation) until it finds a result with
428
+ # the given options. If it does not find any result for any of the
429
+ # locales it will then throw MissingTranslation as usual.
430
+ #
431
+ # The default option takes precedence over fallback locales only when
432
+ # it's a Symbol. When the default contains a String, Proc or Hash
433
+ # it is evaluated last after all the fallback locales have been tried.
434
+ #
435
+ # source://i18n//lib/i18n/backend/fallbacks.rb#41
436
+ def translate(locale, key, options = T.unsafe(nil)); end
437
+
438
+ private
439
+
440
+ # Overwrite on_fallback to add specified logic when the fallback succeeds.
441
+ #
442
+ # source://i18n//lib/i18n/backend/fallbacks.rb#114
443
+ def on_fallback(_original_locale, _fallback_locale, _key, _options); end
444
+ end
445
+
446
+ # This module contains several helpers to assist flattening translations.
447
+ # You may want to flatten translations for:
448
+ #
449
+ # 1) speed up lookups, as in the Memoize backend;
450
+ # 2) In case you want to store translations in a data store, as in ActiveRecord backend;
451
+ #
452
+ # You can check both backends above for some examples.
453
+ # This module also keeps all links in a hash so they can be properly resolved when flattened.
454
+ #
455
+ # source://i18n//lib/i18n/backend/flatten.rb#13
456
+ module I18n::Backend::Flatten
457
+ # Flatten keys for nested Hashes by chaining up keys:
458
+ #
459
+ # >> { "a" => { "b" => { "c" => "d", "e" => "f" }, "g" => "h" }, "i" => "j"}.wind
460
+ # => { "a.b.c" => "d", "a.b.e" => "f", "a.g" => "h", "i" => "j" }
461
+ #
462
+ # source://i18n//lib/i18n/backend/flatten.rb#59
463
+ def flatten_keys(hash, escape, prev_key = T.unsafe(nil), &block); end
464
+
465
+ # Receives a hash of translations (where the key is a locale and
466
+ # the value is another hash) and return a hash with all
467
+ # translations flattened.
468
+ #
469
+ # Nested hashes are included in the flattened hash just if subtree
470
+ # is true and Symbols are automatically stored as links.
471
+ #
472
+ # source://i18n//lib/i18n/backend/flatten.rb#74
473
+ def flatten_translations(locale, data, escape, subtree); end
474
+
475
+ # Store flattened links.
476
+ #
477
+ # source://i18n//lib/i18n/backend/flatten.rb#50
478
+ def links; end
479
+
480
+ # Shortcut to I18n::Backend::Flatten.normalize_flat_keys
481
+ # and then resolve_links.
482
+ #
483
+ # source://i18n//lib/i18n/backend/flatten.rb#44
484
+ def normalize_flat_keys(locale, key, scope, separator); end
485
+
486
+ protected
487
+
488
+ # source://i18n//lib/i18n/backend/flatten.rb#112
489
+ def escape_default_separator(key); end
490
+
491
+ # source://i18n//lib/i18n/backend/flatten.rb#106
492
+ def find_link(locale, key); end
493
+
494
+ # source://i18n//lib/i18n/backend/flatten.rb#93
495
+ def resolve_link(locale, key); end
496
+
497
+ # source://i18n//lib/i18n/backend/flatten.rb#89
498
+ def store_link(locale, key, link); end
499
+
500
+ class << self
501
+ # Receives a string and escape the default separator.
502
+ #
503
+ # source://i18n//lib/i18n/backend/flatten.rb#38
504
+ def escape_default_separator(key); end
505
+
506
+ # normalize_keys the flatten way. This method is significantly faster
507
+ # and creates way less objects than the one at I18n.normalize_keys.
508
+ # It also handles escaping the translation keys.
509
+ #
510
+ # source://i18n//lib/i18n/backend/flatten.rb#20
511
+ def normalize_flat_keys(locale, key, scope, separator); end
512
+ end
513
+ end
514
+
515
+ # source://i18n//lib/i18n/backend/flatten.rb#15
516
+ I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String)
517
+
518
+ # source://i18n//lib/i18n/backend/flatten.rb#14
519
+ I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String)
520
+
521
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#20
522
+ module I18n::Backend::InterpolationCompiler
523
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#97
524
+ def interpolate(locale, string, values); end
525
+
526
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#107
527
+ def store_translations(locale, data, options = T.unsafe(nil)); end
528
+
529
+ protected
530
+
531
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#113
532
+ def compile_all_strings_in(data); end
533
+ end
534
+
535
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#21
536
+ module I18n::Backend::InterpolationCompiler::Compiler
537
+ extend ::I18n::Backend::InterpolationCompiler::Compiler
538
+
539
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#26
540
+ def compile_if_an_interpolation(string); end
541
+
542
+ # @return [Boolean]
543
+ #
544
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#38
545
+ def interpolated_str?(str); end
546
+
547
+ protected
548
+
549
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#58
550
+ def compile_interpolation_token(key); end
551
+
552
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#48
553
+ def compiled_interpolation_body(str); end
554
+
555
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#71
556
+ def direct_key(key); end
557
+
558
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#91
559
+ def escape_key_sym(key); end
560
+
561
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#87
562
+ def escape_plain_str(str); end
563
+
564
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#54
565
+ def handle_interpolation_token(token); end
566
+
567
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#67
568
+ def interpolate_key(key); end
569
+
570
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#62
571
+ def interpolate_or_raise_missing(key); end
572
+
573
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#79
574
+ def missing_key(key); end
575
+
576
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#75
577
+ def nil_key(key); end
578
+
579
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#83
580
+ def reserved_key(key); end
581
+
582
+ # tokenize("foo %{bar} baz %%{buz}") # => ["foo ", "%{bar}", " baz ", "%%{buz}"]
583
+ #
584
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#44
585
+ def tokenize(str); end
586
+ end
587
+
588
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#24
589
+ I18n::Backend::InterpolationCompiler::Compiler::TOKENIZER = T.let(T.unsafe(nil), Regexp)
590
+
591
+ # This is a basic backend for key value stores. It receives on
592
+ # initialization the store, which should respond to three methods:
593
+ #
594
+ # * store#[](key) - Used to get a value
595
+ # * store#[]=(key, value) - Used to set a value
596
+ # * store#keys - Used to get all keys
597
+ #
598
+ # Since these stores only supports string, all values are converted
599
+ # to JSON before being stored, allowing it to also store booleans,
600
+ # hashes and arrays. However, this store does not support Procs.
601
+ #
602
+ # As the ActiveRecord backend, Symbols are just supported when loading
603
+ # translations from the filesystem or through explicit store translations.
604
+ #
605
+ # Also, avoid calling I18n.available_locales since it's a somehow
606
+ # expensive operation in most stores.
607
+ #
608
+ # == Example
609
+ #
610
+ # To setup I18n to use TokyoCabinet in memory is quite straightforward:
611
+ #
612
+ # require 'rufus/tokyo/cabinet' # gem install rufus-tokyo
613
+ # I18n.backend = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new('*'))
614
+ #
615
+ # == Performance
616
+ #
617
+ # You may make this backend even faster by including the Memoize module.
618
+ # However, notice that you should properly clear the cache if you change
619
+ # values directly in the key-store.
620
+ #
621
+ # == Subtrees
622
+ #
623
+ # In most backends, you are allowed to retrieve part of a translation tree:
624
+ #
625
+ # I18n.backend.store_translations :en, :foo => { :bar => :baz }
626
+ # I18n.t "foo" #=> { :bar => :baz }
627
+ #
628
+ # This backend supports this feature by default, but it slows down the storage
629
+ # of new data considerably and makes hard to delete entries. That said, you are
630
+ # allowed to disable the storage of subtrees on initialization:
631
+ #
632
+ # I18n::Backend::KeyValue.new(@store, false)
633
+ #
634
+ # This is useful if you are using a KeyValue backend chained to a Simple backend.
635
+ #
636
+ # source://i18n//lib/i18n/backend/key_value.rb#69
637
+ class I18n::Backend::KeyValue
638
+ include ::I18n::Backend::Flatten
639
+ include ::I18n::Backend::Transliterator
640
+ include ::I18n::Backend::Base
641
+ include ::I18n::Backend::KeyValue::Implementation
642
+ end
643
+
644
+ # source://i18n//lib/i18n/backend/key_value.rb#70
645
+ module I18n::Backend::KeyValue::Implementation
646
+ include ::I18n::Backend::Flatten
647
+ include ::I18n::Backend::Transliterator
648
+ include ::I18n::Backend::Base
649
+
650
+ # source://i18n//lib/i18n/backend/key_value.rb#75
651
+ def initialize(store, subtrees = T.unsafe(nil)); end
652
+
653
+ # source://i18n//lib/i18n/backend/key_value.rb#102
654
+ def available_locales; end
655
+
656
+ # @return [Boolean]
657
+ #
658
+ # source://i18n//lib/i18n/backend/key_value.rb#79
659
+ def initialized?; end
660
+
661
+ # Returns the value of attribute store.
662
+ #
663
+ # source://i18n//lib/i18n/backend/key_value.rb#71
664
+ def store; end
665
+
666
+ # Sets the attribute store
667
+ #
668
+ # @param value the value to set the attribute store to.
669
+ #
670
+ # source://i18n//lib/i18n/backend/key_value.rb#71
671
+ def store=(_arg0); end
672
+
673
+ # source://i18n//lib/i18n/backend/key_value.rb#83
674
+ def store_translations(locale, data, options = T.unsafe(nil)); end
675
+
676
+ protected
677
+
678
+ # source://i18n//lib/i18n/backend/key_value.rb#124
679
+ def init_translations; end
680
+
681
+ # source://i18n//lib/i18n/backend/key_value.rb#136
682
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
683
+
684
+ # source://i18n//lib/i18n/backend/key_value.rb#150
685
+ def pluralize(locale, entry, count); end
686
+
687
+ # @return [Boolean]
688
+ #
689
+ # source://i18n//lib/i18n/backend/key_value.rb#132
690
+ def subtrees?; end
691
+
692
+ # Queries the translations from the key-value store and converts
693
+ # them into a hash such as the one returned from loading the
694
+ # haml files
695
+ #
696
+ # source://i18n//lib/i18n/backend/key_value.rb#115
697
+ def translations; end
698
+ end
699
+
700
+ # source://i18n//lib/i18n/backend/key_value.rb#161
701
+ class I18n::Backend::KeyValue::SubtreeProxy
702
+ # @return [SubtreeProxy] a new instance of SubtreeProxy
703
+ #
704
+ # source://i18n//lib/i18n/backend/key_value.rb#162
705
+ def initialize(master_key, store); end
706
+
707
+ # source://i18n//lib/i18n/backend/key_value.rb#172
708
+ def [](key); end
709
+
710
+ # @return [Boolean]
711
+ #
712
+ # source://i18n//lib/i18n/backend/key_value.rb#168
713
+ def has_key?(key); end
714
+
715
+ # source://i18n//lib/i18n/backend/key_value.rb#196
716
+ def inspect; end
717
+
718
+ # @return [Boolean]
719
+ #
720
+ # source://i18n//lib/i18n/backend/key_value.rb#188
721
+ def instance_of?(klass); end
722
+
723
+ # @return [Boolean]
724
+ #
725
+ # source://i18n//lib/i18n/backend/key_value.rb#183
726
+ def is_a?(klass); end
727
+
728
+ # @return [Boolean]
729
+ #
730
+ # source://i18n//lib/i18n/backend/key_value.rb#183
731
+ def kind_of?(klass); end
732
+
733
+ # @return [Boolean]
734
+ #
735
+ # source://i18n//lib/i18n/backend/key_value.rb#192
736
+ def nil?; end
737
+ end
738
+
739
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#65
740
+ class I18n::Backend::LazyLoadable < ::I18n::Backend::Simple
741
+ # @return [LazyLoadable] a new instance of LazyLoadable
742
+ #
743
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#66
744
+ def initialize(lazy_load: T.unsafe(nil)); end
745
+
746
+ # Parse the load path and extract all locales.
747
+ #
748
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#99
749
+ def available_locales; end
750
+
751
+ # Eager loading is not supported in the lazy context.
752
+ #
753
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#90
754
+ def eager_load!; end
755
+
756
+ # Returns whether the current locale is initialized.
757
+ #
758
+ # @return [Boolean]
759
+ #
760
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#71
761
+ def initialized?; end
762
+
763
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#107
764
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
765
+
766
+ # Clean up translations and uninitialize all locales.
767
+ #
768
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#80
769
+ def reload!; end
770
+
771
+ protected
772
+
773
+ # Load translations from files that belong to the current locale.
774
+ #
775
+ # @raise [InvalidFilenames]
776
+ #
777
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#121
778
+ def init_translations; end
779
+
780
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#133
781
+ def initialized_locales; end
782
+
783
+ private
784
+
785
+ # Checks if a filename is named in correspondence to the translations it loaded.
786
+ # The locale extracted from the path must be the single locale loaded in the translations.
787
+ #
788
+ # @raise [FilenameIncorrect]
789
+ #
790
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#175
791
+ def assert_file_named_correctly!(file, translations); end
792
+
793
+ # Select all files from I18n load path that belong to current locale.
794
+ # These files must start with the locale identifier (ie. "en", "pt-BR"),
795
+ # followed by an "_" demarcation to separate proceeding text.
796
+ #
797
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#167
798
+ def filenames_for_current_locale; end
799
+
800
+ # @return [Boolean]
801
+ #
802
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#139
803
+ def lazy_load?; end
804
+
805
+ # Loads each file supplied and asserts that the file only loads
806
+ # translations as expected by the name. The method returns a list of
807
+ # errors corresponding to offending files.
808
+ #
809
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#152
810
+ def load_translations_and_collect_file_errors(files); end
811
+ end
812
+
813
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#143
814
+ class I18n::Backend::LazyLoadable::FilenameIncorrect < ::StandardError
815
+ # @return [FilenameIncorrect] a new instance of FilenameIncorrect
816
+ #
817
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#144
818
+ def initialize(file, expected_locale, unexpected_locales); end
819
+ end
820
+
821
+ # Backend that lazy loads translations based on the current locale. This
822
+ # implementation avoids loading all translations up front. Instead, it only
823
+ # loads the translations that belong to the current locale. This offers a
824
+ # performance incentive in local development and test environments for
825
+ # applications with many translations for many different locales. It's
826
+ # particularly useful when the application only refers to a single locales'
827
+ # translations at a time (ex. A Rails workload). The implementation
828
+ # identifies which translation files from the load path belong to the
829
+ # current locale by pattern matching against their path name.
830
+ #
831
+ # Specifically, a translation file is considered to belong to a locale if:
832
+ # a) the filename is in the I18n load path
833
+ # b) the filename ends in a supported extension (ie. .yml, .json, .po, .rb)
834
+ # c) the filename starts with the locale identifier
835
+ # d) the locale identifier and optional proceeding text is separated by an underscore, ie. "_".
836
+ #
837
+ # Examples:
838
+ # Valid files that will be selected by this backend:
839
+ #
840
+ # "files/locales/en_translation.yml" (Selected for locale "en")
841
+ # "files/locales/fr.po" (Selected for locale "fr")
842
+ #
843
+ # Invalid files that won't be selected by this backend:
844
+ #
845
+ # "files/locales/translation-file"
846
+ # "files/locales/en-translation.unsupported"
847
+ # "files/locales/french/translation.yml"
848
+ # "files/locales/fr/translation.yml"
849
+ #
850
+ # The implementation uses this assumption to defer the loading of
851
+ # translation files until the current locale actually requires them.
852
+ #
853
+ # The backend has two working modes: lazy_load and eager_load.
854
+ #
855
+ # Note: This backend should only be enabled in test environments!
856
+ # When the mode is set to false, the backend behaves exactly like the
857
+ # Simple backend, with an additional check that the paths being loaded
858
+ # abide by the format. If paths can't be matched to the format, an error is raised.
859
+ #
860
+ # You can configure lazy loaded backends through the initializer or backends
861
+ # accessor:
862
+ #
863
+ # # In test environments
864
+ #
865
+ # I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: true)
866
+ #
867
+ # # In other environments, such as production and CI
868
+ #
869
+ # I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: false) # default
870
+ #
871
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#55
872
+ class I18n::Backend::LocaleExtractor
873
+ class << self
874
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#57
875
+ def locale_from_path(path); end
876
+ end
877
+ end
878
+
879
+ # source://i18n//lib/i18n/backend/memoize.rb#14
880
+ module I18n::Backend::Memoize
881
+ # source://i18n//lib/i18n/backend/memoize.rb#15
882
+ def available_locales; end
883
+
884
+ # source://i18n//lib/i18n/backend/memoize.rb#29
885
+ def eager_load!; end
886
+
887
+ # source://i18n//lib/i18n/backend/memoize.rb#24
888
+ def reload!; end
889
+
890
+ # source://i18n//lib/i18n/backend/memoize.rb#19
891
+ def store_translations(locale, data, options = T.unsafe(nil)); end
892
+
893
+ protected
894
+
895
+ # source://i18n//lib/i18n/backend/memoize.rb#37
896
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
897
+
898
+ # source://i18n//lib/i18n/backend/memoize.rb#44
899
+ def memoized_lookup; end
900
+
901
+ # source://i18n//lib/i18n/backend/memoize.rb#48
902
+ def reset_memoizations!(locale = T.unsafe(nil)); end
903
+ end
904
+
905
+ # source://i18n//lib/i18n/backend/metadata.rb#21
906
+ module I18n::Backend::Metadata
907
+ # source://i18n//lib/i18n/backend/metadata.rb#52
908
+ def interpolate(locale, entry, values = T.unsafe(nil)); end
909
+
910
+ # source://i18n//lib/i18n/backend/metadata.rb#57
911
+ def pluralize(locale, entry, count); end
912
+
913
+ # source://i18n//lib/i18n/backend/metadata.rb#40
914
+ def translate(locale, key, options = T.unsafe(nil)); end
915
+
916
+ protected
917
+
918
+ # source://i18n//lib/i18n/backend/metadata.rb#63
919
+ def with_metadata(metadata, &block); end
920
+
921
+ class << self
922
+ # @private
923
+ #
924
+ # source://i18n//lib/i18n/backend/metadata.rb#23
925
+ def included(base); end
926
+ end
927
+ end
928
+
929
+ # source://i18n//lib/i18n/backend/pluralization.rb#16
930
+ module I18n::Backend::Pluralization
931
+ # Overwrites the Base backend translate method so that it will check the
932
+ # translation meta data space (:i18n) for a locale specific pluralization
933
+ # rule and use it to pluralize the given entry. I.e., the library expects
934
+ # pluralization rules to be stored at I18n.t(:'i18n.plural.rule')
935
+ #
936
+ # Pluralization rules are expected to respond to #call(count) and
937
+ # return a pluralization key. Valid keys depend on the pluralization
938
+ # rules for the locale, as defined in the CLDR.
939
+ # As of v41, 6 locale-specific plural categories are defined:
940
+ # :few, :many, :one, :other, :two, :zero
941
+ #
942
+ # n.b., The :one plural category does not imply the number 1.
943
+ # Instead, :one is a category for any number that behaves like 1 in
944
+ # that locale. For example, in some locales, :one is used for numbers
945
+ # that end in "1" (like 1, 21, 151) but that don't end in
946
+ # 11 (like 11, 111, 10311).
947
+ # Similar notes apply to the :two, and :zero plural categories.
948
+ #
949
+ # If you want to have different strings for the categories of count == 0
950
+ # (e.g. "I don't have any cars") or count == 1 (e.g. "I have a single car")
951
+ # use the explicit `"0"` and `"1"` keys.
952
+ # https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules
953
+ #
954
+ # source://i18n//lib/i18n/backend/pluralization.rb#39
955
+ def pluralize(locale, entry, count); end
956
+
957
+ protected
958
+
959
+ # source://i18n//lib/i18n/backend/pluralization.rb#81
960
+ def pluralizer(locale); end
961
+
962
+ # source://i18n//lib/i18n/backend/pluralization.rb#77
963
+ def pluralizers; end
964
+
965
+ private
966
+
967
+ # Normalizes categories of 0.0 and 1.0
968
+ # and returns the symbolic version
969
+ #
970
+ # source://i18n//lib/i18n/backend/pluralization.rb#89
971
+ def symbolic_count(count); end
972
+ end
973
+
974
+ # A simple backend that reads translations from YAML files and stores them in
975
+ # an in-memory hash. Relies on the Base backend.
976
+ #
977
+ # The implementation is provided by a Implementation module allowing to easily
978
+ # extend Simple backend's behavior by including modules. E.g.:
979
+ #
980
+ # module I18n::Backend::Pluralization
981
+ # def pluralize(*args)
982
+ # # extended pluralization logic
983
+ # super
984
+ # end
985
+ # end
986
+ #
987
+ # I18n::Backend::Simple.include(I18n::Backend::Pluralization)
988
+ #
989
+ # source://i18n//lib/i18n/backend/simple.rb#21
990
+ class I18n::Backend::Simple
991
+ include ::I18n::Backend::Transliterator
992
+ include ::I18n::Backend::Base
993
+ include ::I18n::Backend::Simple::Implementation
994
+ end
995
+
996
+ # source://i18n//lib/i18n/backend/simple.rb#22
997
+ module I18n::Backend::Simple::Implementation
998
+ include ::I18n::Backend::Transliterator
999
+ include ::I18n::Backend::Base
1000
+
1001
+ # Get available locales from the translations hash
1002
+ #
1003
+ # source://i18n//lib/i18n/backend/simple.rb#49
1004
+ def available_locales; end
1005
+
1006
+ # source://i18n//lib/i18n/backend/simple.rb#64
1007
+ def eager_load!; end
1008
+
1009
+ # @return [Boolean]
1010
+ #
1011
+ # source://i18n//lib/i18n/backend/simple.rb#28
1012
+ def initialized?; end
1013
+
1014
+ # Clean up translations hash and set initialized to false on reload!
1015
+ #
1016
+ # source://i18n//lib/i18n/backend/simple.rb#58
1017
+ def reload!; end
1018
+
1019
+ # Stores translations for the given locale in memory.
1020
+ # This uses a deep merge for the translations hash, so existing
1021
+ # translations will be overwritten by new ones only at the deepest
1022
+ # level of the hash.
1023
+ #
1024
+ # source://i18n//lib/i18n/backend/simple.rb#36
1025
+ def store_translations(locale, data, options = T.unsafe(nil)); end
1026
+
1027
+ # source://i18n//lib/i18n/backend/simple.rb#69
1028
+ def translations(do_init: T.unsafe(nil)); end
1029
+
1030
+ protected
1031
+
1032
+ # source://i18n//lib/i18n/backend/simple.rb#83
1033
+ def init_translations; end
1034
+
1035
+ # Looks up a translation from the translations hash. Returns nil if
1036
+ # either key is nil, or locale, scope or key do not exist as a key in the
1037
+ # nested translations hash. Splits keys or scopes containing dots
1038
+ # into multiple keys, i.e. <tt>currency.format</tt> is regarded the same as
1039
+ # <tt>%w(currency format)</tt>.
1040
+ #
1041
+ # source://i18n//lib/i18n/backend/simple.rb#93
1042
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
1043
+ end
1044
+
1045
+ # Mutex to ensure that concurrent translations loading will be thread-safe
1046
+ #
1047
+ # source://i18n//lib/i18n/backend/simple.rb#26
1048
+ I18n::Backend::Simple::Implementation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
1049
+
1050
+ # source://i18n//lib/i18n/backend/transliterator.rb#6
1051
+ module I18n::Backend::Transliterator
1052
+ # Given a locale and a UTF-8 string, return the locale's ASCII
1053
+ # approximation for the string.
1054
+ #
1055
+ # source://i18n//lib/i18n/backend/transliterator.rb#11
1056
+ def transliterate(locale, string, replacement = T.unsafe(nil)); end
1057
+
1058
+ class << self
1059
+ # Get a transliterator instance.
1060
+ #
1061
+ # source://i18n//lib/i18n/backend/transliterator.rb#19
1062
+ def get(rule = T.unsafe(nil)); end
1063
+ end
1064
+ end
1065
+
1066
+ # source://i18n//lib/i18n/backend/transliterator.rb#7
1067
+ I18n::Backend::Transliterator::DEFAULT_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String)
1068
+
1069
+ # A transliterator which accepts a Hash of characters as its translation
1070
+ # rule.
1071
+ #
1072
+ # source://i18n//lib/i18n/backend/transliterator.rb#42
1073
+ class I18n::Backend::Transliterator::HashTransliterator
1074
+ # @return [HashTransliterator] a new instance of HashTransliterator
1075
+ #
1076
+ # source://i18n//lib/i18n/backend/transliterator.rb#74
1077
+ def initialize(rule = T.unsafe(nil)); end
1078
+
1079
+ # source://i18n//lib/i18n/backend/transliterator.rb#80
1080
+ def transliterate(string, replacement = T.unsafe(nil)); end
1081
+
1082
+ private
1083
+
1084
+ # Add transliteration rules to the approximations hash.
1085
+ #
1086
+ # source://i18n//lib/i18n/backend/transliterator.rb#100
1087
+ def add(hash); end
1088
+
1089
+ # source://i18n//lib/i18n/backend/transliterator.rb#93
1090
+ def add_default_approximations; end
1091
+
1092
+ # source://i18n//lib/i18n/backend/transliterator.rb#89
1093
+ def approximations; end
1094
+ end
1095
+
1096
+ # source://i18n//lib/i18n/backend/transliterator.rb#43
1097
+ I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS = T.let(T.unsafe(nil), Hash)
1098
+
1099
+ # A transliterator which accepts a Proc as its transliteration rule.
1100
+ #
1101
+ # source://i18n//lib/i18n/backend/transliterator.rb#30
1102
+ class I18n::Backend::Transliterator::ProcTransliterator
1103
+ # @return [ProcTransliterator] a new instance of ProcTransliterator
1104
+ #
1105
+ # source://i18n//lib/i18n/backend/transliterator.rb#31
1106
+ def initialize(rule); end
1107
+
1108
+ # source://i18n//lib/i18n/backend/transliterator.rb#35
1109
+ def transliterate(string, replacement = T.unsafe(nil)); end
1110
+ end
1111
+
1112
+ # source://i18n//lib/i18n.rb#55
1113
+ module I18n::Base
1114
+ # source://i18n//lib/i18n.rb#70
1115
+ def available_locales; end
1116
+
1117
+ # source://i18n//lib/i18n.rb#74
1118
+ def available_locales=(value); end
1119
+
1120
+ # @return [Boolean]
1121
+ #
1122
+ # source://i18n//lib/i18n.rb#386
1123
+ def available_locales_initialized?; end
1124
+
1125
+ # source://i18n//lib/i18n.rb#70
1126
+ def backend; end
1127
+
1128
+ # source://i18n//lib/i18n.rb#74
1129
+ def backend=(value); end
1130
+
1131
+ # Gets I18n configuration object.
1132
+ #
1133
+ # source://i18n//lib/i18n.rb#57
1134
+ def config; end
1135
+
1136
+ # Sets I18n configuration object.
1137
+ #
1138
+ # source://i18n//lib/i18n.rb#62
1139
+ def config=(value); end
1140
+
1141
+ # source://i18n//lib/i18n.rb#70
1142
+ def default_locale; end
1143
+
1144
+ # source://i18n//lib/i18n.rb#74
1145
+ def default_locale=(value); end
1146
+
1147
+ # source://i18n//lib/i18n.rb#70
1148
+ def default_separator; end
1149
+
1150
+ # source://i18n//lib/i18n.rb#74
1151
+ def default_separator=(value); end
1152
+
1153
+ # Tells the backend to load translations now. Used in situations like the
1154
+ # Rails production environment. Backends can implement whatever strategy
1155
+ # is useful.
1156
+ #
1157
+ # source://i18n//lib/i18n.rb#91
1158
+ def eager_load!; end
1159
+
1160
+ # source://i18n//lib/i18n.rb#70
1161
+ def enforce_available_locales; end
1162
+
1163
+ # Raises an InvalidLocale exception when the passed locale is not available.
1164
+ #
1165
+ # source://i18n//lib/i18n.rb#380
1166
+ def enforce_available_locales!(locale); end
1167
+
1168
+ # source://i18n//lib/i18n.rb#74
1169
+ def enforce_available_locales=(value); end
1170
+
1171
+ # source://i18n//lib/i18n.rb#70
1172
+ def exception_handler; end
1173
+
1174
+ # source://i18n//lib/i18n.rb#74
1175
+ def exception_handler=(value); end
1176
+
1177
+ # Returns true if a translation exists for a given key, otherwise returns false.
1178
+ #
1179
+ # @raise [Disabled]
1180
+ # @return [Boolean]
1181
+ #
1182
+ # source://i18n//lib/i18n.rb#265
1183
+ def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end
1184
+
1185
+ # Returns an array of interpolation keys for the given translation key
1186
+ #
1187
+ # *Examples*
1188
+ #
1189
+ # Suppose we have the following:
1190
+ # I18n.t 'example.zero' == 'Zero interpolations'
1191
+ # I18n.t 'example.one' == 'One interpolation %{foo}'
1192
+ # I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}'
1193
+ # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}']
1194
+ # I18n.t 'example.one', locale: :other == 'One interpolation %{baz}'
1195
+ #
1196
+ # Then we can expect the following results:
1197
+ # I18n.interpolation_keys('example.zero') #=> []
1198
+ # I18n.interpolation_keys('example.one') #=> ['foo']
1199
+ # I18n.interpolation_keys('example.two') #=> ['foo', 'bar']
1200
+ # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz']
1201
+ # I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz']
1202
+ # I18n.interpolation_keys('does-not-exist') #=> []
1203
+ # I18n.interpolation_keys('example') #=> []
1204
+ #
1205
+ # @raise [I18n::ArgumentError]
1206
+ #
1207
+ # source://i18n//lib/i18n.rb#254
1208
+ def interpolation_keys(key, **options); end
1209
+
1210
+ # Localizes certain objects, such as dates and numbers to local formatting.
1211
+ #
1212
+ # @raise [Disabled]
1213
+ #
1214
+ # source://i18n//lib/i18n.rb#335
1215
+ def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
1216
+
1217
+ # source://i18n//lib/i18n.rb#70
1218
+ def load_path; end
1219
+
1220
+ # source://i18n//lib/i18n.rb#74
1221
+ def load_path=(value); end
1222
+
1223
+ # source://i18n//lib/i18n.rb#70
1224
+ def locale; end
1225
+
1226
+ # source://i18n//lib/i18n.rb#74
1227
+ def locale=(value); end
1228
+
1229
+ # Returns true when the passed locale, which can be either a String or a
1230
+ # Symbol, is in the list of available locales. Returns false otherwise.
1231
+ #
1232
+ # @return [Boolean]
1233
+ #
1234
+ # source://i18n//lib/i18n.rb#375
1235
+ def locale_available?(locale); end
1236
+
1237
+ # Localizes certain objects, such as dates and numbers to local formatting.
1238
+ #
1239
+ # @raise [Disabled]
1240
+ #
1241
+ # source://i18n//lib/i18n.rb#335
1242
+ def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
1243
+
1244
+ # Merges the given locale, key and scope into a single array of keys.
1245
+ # Splits keys that contain dots into multiple keys. Makes sure all
1246
+ # keys are Symbols.
1247
+ #
1248
+ # source://i18n//lib/i18n.rb#363
1249
+ def normalize_keys(locale, key, scope, separator = T.unsafe(nil)); end
1250
+
1251
+ # Tells the backend to reload translations. Used in situations like the
1252
+ # Rails development environment. Backends can implement whatever strategy
1253
+ # is useful.
1254
+ #
1255
+ # source://i18n//lib/i18n.rb#83
1256
+ def reload!; end
1257
+
1258
+ # Translates, pluralizes and interpolates a given key using a given locale,
1259
+ # scope, and default, as well as interpolation values.
1260
+ #
1261
+ # *LOOKUP*
1262
+ #
1263
+ # Translation data is organized as a nested hash using the upper-level keys
1264
+ # as namespaces. <em>E.g.</em>, ActionView ships with the translation:
1265
+ # <tt>:date => {:formats => {:short => "%b %d"}}</tt>.
1266
+ #
1267
+ # Translations can be looked up at any level of this hash using the key argument
1268
+ # and the scope option. <em>E.g.</em>, in this example <tt>I18n.t :date</tt>
1269
+ # returns the whole translations hash <tt>{:formats => {:short => "%b %d"}}</tt>.
1270
+ #
1271
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
1272
+ # work). <em>E.g.</em>, the short format can be looked up using both:
1273
+ # I18n.t 'date.formats.short'
1274
+ # I18n.t :'date.formats.short'
1275
+ #
1276
+ # Scope can be either a single key, a dot-separated key or an array of keys
1277
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
1278
+ # examples will all look up the same short date format:
1279
+ # I18n.t 'date.formats.short'
1280
+ # I18n.t 'formats.short', :scope => 'date'
1281
+ # I18n.t 'short', :scope => 'date.formats'
1282
+ # I18n.t 'short', :scope => %w(date formats)
1283
+ #
1284
+ # *INTERPOLATION*
1285
+ #
1286
+ # Translations can contain interpolation variables which will be replaced by
1287
+ # values passed to #translate as part of the options hash, with the keys matching
1288
+ # the interpolation variable names.
1289
+ #
1290
+ # <em>E.g.</em>, with a translation <tt>:foo => "foo %{bar}"</tt> the option
1291
+ # value for the key +bar+ will be interpolated into the translation:
1292
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
1293
+ #
1294
+ # *PLURALIZATION*
1295
+ #
1296
+ # Translation data can contain pluralized translations. Pluralized translations
1297
+ # are arrays of singular/plural versions of translations like <tt>['Foo', 'Foos']</tt>.
1298
+ #
1299
+ # Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English
1300
+ # pluralization rules. Other algorithms can be supported by custom backends.
1301
+ #
1302
+ # This returns the singular version of a pluralized translation:
1303
+ # I18n.t :foo, :count => 1 # => 'Foo'
1304
+ #
1305
+ # These both return the plural version of a pluralized translation:
1306
+ # I18n.t :foo, :count => 0 # => 'Foos'
1307
+ # I18n.t :foo, :count => 2 # => 'Foos'
1308
+ #
1309
+ # The <tt>:count</tt> option can be used both for pluralization and interpolation.
1310
+ # <em>E.g.</em>, with the translation
1311
+ # <tt>:foo => ['%{count} foo', '%{count} foos']</tt>, count will
1312
+ # be interpolated to the pluralized translation:
1313
+ # I18n.t :foo, :count => 1 # => '1 foo'
1314
+ #
1315
+ # *DEFAULTS*
1316
+ #
1317
+ # This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no translation was found:
1318
+ # I18n.t :foo, :default => 'default'
1319
+ #
1320
+ # This returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> if no
1321
+ # translation for <tt>:foo</tt> was found:
1322
+ # I18n.t :foo, :default => :bar
1323
+ #
1324
+ # Returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt>
1325
+ # or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found.
1326
+ # I18n.t :foo, :default => [:bar, 'default']
1327
+ #
1328
+ # <b>BULK LOOKUP</b>
1329
+ #
1330
+ # This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>.
1331
+ # I18n.t [:foo, :bar]
1332
+ #
1333
+ # Can be used with dot-separated nested keys:
1334
+ # I18n.t [:'baz.foo', :'baz.bar']
1335
+ #
1336
+ # Which is the same as using a scope option:
1337
+ # I18n.t [:foo, :bar], :scope => :baz
1338
+ #
1339
+ # *LAMBDAS*
1340
+ #
1341
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
1342
+ # called and passed the key and options.
1343
+ #
1344
+ # E.g. assuming the key <tt>:salutation</tt> resolves to:
1345
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
1346
+ #
1347
+ # Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith')</tt> will result in "Mrs. Smith".
1348
+ #
1349
+ # Note that the string returned by lambda will go through string interpolation too,
1350
+ # so the following lambda would give the same result:
1351
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
1352
+ #
1353
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
1354
+ # a cache layer is put in front of I18n.translate it will generate a cache key
1355
+ # from the argument values passed to #translate. Therefore your lambdas should
1356
+ # always return the same translations/values per unique combination of argument
1357
+ # values.
1358
+ #
1359
+ # <b>Ruby 2.7+ keyword arguments warning</b>
1360
+ #
1361
+ # This method uses keyword arguments.
1362
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
1363
+ # The "hash" parameter must be passed as keyword argument.
1364
+ #
1365
+ # Good:
1366
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
1367
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
1368
+ # I18n.t(:salutation, **any_hash)
1369
+ #
1370
+ # Bad:
1371
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
1372
+ # I18n.t(:salutation, any_hash)
1373
+ #
1374
+ # @raise [Disabled]
1375
+ #
1376
+ # source://i18n//lib/i18n.rb#211
1377
+ def t(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
1378
+
1379
+ # Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
1380
+ # this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
1381
+ #
1382
+ # source://i18n//lib/i18n.rb#230
1383
+ def t!(key, **options); end
1384
+
1385
+ # Translates, pluralizes and interpolates a given key using a given locale,
1386
+ # scope, and default, as well as interpolation values.
1387
+ #
1388
+ # *LOOKUP*
1389
+ #
1390
+ # Translation data is organized as a nested hash using the upper-level keys
1391
+ # as namespaces. <em>E.g.</em>, ActionView ships with the translation:
1392
+ # <tt>:date => {:formats => {:short => "%b %d"}}</tt>.
1393
+ #
1394
+ # Translations can be looked up at any level of this hash using the key argument
1395
+ # and the scope option. <em>E.g.</em>, in this example <tt>I18n.t :date</tt>
1396
+ # returns the whole translations hash <tt>{:formats => {:short => "%b %d"}}</tt>.
1397
+ #
1398
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
1399
+ # work). <em>E.g.</em>, the short format can be looked up using both:
1400
+ # I18n.t 'date.formats.short'
1401
+ # I18n.t :'date.formats.short'
1402
+ #
1403
+ # Scope can be either a single key, a dot-separated key or an array of keys
1404
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
1405
+ # examples will all look up the same short date format:
1406
+ # I18n.t 'date.formats.short'
1407
+ # I18n.t 'formats.short', :scope => 'date'
1408
+ # I18n.t 'short', :scope => 'date.formats'
1409
+ # I18n.t 'short', :scope => %w(date formats)
1410
+ #
1411
+ # *INTERPOLATION*
1412
+ #
1413
+ # Translations can contain interpolation variables which will be replaced by
1414
+ # values passed to #translate as part of the options hash, with the keys matching
1415
+ # the interpolation variable names.
1416
+ #
1417
+ # <em>E.g.</em>, with a translation <tt>:foo => "foo %{bar}"</tt> the option
1418
+ # value for the key +bar+ will be interpolated into the translation:
1419
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
1420
+ #
1421
+ # *PLURALIZATION*
1422
+ #
1423
+ # Translation data can contain pluralized translations. Pluralized translations
1424
+ # are arrays of singular/plural versions of translations like <tt>['Foo', 'Foos']</tt>.
1425
+ #
1426
+ # Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English
1427
+ # pluralization rules. Other algorithms can be supported by custom backends.
1428
+ #
1429
+ # This returns the singular version of a pluralized translation:
1430
+ # I18n.t :foo, :count => 1 # => 'Foo'
1431
+ #
1432
+ # These both return the plural version of a pluralized translation:
1433
+ # I18n.t :foo, :count => 0 # => 'Foos'
1434
+ # I18n.t :foo, :count => 2 # => 'Foos'
1435
+ #
1436
+ # The <tt>:count</tt> option can be used both for pluralization and interpolation.
1437
+ # <em>E.g.</em>, with the translation
1438
+ # <tt>:foo => ['%{count} foo', '%{count} foos']</tt>, count will
1439
+ # be interpolated to the pluralized translation:
1440
+ # I18n.t :foo, :count => 1 # => '1 foo'
1441
+ #
1442
+ # *DEFAULTS*
1443
+ #
1444
+ # This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no translation was found:
1445
+ # I18n.t :foo, :default => 'default'
1446
+ #
1447
+ # This returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> if no
1448
+ # translation for <tt>:foo</tt> was found:
1449
+ # I18n.t :foo, :default => :bar
1450
+ #
1451
+ # Returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt>
1452
+ # or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found.
1453
+ # I18n.t :foo, :default => [:bar, 'default']
1454
+ #
1455
+ # <b>BULK LOOKUP</b>
1456
+ #
1457
+ # This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>.
1458
+ # I18n.t [:foo, :bar]
1459
+ #
1460
+ # Can be used with dot-separated nested keys:
1461
+ # I18n.t [:'baz.foo', :'baz.bar']
1462
+ #
1463
+ # Which is the same as using a scope option:
1464
+ # I18n.t [:foo, :bar], :scope => :baz
1465
+ #
1466
+ # *LAMBDAS*
1467
+ #
1468
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
1469
+ # called and passed the key and options.
1470
+ #
1471
+ # E.g. assuming the key <tt>:salutation</tt> resolves to:
1472
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
1473
+ #
1474
+ # Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith')</tt> will result in "Mrs. Smith".
1475
+ #
1476
+ # Note that the string returned by lambda will go through string interpolation too,
1477
+ # so the following lambda would give the same result:
1478
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
1479
+ #
1480
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
1481
+ # a cache layer is put in front of I18n.translate it will generate a cache key
1482
+ # from the argument values passed to #translate. Therefore your lambdas should
1483
+ # always return the same translations/values per unique combination of argument
1484
+ # values.
1485
+ #
1486
+ # <b>Ruby 2.7+ keyword arguments warning</b>
1487
+ #
1488
+ # This method uses keyword arguments.
1489
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
1490
+ # The "hash" parameter must be passed as keyword argument.
1491
+ #
1492
+ # Good:
1493
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
1494
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
1495
+ # I18n.t(:salutation, **any_hash)
1496
+ #
1497
+ # Bad:
1498
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
1499
+ # I18n.t(:salutation, any_hash)
1500
+ #
1501
+ # @raise [Disabled]
1502
+ #
1503
+ # source://i18n//lib/i18n.rb#211
1504
+ def translate(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
1505
+
1506
+ # Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
1507
+ # this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
1508
+ #
1509
+ # source://i18n//lib/i18n.rb#230
1510
+ def translate!(key, **options); end
1511
+
1512
+ # Transliterates UTF-8 characters to ASCII. By default this method will
1513
+ # transliterate only Latin strings to an ASCII approximation:
1514
+ #
1515
+ # I18n.transliterate("Ærøskøbing")
1516
+ # # => "AEroskobing"
1517
+ #
1518
+ # I18n.transliterate("日本語")
1519
+ # # => "???"
1520
+ #
1521
+ # It's also possible to add support for per-locale transliterations. I18n
1522
+ # expects transliteration rules to be stored at
1523
+ # <tt>i18n.transliterate.rule</tt>.
1524
+ #
1525
+ # Transliteration rules can either be a Hash or a Proc. Procs must accept a
1526
+ # single string argument. Hash rules inherit the default transliteration
1527
+ # rules, while Procs do not.
1528
+ #
1529
+ # *Examples*
1530
+ #
1531
+ # Setting a Hash in <locale>.yml:
1532
+ #
1533
+ # i18n:
1534
+ # transliterate:
1535
+ # rule:
1536
+ # ü: "ue"
1537
+ # ö: "oe"
1538
+ #
1539
+ # Setting a Hash using Ruby:
1540
+ #
1541
+ # store_translations(:de, i18n: {
1542
+ # transliterate: {
1543
+ # rule: {
1544
+ # 'ü' => 'ue',
1545
+ # 'ö' => 'oe'
1546
+ # }
1547
+ # }
1548
+ # })
1549
+ #
1550
+ # Setting a Proc:
1551
+ #
1552
+ # translit = lambda {|string| MyTransliterator.transliterate(string) }
1553
+ # store_translations(:xx, :i18n => {:transliterate => {:rule => translit})
1554
+ #
1555
+ # Transliterating strings:
1556
+ #
1557
+ # I18n.locale = :en
1558
+ # I18n.transliterate("Jürgen") # => "Jurgen"
1559
+ # I18n.locale = :de
1560
+ # I18n.transliterate("Jürgen") # => "Juergen"
1561
+ # I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen"
1562
+ # I18n.transliterate("Jürgen", :locale => :de) # => "Juergen"
1563
+ #
1564
+ # source://i18n//lib/i18n.rb#324
1565
+ def transliterate(key, throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), replacement: T.unsafe(nil), **options); end
1566
+
1567
+ # Executes block with given I18n.locale set.
1568
+ #
1569
+ # source://i18n//lib/i18n.rb#346
1570
+ def with_locale(tmp_locale = T.unsafe(nil)); end
1571
+
1572
+ private
1573
+
1574
+ # Any exceptions thrown in translate will be sent to the @@exception_handler
1575
+ # which can be a Symbol, a Proc or any other Object unless they're forced to
1576
+ # be raised or thrown (MissingTranslation).
1577
+ #
1578
+ # If exception_handler is a Symbol then it will simply be sent to I18n as
1579
+ # a method call. A Proc will simply be called. In any other case the
1580
+ # method #call will be called on the exception_handler object.
1581
+ #
1582
+ # Examples:
1583
+ #
1584
+ # I18n.exception_handler = :custom_exception_handler # this is the default
1585
+ # I18n.custom_exception_handler(exception, locale, key, options) # will be called like this
1586
+ #
1587
+ # I18n.exception_handler = lambda { |*args| ... } # a lambda
1588
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
1589
+ #
1590
+ # I18n.exception_handler = I18nExceptionHandler.new # an object
1591
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
1592
+ #
1593
+ # source://i18n//lib/i18n.rb#422
1594
+ def handle_exception(handling, exception, locale, key, options); end
1595
+
1596
+ # source://i18n//lib/i18n.rb#464
1597
+ def interpolation_keys_from_translation(translation); end
1598
+
1599
+ # source://i18n//lib/i18n.rb#440
1600
+ def normalize_key(key, separator); end
1601
+
1602
+ # source://i18n//lib/i18n.rb#392
1603
+ def translate_key(key, throw, raise, locale, backend, options); end
1604
+ end
1605
+
1606
+ # source://i18n//lib/i18n/config.rb#6
1607
+ class I18n::Config
1608
+ # Returns an array of locales for which translations are available.
1609
+ # Unless you explicitly set these through I18n.available_locales=
1610
+ # the call will be delegated to the backend.
1611
+ #
1612
+ # source://i18n//lib/i18n/config.rb#43
1613
+ def available_locales; end
1614
+
1615
+ # Sets the available locales.
1616
+ #
1617
+ # source://i18n//lib/i18n/config.rb#57
1618
+ def available_locales=(locales); end
1619
+
1620
+ # Returns true if the available_locales have been initialized
1621
+ #
1622
+ # @return [Boolean]
1623
+ #
1624
+ # source://i18n//lib/i18n/config.rb#64
1625
+ def available_locales_initialized?; end
1626
+
1627
+ # Caches the available locales list as both strings and symbols in a Set, so
1628
+ # that we can have faster lookups to do the available locales enforce check.
1629
+ #
1630
+ # source://i18n//lib/i18n/config.rb#50
1631
+ def available_locales_set; end
1632
+
1633
+ # Returns the current backend. Defaults to +Backend::Simple+.
1634
+ #
1635
+ # source://i18n//lib/i18n/config.rb#20
1636
+ def backend; end
1637
+
1638
+ # Sets the current backend. Used to set a custom backend.
1639
+ #
1640
+ # source://i18n//lib/i18n/config.rb#25
1641
+ def backend=(backend); end
1642
+
1643
+ # Clears the available locales set so it can be recomputed again after I18n
1644
+ # gets reloaded.
1645
+ #
1646
+ # source://i18n//lib/i18n/config.rb#70
1647
+ def clear_available_locales_set; end
1648
+
1649
+ # Returns the current default locale. Defaults to :'en'
1650
+ #
1651
+ # source://i18n//lib/i18n/config.rb#30
1652
+ def default_locale; end
1653
+
1654
+ # Sets the current default locale. Used to set a custom default locale.
1655
+ #
1656
+ # source://i18n//lib/i18n/config.rb#35
1657
+ def default_locale=(locale); end
1658
+
1659
+ # Returns the current default scope separator. Defaults to '.'
1660
+ #
1661
+ # source://i18n//lib/i18n/config.rb#75
1662
+ def default_separator; end
1663
+
1664
+ # Sets the current default scope separator.
1665
+ #
1666
+ # source://i18n//lib/i18n/config.rb#80
1667
+ def default_separator=(separator); end
1668
+
1669
+ # source://i18n//lib/i18n/config.rb#141
1670
+ def enforce_available_locales; end
1671
+
1672
+ # source://i18n//lib/i18n/config.rb#145
1673
+ def enforce_available_locales=(enforce_available_locales); end
1674
+
1675
+ # Returns the current exception handler. Defaults to an instance of
1676
+ # I18n::ExceptionHandler.
1677
+ #
1678
+ # source://i18n//lib/i18n/config.rb#86
1679
+ def exception_handler; end
1680
+
1681
+ # Sets the exception handler.
1682
+ #
1683
+ # source://i18n//lib/i18n/config.rb#91
1684
+ def exception_handler=(exception_handler); end
1685
+
1686
+ # Returns the current interpolation patterns. Defaults to
1687
+ # I18n::DEFAULT_INTERPOLATION_PATTERNS.
1688
+ #
1689
+ # source://i18n//lib/i18n/config.rb#151
1690
+ def interpolation_patterns; end
1691
+
1692
+ # Sets the current interpolation patterns. Used to set a interpolation
1693
+ # patterns.
1694
+ #
1695
+ # E.g. using {{}} as a placeholder like "{{hello}}, world!":
1696
+ #
1697
+ # I18n.config.interpolation_patterns << /\{\{(\w+)\}\}/
1698
+ #
1699
+ # source://i18n//lib/i18n/config.rb#161
1700
+ def interpolation_patterns=(interpolation_patterns); end
1701
+
1702
+ # Allow clients to register paths providing translation data sources. The
1703
+ # backend defines acceptable sources.
1704
+ #
1705
+ # E.g. the provided SimpleBackend accepts a list of paths to translation
1706
+ # files which are either named *.rb and contain plain Ruby Hashes or are
1707
+ # named *.yml and contain YAML data. So for the SimpleBackend clients may
1708
+ # register translation files like this:
1709
+ # I18n.load_path << 'path/to/locale/en.yml'
1710
+ #
1711
+ # source://i18n//lib/i18n/config.rb#126
1712
+ def load_path; end
1713
+
1714
+ # Sets the load path instance. Custom implementations are expected to
1715
+ # behave like a Ruby Array.
1716
+ #
1717
+ # source://i18n//lib/i18n/config.rb#132
1718
+ def load_path=(load_path); end
1719
+
1720
+ # The only configuration value that is not global and scoped to thread is :locale.
1721
+ # It defaults to the default_locale.
1722
+ #
1723
+ # source://i18n//lib/i18n/config.rb#9
1724
+ def locale; end
1725
+
1726
+ # Sets the current locale pseudo-globally, i.e. in the Thread.current hash.
1727
+ #
1728
+ # source://i18n//lib/i18n/config.rb#14
1729
+ def locale=(locale); end
1730
+
1731
+ # Returns the current handler for situations when interpolation argument
1732
+ # is missing. MissingInterpolationArgument will be raised by default.
1733
+ #
1734
+ # source://i18n//lib/i18n/config.rb#97
1735
+ def missing_interpolation_argument_handler; end
1736
+
1737
+ # Sets the missing interpolation argument handler. It can be any
1738
+ # object that responds to #call. The arguments that will be passed to #call
1739
+ # are the same as for MissingInterpolationArgument initializer. Use +Proc.new+
1740
+ # if you don't care about arity.
1741
+ #
1742
+ # == Example:
1743
+ # You can suppress raising an exception and return string instead:
1744
+ #
1745
+ # I18n.config.missing_interpolation_argument_handler = Proc.new do |key|
1746
+ # "#{key} is missing"
1747
+ # end
1748
+ #
1749
+ # source://i18n//lib/i18n/config.rb#114
1750
+ def missing_interpolation_argument_handler=(exception_handler); end
1751
+ end
1752
+
1753
+ # source://i18n//lib/i18n/interpolate/ruby.rb#7
1754
+ I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array)
1755
+
1756
+ # source://i18n//lib/i18n/exceptions.rb#18
1757
+ class I18n::Disabled < ::I18n::ArgumentError
1758
+ # @return [Disabled] a new instance of Disabled
1759
+ #
1760
+ # source://i18n//lib/i18n/exceptions.rb#19
1761
+ def initialize(method); end
1762
+ end
1763
+
1764
+ # source://i18n//lib/i18n.rb#36
1765
+ I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash)
1766
+
1767
+ # source://i18n//lib/i18n/exceptions.rb#6
1768
+ class I18n::ExceptionHandler
1769
+ # source://i18n//lib/i18n/exceptions.rb#7
1770
+ def call(exception, _locale, _key, _options); end
1771
+ end
1772
+
1773
+ # source://i18n//lib/i18n/gettext.rb#4
1774
+ module I18n::Gettext
1775
+ class << self
1776
+ # source://i18n//lib/i18n/gettext.rb#21
1777
+ def extract_scope(msgid, separator); end
1778
+
1779
+ # returns an array of plural keys for the given locale or the whole hash
1780
+ # of locale mappings to plural keys so that we can convert from gettext's
1781
+ # integer-index based style
1782
+ # TODO move this information to the pluralization module
1783
+ #
1784
+ # source://i18n//lib/i18n/gettext.rb#17
1785
+ def plural_keys(*args); end
1786
+ end
1787
+ end
1788
+
1789
+ # source://i18n//lib/i18n/gettext.rb#6
1790
+ I18n::Gettext::CONTEXT_SEPARATOR = T.let(T.unsafe(nil), String)
1791
+
1792
+ # Implements classical Gettext style accessors. To use this include the
1793
+ # module to the global namespace or wherever you want to use it.
1794
+ #
1795
+ # include I18n::Gettext::Helpers
1796
+ #
1797
+ # source://i18n//lib/i18n/gettext/helpers.rb#11
1798
+ module I18n::Gettext::Helpers
1799
+ # Makes dynamic translation messages readable for the gettext parser.
1800
+ # <tt>_(fruit)</tt> cannot be understood by the gettext parser. To help the parser find all your translations,
1801
+ # you can add <tt>fruit = N_("Apple")</tt> which does not translate, but tells the parser: "Apple" needs translation.
1802
+ # * msgid: the message id.
1803
+ # * Returns: msgid.
1804
+ #
1805
+ # source://i18n//lib/i18n/gettext/helpers.rb#17
1806
+ def N_(msgsid); end
1807
+
1808
+ # source://i18n//lib/i18n/gettext/helpers.rb#21
1809
+ def _(msgid, options = T.unsafe(nil)); end
1810
+
1811
+ # source://i18n//lib/i18n/gettext/helpers.rb#21
1812
+ def gettext(msgid, options = T.unsafe(nil)); end
1813
+
1814
+ # source://i18n//lib/i18n/gettext/helpers.rb#38
1815
+ def n_(msgid, msgid_plural, n = T.unsafe(nil)); end
1816
+
1817
+ # source://i18n//lib/i18n/gettext/helpers.rb#38
1818
+ def ngettext(msgid, msgid_plural, n = T.unsafe(nil)); end
1819
+
1820
+ # Method signatures:
1821
+ # npgettext('Fruits', 'apple', 'apples', 2)
1822
+ # npgettext('Fruits', ['apple', 'apples'], 2)
1823
+ #
1824
+ # source://i18n//lib/i18n/gettext/helpers.rb#61
1825
+ def np_(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
1826
+
1827
+ # Method signatures:
1828
+ # npgettext('Fruits', 'apple', 'apples', 2)
1829
+ # npgettext('Fruits', ['apple', 'apples'], 2)
1830
+ #
1831
+ # source://i18n//lib/i18n/gettext/helpers.rb#61
1832
+ def npgettext(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
1833
+
1834
+ # Method signatures:
1835
+ # nsgettext('Fruits|apple', 'apples', 2)
1836
+ # nsgettext(['Fruits|apple', 'apples'], 2)
1837
+ #
1838
+ # source://i18n//lib/i18n/gettext/helpers.rb#46
1839
+ def ns_(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
1840
+
1841
+ # Method signatures:
1842
+ # nsgettext('Fruits|apple', 'apples', 2)
1843
+ # nsgettext(['Fruits|apple', 'apples'], 2)
1844
+ #
1845
+ # source://i18n//lib/i18n/gettext/helpers.rb#46
1846
+ def nsgettext(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
1847
+
1848
+ # source://i18n//lib/i18n/gettext/helpers.rb#32
1849
+ def p_(msgctxt, msgid); end
1850
+
1851
+ # source://i18n//lib/i18n/gettext/helpers.rb#32
1852
+ def pgettext(msgctxt, msgid); end
1853
+
1854
+ # source://i18n//lib/i18n/gettext/helpers.rb#26
1855
+ def s_(msgid, separator = T.unsafe(nil)); end
1856
+
1857
+ # source://i18n//lib/i18n/gettext/helpers.rb#26
1858
+ def sgettext(msgid, separator = T.unsafe(nil)); end
1859
+ end
1860
+
1861
+ # source://i18n//lib/i18n/gettext.rb#5
1862
+ I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String)
1863
+
1864
+ # source://i18n//lib/i18n/interpolate/ruby.rb#12
1865
+ I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp)
1866
+
1867
+ # source://i18n//lib/i18n/interpolate/ruby.rb#15
1868
+ I18n::INTERPOLATION_PATTERNS_CACHE = T.let(T.unsafe(nil), Hash)
1869
+
1870
+ # source://i18n//lib/i18n/exceptions.rb#134
1871
+ class I18n::InvalidFilenames < ::I18n::ArgumentError
1872
+ # @return [InvalidFilenames] a new instance of InvalidFilenames
1873
+ #
1874
+ # source://i18n//lib/i18n/exceptions.rb#136
1875
+ def initialize(file_errors); end
1876
+ end
1877
+
1878
+ # source://i18n//lib/i18n/exceptions.rb#135
1879
+ I18n::InvalidFilenames::NUMBER_OF_ERRORS_SHOWN = T.let(T.unsafe(nil), Integer)
1880
+
1881
+ # source://i18n//lib/i18n/exceptions.rb#32
1882
+ class I18n::InvalidLocale < ::I18n::ArgumentError
1883
+ # @return [InvalidLocale] a new instance of InvalidLocale
1884
+ #
1885
+ # source://i18n//lib/i18n/exceptions.rb#34
1886
+ def initialize(locale); end
1887
+
1888
+ # Returns the value of attribute locale.
1889
+ #
1890
+ # source://i18n//lib/i18n/exceptions.rb#33
1891
+ def locale; end
1892
+ end
1893
+
1894
+ # source://i18n//lib/i18n/exceptions.rb#40
1895
+ class I18n::InvalidLocaleData < ::I18n::ArgumentError
1896
+ # @return [InvalidLocaleData] a new instance of InvalidLocaleData
1897
+ #
1898
+ # source://i18n//lib/i18n/exceptions.rb#42
1899
+ def initialize(filename, exception_message); end
1900
+
1901
+ # Returns the value of attribute filename.
1902
+ #
1903
+ # source://i18n//lib/i18n/exceptions.rb#41
1904
+ def filename; end
1905
+ end
1906
+
1907
+ # source://i18n//lib/i18n/exceptions.rb#92
1908
+ class I18n::InvalidPluralizationData < ::I18n::ArgumentError
1909
+ # @return [InvalidPluralizationData] a new instance of InvalidPluralizationData
1910
+ #
1911
+ # source://i18n//lib/i18n/exceptions.rb#94
1912
+ def initialize(entry, count, key); end
1913
+
1914
+ # Returns the value of attribute count.
1915
+ #
1916
+ # source://i18n//lib/i18n/exceptions.rb#93
1917
+ def count; end
1918
+
1919
+ # Returns the value of attribute entry.
1920
+ #
1921
+ # source://i18n//lib/i18n/exceptions.rb#93
1922
+ def entry; end
1923
+
1924
+ # Returns the value of attribute key.
1925
+ #
1926
+ # source://i18n//lib/i18n/exceptions.rb#93
1927
+ def key; end
1928
+ end
1929
+
1930
+ # source://i18n//lib/i18n/backend/key_value.rb#21
1931
+ I18n::JSON = ActiveSupport::JSON
1932
+
1933
+ # source://i18n//lib/i18n/locale.rb#4
1934
+ module I18n::Locale; end
1935
+
1936
+ # source://i18n//lib/i18n/locale/fallbacks.rb#48
1937
+ class I18n::Locale::Fallbacks < ::Hash
1938
+ # @return [Fallbacks] a new instance of Fallbacks
1939
+ #
1940
+ # source://i18n//lib/i18n/locale/fallbacks.rb#49
1941
+ def initialize(*mappings); end
1942
+
1943
+ # @raise [InvalidLocale]
1944
+ #
1945
+ # source://i18n//lib/i18n/locale/fallbacks.rb#60
1946
+ def [](locale); end
1947
+
1948
+ # Returns the value of attribute defaults.
1949
+ #
1950
+ # source://i18n//lib/i18n/locale/fallbacks.rb#58
1951
+ def defaults; end
1952
+
1953
+ # source://i18n//lib/i18n/locale/fallbacks.rb#55
1954
+ def defaults=(defaults); end
1955
+
1956
+ # @return [Boolean]
1957
+ #
1958
+ # source://i18n//lib/i18n/locale/fallbacks.rb#82
1959
+ def empty?; end
1960
+
1961
+ # source://i18n//lib/i18n/locale/fallbacks.rb#86
1962
+ def inspect; end
1963
+
1964
+ # source://i18n//lib/i18n/locale/fallbacks.rb#67
1965
+ def map(*args, &block); end
1966
+
1967
+ protected
1968
+
1969
+ # source://i18n//lib/i18n/locale/fallbacks.rb#92
1970
+ def compute(tags, include_defaults = T.unsafe(nil), exclude = T.unsafe(nil)); end
1971
+ end
1972
+
1973
+ # source://i18n//lib/i18n/locale/tag.rb#5
1974
+ module I18n::Locale::Tag
1975
+ class << self
1976
+ # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+.
1977
+ #
1978
+ # source://i18n//lib/i18n/locale/tag.rb#12
1979
+ def implementation; end
1980
+
1981
+ # Sets the current locale tag implementation. Use this to set a different locale tag implementation.
1982
+ #
1983
+ # source://i18n//lib/i18n/locale/tag.rb#17
1984
+ def implementation=(implementation); end
1985
+
1986
+ # Factory method for locale tags. Delegates to the current locale tag implementation.
1987
+ #
1988
+ # source://i18n//lib/i18n/locale/tag.rb#22
1989
+ def tag(tag); end
1990
+ end
1991
+ end
1992
+
1993
+ # source://i18n//lib/i18n/locale/tag/parents.rb#4
1994
+ module I18n::Locale::Tag::Parents
1995
+ # source://i18n//lib/i18n/locale/tag/parents.rb#5
1996
+ def parent; end
1997
+
1998
+ # source://i18n//lib/i18n/locale/tag/parents.rb#18
1999
+ def parents; end
2000
+
2001
+ # source://i18n//lib/i18n/locale/tag/parents.rb#14
2002
+ def self_and_parents; end
2003
+ end
2004
+
2005
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#12
2006
+ I18n::Locale::Tag::RFC4646_FORMATS = T.let(T.unsafe(nil), Hash)
2007
+
2008
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#11
2009
+ I18n::Locale::Tag::RFC4646_SUBTAGS = T.let(T.unsafe(nil), Array)
2010
+
2011
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#14
2012
+ class I18n::Locale::Tag::Rfc4646 < ::Struct
2013
+ include ::I18n::Locale::Tag::Parents
2014
+
2015
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2016
+ def language; end
2017
+
2018
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2019
+ def region; end
2020
+
2021
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2022
+ def script; end
2023
+
2024
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#46
2025
+ def to_a; end
2026
+
2027
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#42
2028
+ def to_s; end
2029
+
2030
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#38
2031
+ def to_sym; end
2032
+
2033
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2034
+ def variant; end
2035
+
2036
+ class << self
2037
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#23
2038
+ def parser; end
2039
+
2040
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#27
2041
+ def parser=(parser); end
2042
+
2043
+ # Parses the given tag and returns a Tag instance if it is valid.
2044
+ # Returns false if the given tag is not valid according to RFC 4646.
2045
+ #
2046
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#18
2047
+ def tag(tag); end
2048
+ end
2049
+ end
2050
+
2051
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#50
2052
+ module I18n::Locale::Tag::Rfc4646::Parser
2053
+ class << self
2054
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#63
2055
+ def match(tag); end
2056
+ end
2057
+ end
2058
+
2059
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#51
2060
+ I18n::Locale::Tag::Rfc4646::Parser::PATTERN = T.let(T.unsafe(nil), Regexp)
2061
+
2062
+ # source://i18n//lib/i18n/locale/tag/simple.rb#6
2063
+ class I18n::Locale::Tag::Simple
2064
+ include ::I18n::Locale::Tag::Parents
2065
+
2066
+ # @return [Simple] a new instance of Simple
2067
+ #
2068
+ # source://i18n//lib/i18n/locale/tag/simple.rb#17
2069
+ def initialize(*tag); end
2070
+
2071
+ # source://i18n//lib/i18n/locale/tag/simple.rb#21
2072
+ def subtags; end
2073
+
2074
+ # Returns the value of attribute tag.
2075
+ #
2076
+ # source://i18n//lib/i18n/locale/tag/simple.rb#15
2077
+ def tag; end
2078
+
2079
+ # source://i18n//lib/i18n/locale/tag/simple.rb#33
2080
+ def to_a; end
2081
+
2082
+ # source://i18n//lib/i18n/locale/tag/simple.rb#29
2083
+ def to_s; end
2084
+
2085
+ # source://i18n//lib/i18n/locale/tag/simple.rb#25
2086
+ def to_sym; end
2087
+
2088
+ class << self
2089
+ # source://i18n//lib/i18n/locale/tag/simple.rb#8
2090
+ def tag(tag); end
2091
+ end
2092
+ end
2093
+
2094
+ # source://i18n//lib/i18n/middleware.rb#4
2095
+ class I18n::Middleware
2096
+ # @return [Middleware] a new instance of Middleware
2097
+ #
2098
+ # source://i18n//lib/i18n/middleware.rb#6
2099
+ def initialize(app); end
2100
+
2101
+ # source://i18n//lib/i18n/middleware.rb#10
2102
+ def call(env); end
2103
+ end
2104
+
2105
+ # source://i18n//lib/i18n/exceptions.rb#100
2106
+ class I18n::MissingInterpolationArgument < ::I18n::ArgumentError
2107
+ # @return [MissingInterpolationArgument] a new instance of MissingInterpolationArgument
2108
+ #
2109
+ # source://i18n//lib/i18n/exceptions.rb#102
2110
+ def initialize(key, values, string); end
2111
+
2112
+ # Returns the value of attribute key.
2113
+ #
2114
+ # source://i18n//lib/i18n/exceptions.rb#101
2115
+ def key; end
2116
+
2117
+ # Returns the value of attribute string.
2118
+ #
2119
+ # source://i18n//lib/i18n/exceptions.rb#101
2120
+ def string; end
2121
+
2122
+ # Returns the value of attribute values.
2123
+ #
2124
+ # source://i18n//lib/i18n/exceptions.rb#101
2125
+ def values; end
2126
+ end
2127
+
2128
+ # source://i18n//lib/i18n/exceptions.rb#48
2129
+ class I18n::MissingTranslation < ::I18n::ArgumentError
2130
+ include ::I18n::MissingTranslation::Base
2131
+ end
2132
+
2133
+ # source://i18n//lib/i18n/exceptions.rb#49
2134
+ module I18n::MissingTranslation::Base
2135
+ # source://i18n//lib/i18n/exceptions.rb#54
2136
+ def initialize(locale, key, options = T.unsafe(nil)); end
2137
+
2138
+ # Returns the value of attribute key.
2139
+ #
2140
+ # source://i18n//lib/i18n/exceptions.rb#52
2141
+ def key; end
2142
+
2143
+ # source://i18n//lib/i18n/exceptions.rb#59
2144
+ def keys; end
2145
+
2146
+ # Returns the value of attribute locale.
2147
+ #
2148
+ # source://i18n//lib/i18n/exceptions.rb#52
2149
+ def locale; end
2150
+
2151
+ # source://i18n//lib/i18n/exceptions.rb#65
2152
+ def message; end
2153
+
2154
+ # source://i18n//lib/i18n/exceptions.rb#74
2155
+ def normalized_option(key); end
2156
+
2157
+ # Returns the value of attribute options.
2158
+ #
2159
+ # source://i18n//lib/i18n/exceptions.rb#52
2160
+ def options; end
2161
+
2162
+ # source://i18n//lib/i18n/exceptions.rb#80
2163
+ def to_exception; end
2164
+
2165
+ # source://i18n//lib/i18n/exceptions.rb#65
2166
+ def to_s; end
2167
+ end
2168
+
2169
+ # source://i18n//lib/i18n/exceptions.rb#50
2170
+ I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array)
2171
+
2172
+ # source://i18n//lib/i18n/exceptions.rb#88
2173
+ class I18n::MissingTranslationData < ::I18n::ArgumentError
2174
+ include ::I18n::MissingTranslation::Base
2175
+ end
2176
+
2177
+ # source://i18n//lib/i18n.rb#19
2178
+ I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array)
2179
+
2180
+ # source://i18n//lib/i18n/exceptions.rb#108
2181
+ class I18n::ReservedInterpolationKey < ::I18n::ArgumentError
2182
+ # @return [ReservedInterpolationKey] a new instance of ReservedInterpolationKey
2183
+ #
2184
+ # source://i18n//lib/i18n/exceptions.rb#110
2185
+ def initialize(key, string); end
2186
+
2187
+ # Returns the value of attribute key.
2188
+ #
2189
+ # source://i18n//lib/i18n/exceptions.rb#109
2190
+ def key; end
2191
+
2192
+ # Returns the value of attribute string.
2193
+ #
2194
+ # source://i18n//lib/i18n/exceptions.rb#109
2195
+ def string; end
2196
+ end
2197
+
2198
+ # source://i18n//lib/i18n/tests.rb#4
2199
+ module I18n::Tests; end
2200
+
2201
+ # source://i18n//lib/i18n/tests/localization.rb#3
2202
+ module I18n::Tests::Localization
2203
+ class << self
2204
+ # @private
2205
+ #
2206
+ # source://i18n//lib/i18n/tests/localization.rb#9
2207
+ def included(base); end
2208
+ end
2209
+ end
2210
+
2211
+ # source://i18n//lib/i18n/exceptions.rb#116
2212
+ class I18n::UnknownFileType < ::I18n::ArgumentError
2213
+ # @return [UnknownFileType] a new instance of UnknownFileType
2214
+ #
2215
+ # source://i18n//lib/i18n/exceptions.rb#118
2216
+ def initialize(type, filename); end
2217
+
2218
+ # Returns the value of attribute filename.
2219
+ #
2220
+ # source://i18n//lib/i18n/exceptions.rb#117
2221
+ def filename; end
2222
+
2223
+ # Returns the value of attribute type.
2224
+ #
2225
+ # source://i18n//lib/i18n/exceptions.rb#117
2226
+ def type; end
2227
+ end
2228
+
2229
+ # source://i18n//lib/i18n/exceptions.rb#124
2230
+ class I18n::UnsupportedMethod < ::I18n::ArgumentError
2231
+ # @return [UnsupportedMethod] a new instance of UnsupportedMethod
2232
+ #
2233
+ # source://i18n//lib/i18n/exceptions.rb#126
2234
+ def initialize(method, backend_klass, msg); end
2235
+
2236
+ # Returns the value of attribute backend_klass.
2237
+ #
2238
+ # source://i18n//lib/i18n/exceptions.rb#125
2239
+ def backend_klass; end
2240
+
2241
+ # Returns the value of attribute method.
2242
+ #
2243
+ # source://i18n//lib/i18n/exceptions.rb#125
2244
+ def method; end
2245
+
2246
+ # Returns the value of attribute msg.
2247
+ #
2248
+ # source://i18n//lib/i18n/exceptions.rb#125
2249
+ def msg; end
2250
+ end
2251
+
2252
+ # source://i18n//lib/i18n/utils.rb#4
2253
+ module I18n::Utils
2254
+ class << self
2255
+ # source://i18n//lib/i18n/utils.rb#18
2256
+ def deep_merge(hash, other_hash, &block); end
2257
+
2258
+ # source://i18n//lib/i18n/utils.rb#22
2259
+ def deep_merge!(hash, other_hash, &block); end
2260
+
2261
+ # source://i18n//lib/i18n/utils.rb#34
2262
+ def deep_symbolize_keys(hash); end
2263
+
2264
+ # source://i18n//lib/i18n/utils.rb#7
2265
+ def except(hash, *keys); end
2266
+
2267
+ private
2268
+
2269
+ # source://i18n//lib/i18n/utils.rb#43
2270
+ def deep_symbolize_keys_in_object(value); end
2271
+ end
2272
+ end
2273
+
2274
+ # source://i18n//lib/i18n/version.rb#4
2275
+ I18n::VERSION = T.let(T.unsafe(nil), String)