Skip to content

Commit

Permalink
Add config files to generator template and make it actually work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugisozols committed Dec 19, 2011
1 parent 0c0848f commit 22be151
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
10 changes: 0 additions & 10 deletions lib/generators/i18n_generator.rb

This file was deleted.

13 changes: 13 additions & 0 deletions lib/generators/refinery/i18n_generator.rb
@@ -0,0 +1,13 @@
module Refinery
class I18nGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)

def generate_refinery_i18n_initializer
template "config/initializers/refinery_i18n.rb.erb", File.join(destination_root, "config", "initializers", "refinery_i18n.rb")
end

def generate_i18n_js
template "config/i18n-js.yml", File.join(destination_root, "config", "i18n-js.yml")
end
end
end
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,11 @@
Refinery::I18n.configure do |config|
# config.enabled = <%= Refinery::I18n.config.enabled %>

# config.default_locale = :<%= Refinery::I18n.config.default_locale %>

# config.default_frontend_locale = :<%= Refinery::I18n.config.default_frontend_locale %>

# config.frontend_locales = <%= Refinery::I18n.config.frontend_locales %>

# config.locales = <%= Refinery::I18n.config.locales %>
end
3 changes: 2 additions & 1 deletion lib/refinery/i18n.rb
Expand Up @@ -3,6 +3,8 @@
require 'routing-filter'

module Refinery
autoload :I18nGenerator, 'generators/refinery/i18n_generator'

module I18n
class << self
attr_accessor :built_in_locales
Expand Down Expand Up @@ -57,4 +59,3 @@ def has_locale?(locale)
require 'refinery/i18n/configuration'
end
end

2 changes: 1 addition & 1 deletion lib/refinerycms-i18n.rb
@@ -1 +1 @@
require File.expand_path('../refinery/i18n', __FILE__)
require 'refinery/i18n'

0 comments on commit 22be151

Please sign in to comment.