Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azmelanar/hugo-theme-pixyll.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Slupytskyi <dslupytskyi@gmail.com>2017-08-31 09:46:16 +0300
committerGitHub <noreply@github.com>2017-08-31 09:46:16 +0300
commit63507fbc4b65b9054ffcb11679e03b08ae72506d (patch)
tree7d74789d475aeaa3c214ac61bdcea9fdf80808d2
parentb0c1a50ce6c8e972e55482197d4963755e21dd77 (diff)
parent24974957fb759131a6239b4a2cc4bfe1eb63d887 (diff)
Merge pull request #14 from azmelanar/language-menu
Proper translation of navigation
-rw-r--r--exampleSite/content/about.ru.md9
-rw-r--r--exampleSite/content/contact.ru.md15
-rw-r--r--i18n/en.toml11
-rw-r--r--i18n/ru.toml11
-rw-r--r--layouts/partials/navigation.html8
5 files changed, 50 insertions, 4 deletions
diff --git a/exampleSite/content/about.ru.md b/exampleSite/content/about.ru.md
new file mode 100644
index 0000000..b325654
--- /dev/null
+++ b/exampleSite/content/about.ru.md
@@ -0,0 +1,9 @@
++++
+date = "2014-11-08T16:42:18+04:00"
+draft = false
+title = "О нас"
+slug = "about"
+
++++
+
+Пару слов о проекте.
diff --git a/exampleSite/content/contact.ru.md b/exampleSite/content/contact.ru.md
new file mode 100644
index 0000000..b717b53
--- /dev/null
+++ b/exampleSite/content/contact.ru.md
@@ -0,0 +1,15 @@
++++
+date = "2014-11-09T13:49:44+04:00"
+draft = true
+title = "Контакты"
+slug = "contact"
+
++++
+
+<div class="py2">
+ <form action="//formspree.io/your@email.address" method="POST" class="form-stacked form-light">
+ <input type="text" name="email" class="input mobile-block" placeholder="Почтовый адрес">
+ <textarea type="text" name="content" class="input mobile-block" rows="5" placeholder="Чтобы вы хотели сказать?"></textarea>
+ <input type="submit" class="button button-blue button-big mobile-block" value="Отправить">
+ </form>
+</div>
diff --git a/i18n/en.toml b/i18n/en.toml
new file mode 100644
index 0000000..92dab17
--- /dev/null
+++ b/i18n/en.toml
@@ -0,0 +1,11 @@
+[about]
+other = "About"
+
+[contact]
+other = "Contact"
+
+[tags]
+other = "Tags"
+
+[search]
+other = "Search"
diff --git a/i18n/ru.toml b/i18n/ru.toml
new file mode 100644
index 0000000..7106711
--- /dev/null
+++ b/i18n/ru.toml
@@ -0,0 +1,11 @@
+[about]
+other = "О нас"
+
+[contact]
+other = "Контакты"
+
+[tags]
+other = "Теги"
+
+[search]
+other = "Поиск"
diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html
index d15568e..8ba1dc0 100644
--- a/layouts/partials/navigation.html
+++ b/layouts/partials/navigation.html
@@ -1,6 +1,6 @@
-<a href="/about/">About</a>
-<a href="/tags">Tags</a>
-<a href="/contact/">Contact</a>
+<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}/about/">{{ i18n "about" }}</a>
+<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}/tags/">{{ i18n "tags" }}</a>
+<a href="{{ .Site.BaseURL }}{{ .Site.LanguagePrefix }}/contact/">{{ i18n "contact" }}</a>
{{- if .Site.IsMultiLingual -}}
{{- range $lang := .Site.Languages -}}
{{- if ne $.Site.Language $lang -}}
@@ -11,6 +11,6 @@
{{ if isset .Site.Params "search_engine" }}
<form class="navbar-search" action="{{ .Site.BaseURL }}/search/index.html"
onsubmit="return validateForm(this.elements['q'].value);">
- <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input">
+ <input type="text" class="search-query" placeholder="{{ i18n "search" }}" name="q" id="tipue_search_input">
{{ end }}
</form>