Skip to content

Commit

Permalink
Merge pull request #20098 from hanachin/add_ability_to_translate_docu…
Browse files Browse the repository at this point in the history
…ments.yaml

Add ability to translate rails guides documents.yaml
  • Loading branch information
fxn committed Oct 5, 2015
2 parents c468d7f + d3959c5 commit 397ee98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion guides/rails_guides/generator.rb
Expand Up @@ -194,7 +194,7 @@ def generate_guide(guide, output_file)
layout = kindle? ? 'kindle/layout' : 'layout'

File.open(output_path, 'w') do |f|
view = ActionView::Base.new(source_dir, :edge => @edge, :version => @version, :mobi => "kindle/#{mobi}")
view = ActionView::Base.new(source_dir, :edge => @edge, :version => @version, :mobi => "kindle/#{mobi}", :lang => @lang)
view.extend(Helpers)

if guide =~ /\.(\w+)\.erb$/
Expand Down
2 changes: 1 addition & 1 deletion guides/rails_guides/helpers.rb
Expand Up @@ -15,7 +15,7 @@ def guide(name, url, options = {}, &block)
end

def documents_by_section
@documents_by_section ||= YAML.load_file(File.expand_path('../../source/documents.yaml', __FILE__))
@documents_by_section ||= YAML.load_file(File.expand_path("../../source/#{@lang ? @lang + '/' : ''}documents.yaml", __FILE__))
end

def documents_flat
Expand Down

0 comments on commit 397ee98

Please sign in to comment.