mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Fix broken translated links
Only fallback to English when no language code is supplied in translate.rb Drop link to events page in ar, far translations
This commit is contained in:
parent
f833eb5e15
commit
6aa184ca18
2 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,7 @@ module Jekyll
|
|||
end
|
||||
end
|
||||
#define id, category and lang
|
||||
defaulten = true
|
||||
lang = Liquid::Template.parse("{{page.lang}}").render context
|
||||
cat = Liquid::Template.parse("{{page.id}}").render context
|
||||
id=@id.split(' ')
|
||||
|
@ -46,6 +47,7 @@ module Jekyll
|
|||
end
|
||||
if !id[2].nil?
|
||||
lang = Liquid::Template.parse(id[2]).render context
|
||||
defaulten = false
|
||||
end
|
||||
id=Liquid::Template.parse(id[0]).render context
|
||||
if lang == ''
|
||||
|
@ -64,7 +66,7 @@ module Jekyll
|
|||
text = ar[id]
|
||||
end
|
||||
#fallback to English if string is empty
|
||||
if text == ''
|
||||
if text == '' and defaulten == true
|
||||
lang = 'en'
|
||||
ar = site['loc'][lang]
|
||||
for key in keys do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue