mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
22 lines
380 B
Ruby
22 lines
380 B
Ruby
class LocaleSiteSetting
|
|
|
|
def self.valid_value?(val)
|
|
supported_locales.include?(val)
|
|
end
|
|
|
|
def self.all_values
|
|
supported_locales
|
|
end
|
|
|
|
|
|
private
|
|
|
|
@lock = Mutex.new
|
|
|
|
def self.supported_locales
|
|
@lock.synchronize do
|
|
@supported_locales ||= Dir.glob( File.join(Rails.root, 'config', 'locales', 'client.*.yml') ).map {|x| x.split('.')[-2]}
|
|
end
|
|
end
|
|
end
|