Move hard-coded strings to i18n files
Add translations in English and in Japanese
This commit is contained in:
parent
1c26fe2526
commit
0f74f45531
34
i18n/en.yaml
Normal file
34
i18n/en.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
# Content
|
||||
- id: dateFormat
|
||||
translation: "January 2, 2006"
|
||||
- id: postedOnDate
|
||||
translation: "Posted on {{ .Count }}"
|
||||
- id: readMore
|
||||
translation: "Read More"
|
||||
- id: olderPosts
|
||||
translation: "Older Posts"
|
||||
- id: newerPosts
|
||||
translation: "Newer Posts"
|
||||
- id: previousPost
|
||||
translation: "Previous Post"
|
||||
- id: nextPost
|
||||
translation: "Next Post"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
translation: "Whoops, this page doesn't exist. Move along. (404 error)"
|
||||
|
||||
# Footer
|
||||
- id: poweredBy # Accepts HTML
|
||||
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered • Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
|
||||
|
||||
# Navigation
|
||||
- id: toggleNavigation
|
||||
translation: "Toggle navigation"
|
||||
- id: gcseLabelShort
|
||||
translation: "Search"
|
||||
- id: gcseLabelLong
|
||||
translation: "Search {{ .Site.Title }}"
|
||||
- id: gcseClose
|
||||
translation: "Close"
|
||||
|
34
i18n/ja.yaml
Normal file
34
i18n/ja.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
# Content
|
||||
- id: dateFormat
|
||||
translation: "2006年1月2日"
|
||||
- id: postedOnDate
|
||||
translation: "{{ .Count }}に投稿"
|
||||
- id: readMore
|
||||
translation: "続きを読む"
|
||||
- id: olderPosts
|
||||
translation: "古いページ"
|
||||
- id: newerPosts
|
||||
translation: "新しいページ"
|
||||
- id: previousPost
|
||||
translation: "前ページ"
|
||||
- id: nextPost
|
||||
translation: "次ページ"
|
||||
|
||||
# 404 page
|
||||
- id: pageNotFound
|
||||
translation: "おっと、このページが存在しない。他にあたってください。(404エラー)"
|
||||
|
||||
# Footer
|
||||
- id: poweredBy # Accepts HTML
|
||||
translation: '起動力に<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> • テーマに<a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>に基づいている<a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
|
||||
|
||||
# Navigation
|
||||
- id: toggleNavigation
|
||||
translation: "メニューを切り替え"
|
||||
- id: gcseLabelShort
|
||||
translation: "検索"
|
||||
- id: gcseLabelLong
|
||||
translation: "{{ .Site.Title }}を検索"
|
||||
- id: gcseClose
|
||||
translation: "閉じる"
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
<div role="main" class="container main-content">
|
||||
<div class="text-center">
|
||||
<h1>Whoops, this page doesn't exist.</h1>
|
||||
<h1>Move along. (404 error)</h1>
|
||||
<h1>{{ i18n "pageNotFound" }}</h1>
|
||||
<br/>
|
||||
<img src="{{ .Site.BaseURL }}/img/404-southpark.jpg" />
|
||||
</div>
|
||||
|
@ -39,12 +39,12 @@
|
||||
</a>
|
||||
|
||||
<p class="post-meta">
|
||||
Posted on {{ .Date.Format (default "January 2, 2006" .Site.Params.dateFormat) }}
|
||||
{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
|
||||
</p>
|
||||
<div class="post-entry">
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary }}
|
||||
<a href="{{ .Permalink }}" class="post-read-more">[Read More]</a>
|
||||
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
|
@ -31,12 +31,12 @@
|
||||
</a>
|
||||
|
||||
<p class="post-meta">
|
||||
Posted on {{ .Date.Format (default "January 2, 2006" .Site.Params.dateFormat) }}
|
||||
{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}
|
||||
</p>
|
||||
<div class="post-entry">
|
||||
{{ if .Truncated }}
|
||||
{{ .Summary }}
|
||||
<a href="{{ .Permalink }}" class="post-read-more">[Read More]</a>
|
||||
<a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
@ -58,12 +58,12 @@
|
||||
<ul class="pager main-pager">
|
||||
{{ if .Paginator.HasPrev }}
|
||||
<li class="previous">
|
||||
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← Newer Posts</a>
|
||||
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n "newerPosts" }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .Paginator.HasNext }}
|
||||
<li class="next">
|
||||
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">Older Posts →</a>
|
||||
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} →</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
@ -38,7 +38,7 @@
|
||||
</p>
|
||||
<!-- Please don't remove this, keep my open source work credited :) -->
|
||||
<p class="credits theme-by text-muted">
|
||||
<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered • Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>
|
||||
{{ i18n "poweredBy" . | safeHTML }}
|
||||
{{ with .Site.Params.commit }} • [<a href="{{.}}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if eq .Type "post" }}
|
||||
<span class="post-meta">Posted on {{ .Date.Format (default "January 2, 2006" .Site.Params.dateFormat) }}</span>
|
||||
<span class="post-meta">{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if eq .Type "post" }}
|
||||
<span class="post-meta">Posted on {{ .Date.Format (default "January 2, 2006" .Site.Params.dateFormat) }}</span>
|
||||
<span class="post-meta">{{ default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format | i18n "postedOnDate" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="sr-only">{{ i18n "toggleNavigation" }}</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
@ -31,7 +31,7 @@
|
||||
{{ if isset .Site.Params "gcse" }}
|
||||
<li>
|
||||
<a href="#modalSearch" data-toggle="modal" data-target="#modalSearch" style="outline: none;">
|
||||
<span class="hidden-sm hidden-md hidden-lg">Search</span> <span id="searchGlyph" class="glyphicon glyphicon-search"></span>
|
||||
<span class="hidden-sm hidden-md hidden-lg">{{ i18n "gcseLabelShort" }}</span> <span id="searchGlyph" class="glyphicon glyphicon-search"></span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
@ -58,13 +58,13 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Search {{ .Site.Title }}</h4>
|
||||
<h4 class="modal-title">{{ i18n "gcseLabelLong" . }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<gcse:search></gcse:search>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ i18n "gcseClose" }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,12 +8,12 @@
|
||||
<ul class="pager blog-pager">
|
||||
{{ if .PrevInSection }}
|
||||
<li class="previous">
|
||||
<a href="{{ .PrevInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title }}">← Previous Post</a>
|
||||
<a href="{{ .PrevInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title }}">← {{ i18n "previousPost" }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if .NextInSection }}
|
||||
<li class="next">
|
||||
<a href="{{ .NextInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title }}">Next Post →</a>
|
||||
<a href="{{ .NextInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title }}">{{ i18n "nextPost" }} →</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user