Merge pull request #21 from fmaida/fmaida

Multi-language support through i18n
This commit is contained in:
kimcc 2021-06-17 22:52:38 -05:00 committed by GitHub
commit b2aa369210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 14 deletions

23
i18n/en.toml Normal file
View File

@ -0,0 +1,23 @@
[page]
other = "Page"
[of]
other = "of"
[newer]
other = "Newer"
[older]
other = "Older"
[tagged]
other = "Tagged"
[read_more]
other = "Read more..."
[noteworthy_theme]
other = "Noteworthy theme"
[built_with_hugo]
other = "Built with Hugo"

23
i18n/it.toml Normal file
View File

@ -0,0 +1,23 @@
[page]
other = "Pagina"
[of]
other = "di"
[newer]
other = "Successivi"
[older]
other = "Precedenti"
[tagged]
other = "Contrassegnato"
[read_more]
other = "Continua a leggere..."
[noteworthy_theme]
other = "Tema Noteworthy"
[built_with_hugo]
other = "Realizzato con Hugo"

View File

@ -1,6 +1,6 @@
{{ define "main" }} {{ define "main" }}
<!-- Page that displays after clicking on a post's tag --> <!-- Page that displays after clicking on a post's tag -->
<h1>Tagged "{{ .Data.Term }}"</h1> <h1>{{ i18n "tagged" }} "{{ .Data.Term }}"</h1>
{{range .Pages}} {{range .Pages}}
<!-- Display the posts with the tag --> <!-- Display the posts with the tag -->
@ -13,7 +13,7 @@
<div> <div>
<p>{{ .Summary }}</p> <p>{{ .Summary }}</p>
{{ if (and (.Site.Params.showReadMore) (.Truncated)) }} {{ if (and (.Site.Params.showReadMore) (.Truncated)) }}
<p><a href="{{ .RelPermalink }}">Read more...</a></p> <p><a href="{{ .RelPermalink }}">{{ i18n "read_more" }}</a></p>
{{ end }} {{ end }}
</div> </div>
<div class="post-footer"> <div class="post-footer">

View File

@ -17,7 +17,7 @@
<div> <div>
<p>{{ .Summary }}</p> <p>{{ .Summary }}</p>
{{ if (and (.Site.Params.showReadMore) (.Truncated)) }} {{ if (and (.Site.Params.showReadMore) (.Truncated)) }}
<p><a href="{{ .RelPermalink }}">Read more...</a></p> <p><a href="{{ .RelPermalink }}">{{ i18n "read_more" }}</a></p>
{{ end }} {{ end }}
</div> </div>
<div class="post-footer"> <div class="post-footer">
@ -38,7 +38,7 @@
<div class="paginator"> <div class="paginator">
{{ $paginator := .Paginator }} {{ $paginator := .Paginator }}
{{ if gt .Paginator.TotalPages 1 }} {{ 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"> <div class="paginator-group">
{{ if $paginator.HasPrev }} {{ if $paginator.HasPrev }}
<a class="color-link" href="{{ $paginator.Prev.URL | relLangURL }}"> <a class="color-link" href="{{ $paginator.Prev.URL | relLangURL }}">
@ -48,12 +48,12 @@
<polygon id="Path" points="13 4 13 5 1 5 1 4"></polygon> <polygon id="Path" points="13 4 13 5 1 5 1 4"></polygon>
</g> </g>
</svg> </svg>
Newer {{ i18n "newer" }}
</a> </a>
{{ end }} {{ end }}
{{ if $paginator.HasNext }} {{ if $paginator.HasNext }}
<a class="color-link older" href="{{ $paginator.Next.URL | relLangURL }}"> <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"> <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"> <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> <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>

View File

@ -2,9 +2,9 @@
{{ partial "social.html" . }} {{ partial "social.html" . }}
<div class="footer-mobile-links"> <div class="footer-mobile-links">
<p><a href="https://github.com/kimcc/hugo-theme-noteworthy" target="_blank" rel="noopener">Noteworthy theme</a></p> <p><a href="https://github.com/kimcc/hugo-theme-noteworthy" target="_blank" rel="noopener">{{ i18n "noteworthy_theme" }}</a></p>
<span class="divider-bar">|</span> <span class="divider-bar">|</span>
<p><a href="https://gohugo.io" target="_blank" rel="noopener">Built with Hugo</a></p> <p><a href="https://gohugo.io" target="_blank" rel="noopener">{{ i18n "built_with_hugo" }}</a></p>
</div> </div>
{{ $script := resources.Get "js/main.js" | minify | fingerprint -}} {{ $script := resources.Get "js/main.js" | minify | fingerprint -}}

View File

@ -1,8 +1,8 @@
<footer class="footer"> <footer class="footer">
{{ partial "social.html" . }} {{ 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://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">Built with Hugo</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 := resources.Get "js/main.js" | minify | fingerprint -}}
<script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script> <script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>