-
Notifications
You must be signed in to change notification settings - Fork 268
/
Copy pathinterpolations.rb
33 lines (28 loc) · 1.03 KB
/
interpolations.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true
module I18n::Tasks
module Command
module Commands
module Interpolations
include Command::Collection
cmd :check_consistent_interpolations,
pos: '[locale ...]',
desc: t('i18n_tasks.cmd.desc.check_consistent_interpolations'),
args: %i[locales out_format]
def check_consistent_interpolations(opt = {})
forest = i18n.inconsistent_interpolations(**opt.slice(:locales, :base_locale))
print_forest forest, opt, :inconsistent_interpolations
:exit1 unless forest.empty?
end
cmd :check_reserved_interpolations,
pos: '[locale]',
desc: t('i18n_tasks.cmd.desc.check_reserved_interpolations'),
args: %i[locales out_format]
def check_reserved_interpolations(opt = {})
forest = i18n.reserved_interpolations(**opt.slice(:locale))
print_forest forest, opt, :reserved_interpolations
:exit1 unless forest.empty?
end
end
end
end
end