Skip to content

Commit

Permalink
Added generator to copy locale files.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Dec 3, 2010
1 parent 7489414 commit 33096cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/mezu/engine.rb
@@ -1,7 +1,8 @@
module Mezu
class Engine < Rails::Engine
generators do
require "mezu/generators"
require "mezu/generators/install"
require "mezu/generators/copy_locales"
end

config.after_initialize do
Expand Down
12 changes: 12 additions & 0 deletions lib/mezu/generators/copy_locales.rb
@@ -0,0 +1,12 @@
require "rails/generators/base"

module Mezu
class CopyLocalesGenerator < ::Rails::Generators::Base
source_root File.dirname(__FILE__) + "/../../../templates"

def copy_locales
copy_file "locales/mezu.en.yml", "config/locales/mezu.en.yml"
copy_file "locales/mezu.pt-BR.yml", "config/locales/mezu.pt-BR.yml"
end
end
end
2 changes: 1 addition & 1 deletion lib/mezu/generators.rb → lib/mezu/generators/install.rb
Expand Up @@ -2,7 +2,7 @@

module Mezu
class InstallGenerator < ::Rails::Generators::Base
source_root File.dirname(__FILE__) + "/../../templates"
source_root File.dirname(__FILE__) + "/../../../templates"

def copy_initializer_file
copy_file "initializer.rb", "config/initializers/mezu.rb"
Expand Down

0 comments on commit 33096cc

Please sign in to comment.