mirror of
https://github.com/funamitech/mastodon
synced 2024-11-29 15:28:33 +09:00
Ruby intl8n for themes
This commit is contained in:
parent
282f48ddd1
commit
d08d0f9f33
6
app/javascript/flavours/glitch/names.yml
Normal file
6
app/javascript/flavours/glitch/names.yml
Normal file
@ -0,0 +1,6 @@
|
||||
en:
|
||||
flavours:
|
||||
glitch: Glitch Edition
|
||||
skins:
|
||||
glitch:
|
||||
default: Default
|
6
app/javascript/flavours/vanilla/names.yml
Normal file
6
app/javascript/flavours/vanilla/names.yml
Normal file
@ -0,0 +1,6 @@
|
||||
en:
|
||||
flavours:
|
||||
vanilla: Vanilla Mastodon
|
||||
skins:
|
||||
vanilla:
|
||||
default: Default
|
4
app/javascript/skins/vanilla/win95/names.yml
Normal file
4
app/javascript/skins/vanilla/win95/names.yml
Normal file
@ -0,0 +1,4 @@
|
||||
en:
|
||||
skins:
|
||||
vanilla:
|
||||
win95: Masto95
|
@ -27,8 +27,8 @@
|
||||
|
||||
.fields-group
|
||||
- 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_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_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("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_boost_modal, as: :boolean, wrapper: :with_label
|
||||
|
6
config/initializers/locale.rb
Normal file
6
config/initializers/locale.rb
Normal file
@ -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…
Reference in New Issue
Block a user