Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use I18n in inline hd chap. #420

Merged
merged 1 commit into from
Apr 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/review/htmlbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,9 @@ def inline_bib(id)
def inline_hd_chap(chap, id)
n = chap.headline_index.number(id)
if chap.number and @book.config["secnolevel"] >= n.split('.').size
str = "「#{n} #{compile_inline(chap.headline(id).caption)}」"
str = I18n.t("chapter_quote", "#{n} #{compile_inline(chap.headline(id).caption)}")
else
str = "「#{compile_inline(chap.headline(id).caption)}」"
str = I18n.t("chapter_quote", compile_inline(chap.headline(id).caption))
end
if @book.config["chapterlink"]
anchor = "h"+n.gsub(/\./, "-")
Expand Down
4 changes: 2 additions & 2 deletions lib/review/idgxmlbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1174,10 +1174,10 @@ def inline_hd_chap(chap, id)
if chap.number
n = chap.headline_index.number(id)
if @book.config["secnolevel"] >= n.split('.').size
return "「#{n} #{compile_inline(chap.headline(id).caption)}」"
return I18n.t("chapter_quote", "#{n} #{compile_inline(chap.headline(id).caption)}")
end
end
"「#{compile_inline(chap.headline(id).caption)}」"
I18n.t("chapter_quote", compile_inline(chap.headline(id).caption))
end

def inline_recipe(id)
Expand Down
4 changes: 2 additions & 2 deletions lib/review/latexbuilder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,9 @@ def inline_bib(id)
def inline_hd_chap(chap, id)
n = chap.headline_index.number(id)
if chap.number and @book.config["secnolevel"] >= n.split('.').size
str = "「#{chap.headline_index.number(id)} #{compile_inline(chap.headline(id).caption)}」"
str = I18n.t("chapter_quote", "#{chap.headline_index.number(id)} #{compile_inline(chap.headline(id).caption)}")
else
str = "「#{compile_inline(chap.headline(id).caption)}」"
str = I18n.t("chapter_quote", compile_inline(chap.headline(id).caption))
end
if @book.config["chapterlink"]
anchor = n.gsub(/\./, "-")
Expand Down