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