diff --git a/lib/generators/plugin/plugin_generator.rb b/lib/generators/plugin/plugin_generator.rb index 963032784c4..29568aa4003 100644 --- a/lib/generators/plugin/plugin_generator.rb +++ b/lib/generators/plugin/plugin_generator.rb @@ -49,6 +49,15 @@ class PluginGenerator < Rails::Generators::NamedBase template 'javascript.es6.erb', File.join('plugins', dasherized_name, 'assets/javascripts/initializers', "#{dasherized_name}.es6") 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 plugin_entry = "!/plugins/#{dasherized_name}" diff --git a/lib/generators/plugin/templates/client.en.yml.erb b/lib/generators/plugin/templates/client.en.yml.erb new file mode 100644 index 00000000000..ac043b828c4 --- /dev/null +++ b/lib/generators/plugin/templates/client.en.yml.erb @@ -0,0 +1,3 @@ +en: + js: + <%= underscored_name %>: diff --git a/lib/generators/plugin/templates/server.en.yml.erb b/lib/generators/plugin/templates/server.en.yml.erb new file mode 100644 index 00000000000..574f41acd75 --- /dev/null +++ b/lib/generators/plugin/templates/server.en.yml.erb @@ -0,0 +1,3 @@ +en: + site_settings: + <%= underscored_name %>_enabled: "Enable <%= name %> plugin" diff --git a/lib/generators/plugin/templates/settings.yml.erb b/lib/generators/plugin/templates/settings.yml.erb new file mode 100644 index 00000000000..3f43a52beb6 --- /dev/null +++ b/lib/generators/plugin/templates/settings.yml.erb @@ -0,0 +1,4 @@ +plugins: + <%= underscored_name %>_enabled: + default: true + client: true