Skip to content

Commit b97ad32

Browse files
authored
Merge pull request #133 from manabuishii/translation_button
Add Translation Button
2 parents 4361ed9 + a295efb commit b97ad32

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ life_cycle: "stable"
2424
# What kind of thing is this ("workshop" or "lesson")?
2525
kind: "lesson"
2626

27+
# Languages
28+
# Order is from https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers#Ethnologue_(2019,_22nd_edition)
29+
# followed by the remaining entries from https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers#Ethnologue_(2019,_22nd_edition)
30+
other_languages: ["zh-CN", "zh-TW", "hi", "es", "fr", "ar", "bn", "ru", "pt", "id", "ur", "de", "ja", "sw", "mr", "te", "pa", "ta", "tr", "ko", "vi", "jw", "it", "ha", "th", "gu", "kn", "fa", "ms", "pl", "yo", "ml", "su", "uz", "ig", "ro", "nl", "az", "ku", "am", "mg", "sr", "ne", "km", "so", "ceb", "si", "el", "kk", "hu", "zu", "cs"]
31+
2732
# Magic to make URLs resolve both locally and on GitHub.
2833
# See https://help.github.com/articles/repository-metadata-on-github-pages/.
2934
repository: common-workflow-language/user-guide

_includes/navbar.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@
8282
{% else %}
8383
<li><a href="{{repo_url}}/edit/{{ default_branch}}/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
8484
{% endif %}
85+
{% comment %} Add dropdown for language {% endcomment %}
86+
<li class="dropdown">
87+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
88+
<img src="https://upload.wikimedia.org/wikipedia/commons/d/d7/Google_Translate_logo.svg" alt="Google Translate logo" height="15"/>
89+
EN
90+
<span class="caret"></span></a>
91+
<ul class="dropdown-menu">
92+
{% for lang in site.other_languages %}
93+
<li>
94+
<a class="dropdown-item" href="https://translate.google.com/translate?hl=jp&sl=en&tl={{ lang }}&u=https%3A%2F%2Fwww.commonwl.org%2Fuser_guide{{page.url}}&edit-text=&act=url" title="{{ inst[0] }}">
95+
{{ lang | upcase }}
96+
</a>
97+
</li>
98+
{% endfor %}
99+
</ul>
100+
</li>
85101
</ul>
86102
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
87103
<div class="form-group">

0 commit comments

Comments
 (0)