Skip to content

Commit

Permalink
add language widget
Browse files Browse the repository at this point in the history
when we have a multi-linguage website, we want to allow the user to switch language
  • Loading branch information
Jibec committed May 30, 2020
1 parent 4ef78d2 commit f72f679
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ other = "Go Home..."
[lastUpdated]
other = "Last updated"

[languages]
other = "Languages"

[leaveAComment]
other = "Leave a comment"

Expand Down
3 changes: 3 additions & 0 deletions i18n/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ other = "Gopher"
[goHome]
other = "Retourner à l'accueil..."

[languages]
other = "Langues"

[leaveAComment]
other = "Laisser un commentaire"

Expand Down
14 changes: 14 additions & 0 deletions layouts/partials/widgets/languages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<section class='widget widget-languages sep-after'>
<header>
<h4 class='title widget-title'>
{{ i18n "languages" }}
</h4>
</header>

{{ range $.Site.Home.AllTranslations }}
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
{{ end }}

</section>


0 comments on commit f72f679

Please sign in to comment.