mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
ea932b74e7
also fixes random ordering of tests failure in site settings
21 lines
381 B
Ruby
21 lines
381 B
Ruby
class LocaleSiteSetting
|
|
|
|
def self.valid_value?(val)
|
|
supported_locales.include?(val)
|
|
end
|
|
|
|
def self.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]}.sort
|
|
end
|
|
end
|
|
end
|