checkoff 0.201.0 → 0.203.0

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