Fix #1: add i18n for en/ru
This commit is contained in:
parent
0f60a781eb
commit
63e411c12f
@ -28,7 +28,6 @@ Example:
|
|||||||
languageCode: "en-us"
|
languageCode: "en-us"
|
||||||
baseUrl = ""
|
baseUrl = ""
|
||||||
title: "Anubis"
|
title: "Anubis"
|
||||||
author: ""
|
|
||||||
theme: "anubis"
|
theme: "anubis"
|
||||||
paginate: 10
|
paginate: 10
|
||||||
disqusShortname: yourdiscussshortname
|
disqusShortname: yourdiscussshortname
|
||||||
@ -43,6 +42,7 @@ menu:
|
|||||||
weight: 0
|
weight: 0
|
||||||
|
|
||||||
params:
|
params:
|
||||||
|
author: ""
|
||||||
description: ""
|
description: ""
|
||||||
images:
|
images:
|
||||||
- images/og-featured.png
|
- images/og-featured.png
|
||||||
|
29
i18n/en.yaml
Normal file
29
i18n/en.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
powered:
|
||||||
|
other: "powered by"
|
||||||
|
|
||||||
|
theme:
|
||||||
|
other: "theme"
|
||||||
|
|
||||||
|
readMore:
|
||||||
|
other: "read more"
|
||||||
|
|
||||||
|
toNewPosts:
|
||||||
|
other: "to new posts"
|
||||||
|
|
||||||
|
toOldPosts:
|
||||||
|
other: "to old posts"
|
||||||
|
|
||||||
|
tag:
|
||||||
|
other: "tag"
|
||||||
|
|
||||||
|
Tags:
|
||||||
|
other: "tags"
|
||||||
|
|
||||||
|
Posts:
|
||||||
|
other: "Posts"
|
||||||
|
|
||||||
|
Categories:
|
||||||
|
other: "Categories"
|
||||||
|
|
||||||
|
toAllTags:
|
||||||
|
other: "To all tags"
|
29
i18n/ru.yaml
Normal file
29
i18n/ru.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
powered:
|
||||||
|
other: "движок"
|
||||||
|
|
||||||
|
theme:
|
||||||
|
other: "тема"
|
||||||
|
|
||||||
|
readMore:
|
||||||
|
other: "читать дальше"
|
||||||
|
|
||||||
|
toNewPosts:
|
||||||
|
other: "к новым записям"
|
||||||
|
|
||||||
|
toOldPosts:
|
||||||
|
other: "к старым записям"
|
||||||
|
|
||||||
|
tag:
|
||||||
|
other: "Тег"
|
||||||
|
|
||||||
|
Tags:
|
||||||
|
other: "Теги"
|
||||||
|
|
||||||
|
Posts:
|
||||||
|
other: "Записи"
|
||||||
|
|
||||||
|
Categories:
|
||||||
|
other: "Категории"
|
||||||
|
|
||||||
|
toAllTags:
|
||||||
|
other: "Ко списку всех тегов"
|
@ -1,6 +1,6 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ i18n .Title }}</h1>
|
||||||
{{ range (.Site.RegularPages.GroupByPublishDate "2006") }}
|
{{ range (.Site.RegularPages.GroupByPublishDate "2006") }}
|
||||||
{{ range .Pages }}
|
{{ range .Pages }}
|
||||||
<div class="post-short-list">
|
<div class="post-short-list">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ i18n .Title }}</h1>
|
||||||
|
|
||||||
<ul class="terms">
|
<ul class="terms">
|
||||||
{{ range $key, $value := .Data.Terms }}
|
{{ range $key, $value := .Data.Terms }}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
<div class="read-more">
|
<div class="read-more">
|
||||||
<a href="{{ .RelPermalink }}">Читать дальше</a>
|
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<p>© Дмитрий Колосов, 2020<br>
|
<p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}2020<br>
|
||||||
Движок <a target="_blank" href="https://gohugo.io/">Hugo</a>, тема <a target="_blank" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
|
{{ i18n "powered" | humanize }} <a target="_blank" href="https://gohugo.io/">Hugo</a>, {{ i18n "theme" }} <a target="_blank" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
|
||||||
</p>
|
</p>
|
@ -1,21 +1,23 @@
|
|||||||
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
|
{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }}
|
||||||
|
{{ $toNewPostsMessage := i18n "toNewPosts" | humanize }}
|
||||||
|
{{ $toOldPostsMessage := i18n "toOldPosts" | humanize }}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
{{ if .Paginator.HasPrev }}
|
{{ if .Paginator.HasPrev }}
|
||||||
{{ if eq .Paginator.PageNumber 2 }}
|
{{ if eq .Paginator.PageNumber 2 }}
|
||||||
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">К новым постам</a>
|
<a class="pagination-item" href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">К новым постам</a>
|
<a class="pagination-item" href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="pagination-item disabled">К новым постам</span>
|
<span class="pagination-item disabled">{{ $toNewPostsMessage }}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
{{ if .Paginator.HasNext }}
|
{{ if .Paginator.HasNext }}
|
||||||
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">К старым постам</a>
|
<a class="pagination-item" href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="pagination-item disabled">К старым постам</span>
|
<span class="pagination-item disabled">{{ $toOldPostsMessage }}</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
<h1>Tag: {{ .Title }}</h1>
|
<h1>{{ i18n "tag" | humanize }}: {{ .Title }}</h1>
|
||||||
<div class="article-info">
|
<div class="article-info">
|
||||||
<a href="/tags/">Ко списку всех тегов</a>
|
<a href="/tags/">Ко списку всех тегов</a>
|
||||||
</div>
|
</div>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
<div class="read-more">
|
<div class="read-more">
|
||||||
<a href="{{ .RelPermalink }}">Читать дальше</a>
|
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
Reference in New Issue
Block a user