From 63e411c12f0d2b75eb48be516f79af1039b4ba5c Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Sun, 26 Jan 2020 19:09:07 +0300 Subject: [PATCH] Fix #1: add i18n for en/ru --- README.md | 2 +- i18n/en.yaml | 29 +++++++++++++++++++++++++++++ i18n/ru.yaml | 29 +++++++++++++++++++++++++++++ layouts/_default/list.html | 2 +- layouts/_default/terms.html | 2 +- layouts/index.html | 2 +- layouts/partials/footer.html | 4 ++-- layouts/partials/pagination.html | 12 +++++++----- layouts/taxonomy/tag.html | 4 ++-- 9 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 i18n/en.yaml create mode 100644 i18n/ru.yaml diff --git a/README.md b/README.md index bb54244..4befc8a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ Example: languageCode: "en-us" baseUrl = "" title: "Anubis" -author: "" theme: "anubis" paginate: 10 disqusShortname: yourdiscussshortname @@ -43,6 +42,7 @@ menu: weight: 0 params: + author: "" description: "" images: - images/og-featured.png diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..252ab12 --- /dev/null +++ b/i18n/en.yaml @@ -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" \ No newline at end of file diff --git a/i18n/ru.yaml b/i18n/ru.yaml new file mode 100644 index 0000000..148c414 --- /dev/null +++ b/i18n/ru.yaml @@ -0,0 +1,29 @@ +powered: + other: "движок" + +theme: + other: "тема" + +readMore: + other: "читать дальше" + +toNewPosts: + other: "к новым записям" + +toOldPosts: + other: "к старым записям" + +tag: + other: "Тег" + +Tags: + other: "Теги" + +Posts: + other: "Записи" + +Categories: + other: "Категории" + +toAllTags: + other: "Ко списку всех тегов" \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f69cfd7..1ee2aa7 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,6 +1,6 @@ {{ define "main" }} -

{{ .Title }}

+

{{ i18n .Title }}

{{ range (.Site.RegularPages.GroupByPublishDate "2006") }} {{ range .Pages }}
diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 106d060..e81ab43 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,6 +1,6 @@ {{ define "main" }} -

{{ .Title }}

+

{{ i18n .Title }}

{{ .Summary }}
- Читать дальше + {{ i18n "readMore" | humanize }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 0f701eb..8bfa509 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,3 @@ -

© Дмитрий Колосов, 2020
-Движок Hugo, тема Anubis. +

© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}2020
+{{ i18n "powered" | humanize }} Hugo, {{ i18n "theme" }} Anubis.

\ No newline at end of file diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 037b142..1af2e3b 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -1,21 +1,23 @@ {{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }} + {{ $toNewPostsMessage := i18n "toNewPosts" | humanize }} + {{ $toOldPostsMessage := i18n "toOldPosts" | humanize }} diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html index 939c157..848d0c8 100644 --- a/layouts/taxonomy/tag.html +++ b/layouts/taxonomy/tag.html @@ -1,6 +1,6 @@ {{ define "main" }} -

Tag: {{ .Title }}

+

{{ i18n "tag" | humanize }}: {{ .Title }}

Ко списку всех тегов
@@ -19,7 +19,7 @@ {{ .Summary }}
- Читать дальше + {{ i18n "readMore" | humanize }}