A platform for community discussion. Free, open, simple.
DEV: Do not translate font names (#10723)
Bianca Nenciueb891778ff93
diff --git a/app/models/base_font_setting.rb b/app/models/base_font_setting.rbindex ff9787763e7..36c0321876b 100644--- a/app/models/base_font_setting.rb+++ b/app/models/base_font_setting.rb@@ -9,11 +9,7 @@ class BaseFontSetting < EnumSiteSettingdef self.values@values ||= DiscourseFonts.fonts.map do |font|- { name: "base_font_setting.#{font[:key]}", value: font[:key] }+ { name: font[:name], value: font[:key] }endend-- def self.translate_names?- true- endenddiff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 2c6be84cc4f..9f63c6a3f0d 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -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"diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rbindex b59a09735d9..f0b2c7b11c9 100644--- a/lib/stylesheet/importer.rb+++ b/lib/stylesheet/importer.rb@@ -43,13 +43,17 @@ module Stylesheetregister_import "font" dofont = 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+ ""+ endImport.new("font.scss", source: contents)end