# -*- encoding : utf-8 -*- module Phrase class Config def enabled? ENV['TRANSLATABLE'] == "true" || (defined?(Rails) == true && Rails.env == "staging") end def locale I18n.locale end def default_locale @@default_locale ||= I18n.default_locale end def backend @@backend ||= Backend::PhraseService.new end def backend=(backend) @@backend = backend end def available_locales @@available_locales ||= nil @@available_locales ||= I18n.available_locales end def available_locales=(locales) @@available_locales = Array(locales).map { |locale| locale.to_sym } @@available_locales = nil if @@available_locales.empty? end end end