rails_type_id 0.1.0

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