diff options
author | Francesco Maida <francesco.maida@gmail.com> | 2020-04-18 19:25:41 +0300 |
---|---|---|
committer | Francesco Maida <francesco.maida@gmail.com> | 2020-04-18 19:25:41 +0300 |
commit | e9193c9bc9be27cf468e8893f283a05779ad57e5 (patch) | |
tree | ed322047d4af43da76fd6be8e6c7b8034efeb315 | |
parent | de668f23496e2658924ea749d87e7acbd6fad405 (diff) |
multi-language support through i18n
-rw-r--r-- | i18n/en.toml | 17 | ||||
-rw-r--r-- | i18n/it.toml | 17 | ||||
-rw-r--r-- | layouts/index.html | 8 | ||||
-rw-r--r-- | layouts/partials/footer.html | 6 |
4 files changed, 41 insertions, 7 deletions
diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..d2721a6 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,17 @@ +[page] +other = "Page" + +[of] +other = "of" + +[newer] +other = "Newer" + +[older] +other = "Older" + +[noteworthy_theme] +other = "Noteworthy theme" + +[built_with_hugo] +other = "Built with Hugo" diff --git a/i18n/it.toml b/i18n/it.toml new file mode 100644 index 0000000..81f2cb5 --- /dev/null +++ b/i18n/it.toml @@ -0,0 +1,17 @@ +[page] +other = "Pagina" + +[of] +other = "di" + +[newer] +other = "Successivi" + +[older] +other = "Precedenti" + +[noteworthy_theme] +other = "Tema Noteworthy" + +[built_with_hugo] +other = "Realizzato con Hugo" diff --git a/layouts/index.html b/layouts/index.html index 426a164..91806f7 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -38,7 +38,7 @@ <div class="paginator"> {{ $paginator := .Paginator }} {{ if gt .Paginator.TotalPages 1 }} - <p>Page {{ $paginator.PageNumber}} of {{ $paginator.TotalPages }}</p> + <p>{{ i18n "page" }} {{ $paginator.PageNumber}} {{ i18n "of" }} {{ $paginator.TotalPages }}</p> <div class="paginator-group"> {{ if $paginator.HasPrev }} <a class="color-link" href="{{ $paginator.Prev.URL | relLangURL }}"> @@ -47,13 +47,13 @@ <polygon id="Path" points="1.75929935 4.50000282 5.3292523 7.62371165 4.6707477 8.37628835 0.240700645 4.49999718 4.67081049 0.623709205 5.32930951 1.37629079"></polygon> <polygon id="Path" points="13 4 13 5 1 5 1 4"></polygon> </g> - </svg> - Newer + </svg> + {{ i18n "newer" }} </a> {{ end }} {{ if $paginator.HasNext }} <a class="color-link older" href="{{ $paginator.Next.URL | relLangURL }}"> - Older + {{ i18n "older" }} <svg width="13px" height="9px" viewBox="0 0 13 9" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"> <g class="color-arrow" fill="#63BDA2" fill-rule="nonzero"> <polygon points="7.6707477 1.37628835 8.3292523 0.623711653 12.7592994 4.50000282 8.32918951 8.37629079 7.67069049 7.62370921 11.2407006 4.49999718"></polygon> diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c19fc8c..94ab42c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,9 +1,9 @@ <footer class="footer"> {{ partial "social.html" . }} - <p><a href="https://github.com/kimcc/hugo-theme-noteworthy" target="_blank" rel="noopener">Noteworthy theme</a></p> - <p><a href="https://gohugo.io" target="_blank" rel="noopener">Built with Hugo</a></p> + <p><a href="https://github.com/kimcc/hugo-theme-noteworthy" target="_blank" rel="noopener">{{ i18n "noteworthy_theme" }}</a></p> + <p><a href="https://gohugo.io" target="_blank" rel="noopener">{{ i18n "built_with_hugo" }}</a></p> {{ $script := resources.Get "js/main.js" | minify | fingerprint -}} <script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script> -</footer>
\ No newline at end of file +</footer> |