Skip to content

Commit

Permalink
Merge pull request #291 from Koalephant/Fix-Translate-v3
Browse files Browse the repository at this point in the history
Fix calls to I18n.t() using a hash
  • Loading branch information
seth-reeser committed Jul 29, 2023
2 parents 2b75b7f + a25ea2a commit 223c12c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/vagrant-hostmanager/action/update_guest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def initialize(app, env)

def call(env)
if @config.hostmanager.manage_guest?
env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', {
:name => @machine.name
})
env[:ui].info I18n.t('vagrant_hostmanager.action.update_guest', name: @machine.name)
@updater.update_guest(@machine)

@app.call(env)
Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant-hostmanager/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def validate(machine)
# check if aliases option is an Array
if !machine.config.hostmanager.aliases.kind_of?(Array) &&
!machine.config.hostmanager.aliases.kind_of?(String)
errors << I18n.t('vagrant_hostmanager.config.not_an_array_or_string', {
errors << I18n.t('vagrant_hostmanager.config.not_an_array_or_string', **{
:config_key => 'hostmanager.aliases',
:is_class => aliases.class.to_s,
})
end

if !machine.config.hostmanager.ip_resolver.nil? &&
!machine.config.hostmanager.ip_resolver.kind_of?(Proc)
errors << I18n.t('vagrant_hostmanager.config.not_a_proc', {
errors << I18n.t('vagrant_hostmanager.config.not_a_proc', **{
:config_key => 'hostmanager.ip_resolver',
:is_class => ip_resolver.class.to_s,
})
Expand All @@ -72,7 +72,7 @@ def validate(machine)
def validate_bool(key, value)
if ![TrueClass, FalseClass].include?(value.class) &&
value != UNSET_VALUE
I18n.t('vagrant_hostmanager.config.not_a_bool', {
I18n.t('vagrant_hostmanager.config.not_a_bool', **{
:config_key => key,
:value => value.class.to_s
})
Expand Down

0 comments on commit 223c12c

Please sign in to comment.