Project

General

Profile

Download (914 Bytes) Statistics
| Branch: | Tag: | Revision:

require 'mycyma/info'

require 'ostruct'
require 'singleton'
require 'gettext'

module MyCyma

class Config < OpenStruct
include Singleton
include GetText

def initialize
str = File.read(File.join(RAILS_ROOT, "config", "settings.yml"))
conf_doc = YAML.load(str)
super(conf_doc)
end

def thumbnail_param_list
list = {}
self.thumbnail_sizes.each_pair do |name, params|
key = ("thumb_" + name).to_sym
list[key] = params
end
list
end

# should be guessed
def available_languages
{
'' => _("Browser preference"),
'en' => _("English"),
'fr' => _("French")
}
end

def switch_locale(locale = nil)
# if unspecified, use browser prefered langage
# (the new locale_rails handle this automagically by default)
set_locale(locale) unless locale.nil?
end
end
end

(1-1/5)