mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 07:53:39 +08:00
f2e14a3946
Co-authored-by: Neil Lalonde <neillalonde@gmail.com>
20 lines
387 B
Ruby
20 lines
387 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "enum_site_setting"
|
|
|
|
class BaseFontSetting < EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= DiscourseFonts.fonts.map do |font|
|
|
{ name: "base_font_setting.#{font[:key]}", value: font[:key] }
|
|
end
|
|
end
|
|
|
|
def self.translate_names?
|
|
true
|
|
end
|
|
end
|