Skip to content

Add Translation Button #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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