mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Load list of translations from _translations instead of _config.yml
This commit is contained in:
parent
4bdca82894
commit
ed0f1db195
2 changed files with 10 additions and 6 deletions
|
@ -14,12 +14,14 @@ module Jekyll
|
|||
|
||||
module AlphabForImpl
|
||||
def render(context)
|
||||
#load translations files
|
||||
#Load translations
|
||||
site = context.registers[:site].config
|
||||
if !site.has_key?("loc")
|
||||
site['loc'] = {}
|
||||
site['langs'].each do |key,value|
|
||||
site['loc'][key] = YAML.load_file('_translations/'+key+'.yml')[key]
|
||||
Dir.foreach('_translations') do |file|
|
||||
next if file == '.' or file == '..'
|
||||
lang=file.split('.')[0]
|
||||
site['loc'][lang] = YAML.load_file('_translations/'+file)[lang]
|
||||
end
|
||||
end
|
||||
#load collection and context variables
|
||||
|
|
|
@ -27,12 +27,14 @@ module Jekyll
|
|||
end
|
||||
|
||||
def render(context)
|
||||
#load translations files
|
||||
#Load translations
|
||||
site = context.registers[:site].config
|
||||
if !site.has_key?("loc")
|
||||
site['loc'] = {}
|
||||
site['langs'].each do |key,value|
|
||||
site['loc'][key] = YAML.load_file('_translations/'+key+'.yml')[key]
|
||||
Dir.foreach('_translations') do |file|
|
||||
next if file == '.' or file == '..'
|
||||
lang=file.split('.')[0]
|
||||
site['loc'][lang] = YAML.load_file('_translations/'+file)[lang]
|
||||
end
|
||||
end
|
||||
#define id, category and lang
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue