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

created support for entry-level language values #269

Merged
merged 2 commits into from
Jul 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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