DEV: support for settings/locales in plugin generator (#6341)
This commit is contained in:
parent
103509b9dd
commit
90e67b671b
|
@ -49,6 +49,15 @@ class PluginGenerator < Rails::Generators::NamedBase
|
||||||
template 'javascript.es6.erb', File.join('plugins', dasherized_name, 'assets/javascripts/initializers', "#{dasherized_name}.es6")
|
template 'javascript.es6.erb', File.join('plugins', dasherized_name, 'assets/javascripts/initializers', "#{dasherized_name}.es6")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_settings_file
|
||||||
|
template 'settings.yml.erb', File.join('plugins', dasherized_name, 'config', 'settings.yml')
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_locales_file
|
||||||
|
template 'client.en.yml.erb', File.join('plugins', dasherized_name, 'config/locales', 'client.en.yml')
|
||||||
|
template 'server.en.yml.erb', File.join('plugins', dasherized_name, 'config/locales', 'server.en.yml')
|
||||||
|
end
|
||||||
|
|
||||||
def create_gitignore_entry
|
def create_gitignore_entry
|
||||||
plugin_entry = "!/plugins/#{dasherized_name}"
|
plugin_entry = "!/plugins/#{dasherized_name}"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
en:
|
||||||
|
js:
|
||||||
|
<%= underscored_name %>:
|
|
@ -0,0 +1,3 @@
|
||||||
|
en:
|
||||||
|
site_settings:
|
||||||
|
<%= underscored_name %>_enabled: "Enable <%= name %> plugin"
|
|
@ -0,0 +1,4 @@
|
||||||
|
plugins:
|
||||||
|
<%= underscored_name %>_enabled:
|
||||||
|
default: true
|
||||||
|
client: true
|
Loading…
Reference in New Issue