vigiles 0.1.0.pre.beta3 → 0.1.0.pre.beta4

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