diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/rails_guides/generator.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index 68d406e31c..e4f9ea4916 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -38,6 +38,10 @@ # Note that if you are working on a guide generation will by default process # only that one, so ONLY is rarely used nowadays. # +# LANG +# Use LANG when you want to generate translated guides in <tt>source/<LANG></tt> +# folder (such as <tt>source/es</tt>). Ignore it when generating English guides. +# # EDGE # Set to "1" to indicate generated guides should be marked as edge. This # inserts a badge and changes the preamble of the home page. @@ -63,6 +67,7 @@ module RailsGuides GUIDES_RE = /\.(?:textile|html\.erb)$/ def initialize(output=nil) + @lang = ENV['LANG'] initialize_dirs(output) create_output_dir_if_needed set_flags_from_environment @@ -76,8 +81,8 @@ module RailsGuides private def initialize_dirs(output) @guides_dir = File.join(File.dirname(__FILE__), '..') - @source_dir = File.join(@guides_dir, "source") - @output_dir = output || File.join(@guides_dir, "output") + @source_dir = File.join(@guides_dir, "source", @lang.to_s) + @output_dir = output || File.join(@guides_dir, "output", @lang.to_s) end def create_output_dir_if_needed |