Ruby intl8n for themes
This commit is contained in:
		
							parent
							
								
									f836468a7e
								
							
						
					
					
						commit
						f4c233f59f
					
				
					 6 changed files with 24 additions and 2 deletions
				
			
		
							
								
								
									
										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 a new issue