File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -233,18 +233,23 @@ def translate!(key, **options)
233
233
234
234
# Returns an array of interpolation keys for the given translation key
235
235
#
236
+ # *Examples*
237
+ #
236
238
# Suppose we have the following:
237
239
# I18n.t 'example.zero' == 'Zero interpolations'
238
240
# I18n.t 'example.one' == 'One interpolation %{foo}'
239
241
# I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}'
242
+ # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}']
240
243
# I18n.t 'example.one', locale: :other == 'One interpolation %{baz} %{bar}'
241
244
#
242
245
# Then we can expect the following results:
243
246
# I18n.interpolation_keys('example.zero') #=> []
244
247
# I18n.interpolation_keys('example.one') #=> ['foo']
245
248
# I18n.interpolation_keys('example.two') #=> ['foo', 'bar']
249
+ # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz']
246
250
# I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz']
247
251
# I18n.interpolation_keys('does-not-exist') #=> []
252
+ # I18n.interpolation_keys('example') #=> []
248
253
def interpolation_keys ( key , **options )
249
254
raise I18n ::ArgumentError if !key . is_a? ( String ) || key . empty?
250
255
You can’t perform that action at this time.
0 commit comments