This repository was archived by the owner on Jan 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ module Jekyll
1919 #*****************************************************************************
2020 # :site, :post_render hook
2121 #*****************************************************************************
22+ Jekyll ::Hooks . register :site , :pre_render do |site , payload |
23+ lang = site . config [ 'lang' ]
24+ unless site . parsed_translations . has_key? ( lang )
25+ puts "Loading translation from file #{ site . source } /_i18n/#{ lang } .yml"
26+ site . parsed_translations [ lang ] = YAML . load_file ( "#{ site . source } /_i18n/#{ lang } .yml" )
27+ end
28+ end
2229 Jekyll ::Hooks . register :site , :post_render do |site , payload |
2330
2431 # Removes all static files that should not be copied to translated sites.
@@ -309,11 +316,6 @@ def render(context)
309316
310317 lang = site . config [ 'lang' ]
311318
312- unless site . parsed_translations . has_key? ( lang )
313- puts "Loading translation from file #{ site . source } /_i18n/#{ lang } .yml"
314- site . parsed_translations [ lang ] = YAML . load_file ( "#{ site . source } /_i18n/#{ lang } .yml" )
315- end
316-
317319 translation = site . parsed_translations [ lang ] . access ( key ) if key . is_a? ( String )
318320
319321 if translation . nil? or translation . empty?
You can’t perform that action at this time.
0 commit comments