Adds translations for static texts

This commit is contained in:
Pierre Bourgeois
2023-02-05 20:09:51 +01:00
parent 6930cf2da2
commit aae2408ef7
6 changed files with 26 additions and 13 deletions
+13
View File
@@ -369,3 +369,16 @@ params:
readTime: readTime:
enable: true enable: true
content: "min read" content: "min read"
# For translations
terms:
read: "Read"
toc: "Table Of Contents"
copyright: "All rights reserved"
pageNotFound: "Page not found"
emailText: "Check out this site"
datesFormat:
article: "Jan 2, 2006"
articleList: "Jan 2, 2006"
articleRecent: "Jan 2, 2006"
+3 -3
View File
@@ -3,12 +3,12 @@
{{ end }} {{ end }}
{{ define "title" }} {{ define "title" }}
{{ .Site.Title }} | 404 page not found {{ .Site.Title }} | {{ .Site.Params.terms.pageNotFound | default "404 page not found" }}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
<div class="container py-5 text-center"> <div class="container py-5 text-center">
<img src="{{ .Site.Params.staticPath }}/404.png" alt="404 page not found" class="img-fluid" width="40%"> <img src="{{ .Site.Params.staticPath }}/404.png" alt='{{ .Site.Params.terms.pageNotFound | default "404 page not found" }}' class="img-fluid" width="40%">
<h1>404 Page Not Found</h1> <h1>{{ .Site.Params.terms.pageNotFound | default "404 page not found" }}</h1>
</div> </div>
{{ end }} {{ end }}
+2 -2
View File
@@ -31,8 +31,8 @@
</div> </div>
</div> </div>
<div class="mt-auto post-footer bg-transparent py-3"> <div class="mt-auto post-footer bg-transparent py-3">
<span class="float-start bg-transparent">{{ .Date.Format "January 2, 2006" }}</span> <span class="float-start bg-transparent">{{ .Date.Format (.Site.Params.datesFormat.articleList | default "January 2, 2006") }}</span>
<a href="{{ .RelPermalink }}" class="float-end btn btn-outline-info btn-sm">Read</a> <a href="{{ .RelPermalink }}" class="float-end btn btn-outline-info btn-sm">{{ .Site.Params.terms.read | default "Read" }}</a>
</div> </div>
</div> </div>
</div> </div>
+5 -5
View File
@@ -21,7 +21,7 @@
<div class="text-center"> <div class="text-center">
{{ .Params.author }} {{ .Params.author }}
<small>|</small> <small>|</small>
{{ .Date.Format "Jan 2, 2006" }} {{ .Date.Format (.Site.Params.datesFormat.article | default "Jan 2, 2006") }}
{{ if or (.Site.Params.singlePages.readTime.enable | default true) (.Params.enableReadingTime) }} {{ if or (.Site.Params.singlePages.readTime.enable | default true) (.Params.enableReadingTime) }}
<span id="readingTime"> <span id="readingTime">
@@ -45,7 +45,7 @@
{{ if .Params.toc | default true}} {{ if .Params.toc | default true}}
<aside class="toc"> <aside class="toc">
<h5> <h5>
Table Of Contents {{ .Site.Params.terms.toc | default "Table Of Contents" }}
</h5> </h5>
<div class="toc-content"> <div class="toc-content">
{{.TableOfContents}} {{.TableOfContents}}
@@ -55,7 +55,7 @@
{{ if .Params.tags }} {{ if .Params.tags }}
<aside class="tags"> <aside class="tags">
<h5>Tags</h5> <h5>{{ .Site.Params.terms.tags | default "Tags" }}</h5>
<ul class="tags-ul list-unstyled list-inline"> <ul class="tags-ul list-unstyled list-inline">
{{range .Params.tags}} {{range .Params.tags}}
<li class="list-inline-item"><a href="{{`tags` | absURL}}/{{.| urlize}}" target="_blank">{{.}}</a></li> <li class="list-inline-item"><a href="{{`tags` | absURL}}/{{.| urlize}}" target="_blank">{{.}}</a></li>
@@ -66,7 +66,7 @@
{{ if .Params.socialShare | default true }} {{ if .Params.socialShare | default true }}
<aside class="social"> <aside class="social">
<h5>Social</h5> <h5>{{ .Site.Params.terms.social | default "Social" }}</h5>
<div class="social-content"> <div class="social-content">
<ul class="list-inline"> <ul class="list-inline">
<li class="list-inline-item text-center"> <li class="list-inline-item text-center">
@@ -80,7 +80,7 @@
</a> </a>
</li> </li>
<li class="list-inline-item text-center"> <li class="list-inline-item text-center">
<a target="_blank" href="mailto:?subject={{ .Title }}&amp;body=Check out this site {{ .Site.Params.hostName }}{{ .Permalink | absURL }}"> <a target="_blank" href='mailto:?subject={{ .Title }}&amp;body={{ .Site.Params.terms.emailText | default "Check out this site" }} {{ .Site.Params.hostName }}{{ .Permalink | absURL }}'>
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
</a> </a>
</li> </li>
@@ -7,7 +7,7 @@
height="40px" width="40px"> height="40px" width="40px">
</a> </a>
</div> </div>
&copy; {{ now.Format "2006"}} {{ .Site.Params.copyright }} All Rights Reserved &copy; {{ now.Format "2006"}} {{ .Site.Params.copyright }} {{ .Site.Params.terms.copyright | default "All Rights Reserved" }}
<div class="text-secondary"> <div class="text-secondary">
Made with Made with
<span class="text-danger"> <span class="text-danger">
@@ -26,8 +26,8 @@
</div> </div>
</div> </div>
<div class="mt-auto card-footer"> <div class="mt-auto card-footer">
<span class="float-start">{{ .Date.Format "January 2, 2006" }}</span> <span class="float-start">{{ .Date.Format (.Site.Params.datesFormat.articleRecent | default "January 2, 2006") }}</span>
<a href="{{ .RelPermalink }}" class="float-end btn btn-outline-info btn-sm">Read</a> <a href="{{ .RelPermalink }}" class="float-end btn btn-outline-info btn-sm">{{ .Site.Params.terms.read | default "Read" }}</a>
</div> </div>
</div> </div>
</div> </div>