diff options
author | Xavier Noria <fxn@hashref.com> | 2015-10-05 18:14:58 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-10-05 18:14:58 +0200 |
commit | 397ee98f540eca7d0a1029c9a7260d9bedd0dd0a (patch) | |
tree | 51f1848f5b30341699c1d48d2e6516b27ad8a3fe /guides | |
parent | c468d7fedd88e2474fd74e804a954a154674c8a0 (diff) | |
parent | d3959c55e33dd39236d645eb19de243126dc2b1e (diff) | |
download | rails-397ee98f540eca7d0a1029c9a7260d9bedd0dd0a.tar.gz rails-397ee98f540eca7d0a1029c9a7260d9bedd0dd0a.tar.bz2 rails-397ee98f540eca7d0a1029c9a7260d9bedd0dd0a.zip |
Merge pull request #20098 from hanachin/add_ability_to_translate_documents.yaml
Add ability to translate rails guides documents.yaml
Diffstat (limited to 'guides')
-rw-r--r-- | guides/rails_guides/generator.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/helpers.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index 43f6f7eecf..b7a94f144c 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -194,7 +194,7 @@ module RailsGuides 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$/ diff --git a/guides/rails_guides/helpers.rb b/guides/rails_guides/helpers.rb index a78c2e9fca..5bf73da16c 100644 --- a/guides/rails_guides/helpers.rb +++ b/guides/rails_guides/helpers.rb @@ -15,7 +15,7 @@ module RailsGuides 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 |