mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
DEV: Do not translate font names (#10723)
Use the names as provided by discourse-fonts and remove the translated strings. It also ensures that the selected font is present in case a font will be removed in the future.
This commit is contained in:
parent
4abbe3d361
commit
eb891778ff
|
@ -9,11 +9,7 @@ class BaseFontSetting < EnumSiteSetting
|
|||
|
||||
def self.values
|
||||
@values ||= DiscourseFonts.fonts.map do |font|
|
||||
{ name: "base_font_setting.#{font[:key]}", value: font[:key] }
|
||||
{ name: font[:name], value: font[:key] }
|
||||
end
|
||||
end
|
||||
|
||||
def self.translate_names?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1737,30 +1737,6 @@ en:
|
|||
categories_boxes: "Boxes with Subcategories"
|
||||
categories_boxes_with_topics: "Boxes with Featured Topics"
|
||||
|
||||
base_font_setting:
|
||||
helvetica: "Helvetica/Arial"
|
||||
open_sans: "Open Sans"
|
||||
oxanium: "Oxanium"
|
||||
roboto: "Roboto"
|
||||
lato: "Lato"
|
||||
noto_sans_jp: "NotoSansJP"
|
||||
montserrat: "Montserrat"
|
||||
roboto_condensed: "RobotoCondensed"
|
||||
source_sans_pro: "SourceSansPro"
|
||||
oswald: "Oswald"
|
||||
raleway: "Raleway"
|
||||
roboto_mono: "RobotoMono"
|
||||
poppins: "Poppins"
|
||||
noto_sans: "NotoSans"
|
||||
roboto_slab: "RobotoSlab"
|
||||
merriweather: "Merriweather"
|
||||
ubuntu: "Ubuntu"
|
||||
pt_sans: "PTSans"
|
||||
playfair_display: "PlayfairDisplay"
|
||||
nunito: "Nunito"
|
||||
lora: "Lora"
|
||||
mukta: "Mukta"
|
||||
|
||||
shortcut_modifier_key:
|
||||
shift: "Shift"
|
||||
ctrl: "Ctrl"
|
||||
|
|
|
@ -43,13 +43,17 @@ module Stylesheet
|
|||
register_import "font" do
|
||||
font = DiscourseFonts.fonts.find { |f| f[:key] == SiteSetting.base_font }
|
||||
|
||||
contents = <<~EOF
|
||||
#{font_css(font)}
|
||||
contents = if font.present?
|
||||
<<~EOF
|
||||
#{font_css(font)}
|
||||
|
||||
:root {
|
||||
--font-family: #{font[:stack]};
|
||||
}
|
||||
EOF
|
||||
:root {
|
||||
--font-family: #{font[:stack]};
|
||||
}
|
||||
EOF
|
||||
else
|
||||
""
|
||||
end
|
||||
|
||||
Import.new("font.scss", source: contents)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user