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:
Saivann 2014-06-18 12:04:06 -04:00
parent f833eb5e15
commit 6aa184ca18
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -28,7 +28,11 @@ id: community
<div>
<div>
<h2><img src="/img/ico_multi.svg" class="titleicon" alt="Icon">{% translate meetups %}</h2>
{% case page.lang %}
{% when 'ar' or 'fa' %}
{% else %}
<p><a href="/{{ page.lang }}/{% translate events url %}">{% translate meetupevents %}</a></p>
{% endcase %}
<p><a href="http://bitcoin.meetup.com/">{% translate meetupgroup %}</a></p>
<p><a href="https://bitcointalk.org/index.php?board=86.0">{% translate meetupbitcointalk %}</a></p>
<p><a href="https://en.bitcoin.it/wiki/Meetups">{% translate meetupwiki %}</a></p>