module Snippr::I18n

Public Class Methods

enabled=(enabled) click to toggle source

Sets whether to use I18n snippr files.

# File lib/snippr/i18n.rb, line 15
def self.enabled=(enabled)
  @@enabled = enabled
end
enabled?() click to toggle source

Returns whether to use I18n snippr files.

# File lib/snippr/i18n.rb, line 10
def self.enabled?
  !!@@enabled
end
locale(enabled=nil) click to toggle source

Returns the current locale prefixed with a “_” from I18n if I18n is enabled. Otherwise defaults to an empty String.

# File lib/snippr/i18n.rb, line 21
def self.locale(enabled=nil)
  (enabled.nil? ? enabled? : enabled) ? "_#{::I18n.locale}" : ''
end