Class: VagrantPlugins::DigitalOcean::Helpers::Translator
- Inherits:
-
Object
- Object
- VagrantPlugins::DigitalOcean::Helpers::Translator
- Defined in:
- lib/vagrant-digitalocean/helpers/translator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(namespace) ⇒ Translator
constructor
A new instance of Translator.
- #t(keys, opts = {}) ⇒ Object
Constructor Details
#initialize(namespace) ⇒ Translator
Returns a new instance of Translator.
9 10 11 |
# File 'lib/vagrant-digitalocean/helpers/translator.rb', line 9 def initialize(namespace) @namespace = namespace end |
Class Method Details
.plugin_namespace=(val) ⇒ Object
5 6 7 |
# File 'lib/vagrant-digitalocean/helpers/translator.rb', line 5 def self.plugin_namespace=(val) @@plugin_namespace = val end |
Instance Method Details
#t(keys, opts = {}) ⇒ Object
13 14 15 16 |
# File 'lib/vagrant-digitalocean/helpers/translator.rb', line 13 def t(keys, opts = {}) value = I18n.t("#{@@plugin_namespace}.#{@namespace}.#{keys}", opts) opts[:progress] == false ? value : value + " ..." end |