Skip to content

Commit

Permalink
Added i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl van Heijster authored and Karl van Heijster committed May 21, 2021
1 parent 1f2eecb commit 86e4e6f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 8 deletions.
12 changes: 12 additions & 0 deletions data/months_nl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1: "januari"
2: "februari"
3: "maart"
4: "april"
5: "mei"
6: "juni"
7: "juli"
8: "augustus"
9: "september"
10: "oktober"
11: "november"
12: "december"
3 changes: 3 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ other = "Older posts"
[poweredby]
other = "Powered by <a href='http://www.gohugo.io/'>Hugo</a> Theme By <a href='https://github.com/nodejh/hugo-theme-cactus-plus'>nodejh</a>"

[publishdate]
other = "{{ .PublishDate.Format \"January 2, 2006\" }}"

[readmore]
other = "Read more"

Expand Down
29 changes: 29 additions & 0 deletions i18n/nl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[404title]
other = "404 - Pagina Niet Gevonden"

[404subtitle]
other = "De pagina waar u naar op zoek bent, lijkt niet te bestaan."

[minuteread]
other = "minuten leestijd"

[postsnewer]
other = "Nieuwere posts"

[postsolder]
other = "Oudere posts"

[poweredby]
other = "Gemaakt met <a href='http://www.gohugo.io/'>Hugo</a> Thema door <a href='https://github.com/nodejh/hugo-theme-cactus-plus'>nodejh</a>"

[publishdate]
other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_nl (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}"

[readmore]
other = "Lees meer"

[word]
other = "woord"

[words]
other = "woorden"
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h3 class="key">
{{ range .Pages }}
<div class="value">
<div class="date">
{{ .Date.Format "Jan 2" }}
<time datetime="{{ .PublishDate }}">{{ i18n "publishdate" . }}</time>
</div>
<div class="title">
<a href="{{ .Permalink }}">
Expand Down
4 changes: 1 addition & 3 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
<h1 class="title">{{ .Title }}</h1>

<div class="tip">
<span>
{{ .Date.Format "Jan 2, 2006 15:04" }}
</span>
<time datetime="{{ .PublishDate }}">{{ i18n "publishdate" . }}</time>
<span class="split">
·
</span>
Expand Down
7 changes: 4 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
{{ range $paginator.Pages }}
{{ $title := .Title }}
{{ $summary := .Summary }}
{{ $date := dateFormat "Jan 2, 2006" .Date }}
<section class="item">
<div>
<h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
<div class="date">{{ $date }}</div>
<h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
<div class ="date">
<time datetime="{{ .PublishDate }}">{{ i18n "publishdate" . }}</time>
</div>
</div>

<div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
{{ end }}
</p>
<p class="powerby">
{{ i18n "poweredby" }}
{{ i18n "poweredby" | safeHTML }}
</p>
</footer>

0 comments on commit 86e4e6f

Please sign in to comment.