Method: Puppet::GettextConfig.reset_text_domain

Defined in:
lib/puppet/gettext/config.rb

.reset_text_domain(domain_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Clears the translation repository for the given text domain, creating it if it doesn’t exist, then adds default translations and switches to using this domain.

Parameters:

  • domain_name (String, Symbol)

    the name of the domain to create



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/puppet/gettext/config.rb', line 66

def self.reset_text_domain(domain_name)
  return if @gettext_disabled || !gettext_loaded?

  domain_name = domain_name.to_sym

  Puppet.debug { "Reset text domain to #{domain_name.inspect}" }
  FastGettext.add_text_domain(domain_name,
                              type: :chain,
                              chain: [],
                              report_warning: false)
  copy_default_translations(domain_name)
  FastGettext.text_domain = domain_name
end