Ruby intl8n for themes

master
kibigo! 7 years ago
parent 282f48ddd1
commit d08d0f9f33
  1. 6
      app/javascript/flavours/glitch/names.yml
  2. 6
      app/javascript/flavours/vanilla/names.yml
  3. 0
      app/javascript/skins/vanilla/win95/common.scss
  4. 4
      app/javascript/skins/vanilla/win95/names.yml
  5. 4
      app/views/settings/preferences/show.html.haml
  6. 6
      config/initializers/locale.rb

@ -0,0 +1,6 @@
en:
flavours:
glitch: Glitch Edition
skins:
glitch:
default: Default

@ -0,0 +1,6 @@
en:
flavours:
vanilla: Vanilla Mastodon
skins:
vanilla:
default: Default

@ -0,0 +1,4 @@
en:
skins:
vanilla:
win95: Masto95

@ -27,8 +27,8 @@
.fields-group .fields-group
- if Themes.instance.flavours.size > 1 - if Themes.instance.flavours.size > 1
= f.input :setting_flavour, collection: Themes.instance.flavours, label_method: lambda { |flavour| I18n.t("themes.#{flavour}", default: flavour) }, wrapper: :with_label, include_blank: false = f.input :setting_flavour, collection: Themes.instance.flavours, label_method: lambda { |flavour| I18n.t("flavours.#{flavour}", default: flavour) }, wrapper: :with_label, include_blank: false
= f.input :setting_skin, collection: Themes.instance.skins_for(current_flavour), label_method: lambda { |skin| I18n.t("themes.#{current_flavour}.skins.#{skin}", default: skin) }, wrapper: :with_label, include_blank: false = f.input :setting_skin, collection: Themes.instance.skins_for(current_flavour), label_method: lambda { |skin| I18n.t("skins.#{current_flavour}.#{skin}", default: skin) }, wrapper: :with_label, include_blank: false
= f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label
= f.input :setting_boost_modal, as: :boolean, wrapper: :with_label = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label

@ -0,0 +1,6 @@
# frozen_string_literal: true
I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s]
I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s]
I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s]
I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s]
Loading…
Cancel
Save