Skip to content

Commit

Permalink
Merge pull request #133 from manabuishii/translation_button
Browse files Browse the repository at this point in the history
Add Translation Button
  • Loading branch information
mr-c authored Aug 2, 2019
2 parents 4361ed9 + a295efb commit b97ad32
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ life_cycle: "stable"
# What kind of thing is this ("workshop" or "lesson")?
kind: "lesson"

# Languages
# Order is from https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers#Ethnologue_(2019,_22nd_edition)
# followed by the remaining entries from https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers#Ethnologue_(2019,_22nd_edition)
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"]

# Magic to make URLs resolve both locally and on GitHub.
# See https://help.github.com/articles/repository-metadata-on-github-pages/.
repository: common-workflow-language/user-guide
Expand Down
16 changes: 16 additions & 0 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@
{% else %}
<li><a href="{{repo_url}}/edit/{{ default_branch}}/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
{% endif %}
{% comment %} Add dropdown for language {% endcomment %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<img src="https://upload.wikimedia.org/wikipedia/commons/d/d7/Google_Translate_logo.svg" alt="Google Translate logo" height="15"/>
EN
<span class="caret"></span></a>
<ul class="dropdown-menu">
{% for lang in site.other_languages %}
<li>
<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] }}">
{{ lang | upcase }}
</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
<div class="form-group">
Expand Down

0 comments on commit b97ad32

Please sign in to comment.