Skip to content

Commit

Permalink
Make translation work with i18n >= 1
Browse files Browse the repository at this point in the history
  • Loading branch information
flbulgarelli committed Apr 10, 2023
1 parent 423e79d commit d71f8b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gem/lib/mulang/expectation/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def translate(e, tokens = nil)
def translate!(e, tokens = nil)
e = e.as_v2
key = key_for e.binding, e.inspection
::I18n.t key, translation_params(e, tokens)
::I18n.t(key, **translation_params(e, tokens))
end

alias t translate
Expand Down Expand Up @@ -41,7 +41,7 @@ def t_target(parsed)
end

def t_matching(tokens, parsed)
::I18n.t("mulang.expectation.#{parsed.matcher.type}", with_tokens(tokens, value: parsed.matcher.value)) if parsed.matcher
::I18n.t("mulang.expectation.#{parsed.matcher.type}", **with_tokens(tokens, value: parsed.matcher.value)) if parsed.matcher
end

def with_tokens(tokens, params)
Expand Down
2 changes: 1 addition & 1 deletion gem/mulang.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "mumukit-core", '~> 1.19'

spec.add_development_dependency 'codeclimate-test-reporter'
spec.add_development_dependency "activesupport", "~> 6.0"
spec.add_development_dependency "activesupport", ">= 6.0"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "pry", "~> 3.0"
Expand Down

0 comments on commit d71f8b6

Please sign in to comment.