Skip to content

Commit

Permalink
Merge c3c8810 into 2bccb0a
Browse files Browse the repository at this point in the history
  • Loading branch information
elotroalex committed Jul 20, 2019
2 parents 2bccb0a + c3c8810 commit 541df98
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/jekyll/scholar/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,31 @@ def render_citation(items)
end

def render_bibliography(entry, index = nil)

entry.language = entry['language']

if config['allow_locale_overrides'] == true && entry.language != "" && entry.language != config['locale']
begin
new_locale = CSL::Locale.load(entry.language)
unless new_locale.nil?
original_locale, renderer.locale = renderer.locale, new_locale
end
rescue ParseError
# locale not found
end
end

renderer.render citation_item_for(entry, index),
styles(style).bibliography
styles(style).bibliography

ensure
unless original_locale.nil?
renderer.locale = original_locale
end
end



def citation_item_for(entry, citation_number = nil)
CiteProc::CitationItem.new id: entry.id do |c|
c.data = CiteProc::Item.new entry.to_citeproc
Expand Down

0 comments on commit 541df98

Please sign in to comment.