2013-06-11 11:39:55 -04:00
|
|
|
class LocaleSiteSetting
|
|
|
|
|
|
|
|
def self.valid_value?(val)
|
|
|
|
supported_locales.include?(val)
|
|
|
|
end
|
|
|
|
|
2013-06-23 01:07:25 -04:00
|
|
|
def self.values
|
2013-06-11 11:39:55 -04:00
|
|
|
supported_locales
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
@lock = Mutex.new
|
|
|
|
|
|
|
|
def self.supported_locales
|
|
|
|
@lock.synchronize do
|
2013-06-13 11:46:20 -04:00
|
|
|
@supported_locales ||= Dir.glob( File.join(Rails.root, 'config', 'locales', 'client.*.yml') ).map {|x| x.split('.')[-2]}.sort
|
2013-06-11 11:39:55 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|