diff options
author | Jimmy Cai <jimmehcai@gmail.com> | 2020-12-19 03:41:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-19 03:41:26 +0300 |
commit | d2057533233c480fde3c526d865cfb1276d6b4ef (patch) | |
tree | 97ee8741ce7a1e1802338dc749826479de952530 /layouts | |
parent | e9c1abac934739ee1757569446b36b5876a62834 (diff) |
refactor(i18n): translation key renaming (#68)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/63
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/404.html | 4 | ||||
-rw-r--r-- | layouts/_default/archives.html | 2 | ||||
-rw-r--r-- | layouts/page/search.html | 6 | ||||
-rw-r--r-- | layouts/partials/article/components/footer.html | 2 | ||||
-rw-r--r-- | layouts/partials/article/components/related-contents.html | 2 | ||||
-rw-r--r-- | layouts/partials/footer/footer.html | 4 | ||||
-rw-r--r-- | layouts/partials/widget/archives.html | 4 | ||||
-rw-r--r-- | layouts/partials/widget/search.html | 4 | ||||
-rw-r--r-- | layouts/partials/widget/tag-cloud.html | 2 |
9 files changed, 15 insertions, 15 deletions
diff --git a/layouts/404.html b/layouts/404.html index dd5e49d..b89d2b6 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,7 +1,7 @@ {{ define "main" }} <div class="not-found-card"> - <h1 class="article-title">{{ T "notFoundTitle" }}</h1> - <h2 class="article-subtitle">{{ T "notFoundSubtitle" }}</h2> + <h1 class="article-title">{{ T "notFound.title" }}</h1> + <h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2> </div> {{ partialCached "footer/footer" . }} {{ end }}
\ No newline at end of file diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 0071565..1a681e9 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -2,7 +2,7 @@ {{ define "main" }} {{ $categories := ($.Site.GetPage "taxonomyTerm" "categories").Pages }} {{ if $categories }} - <h2 class="section-title">{{ T "categoriesTitle" }}</h2> + <h2 class="section-title">{{ T "archives.categories" }}</h2> <div class="category-list"> <div class="article-list--tile"> {{ range $categories }} diff --git a/layouts/page/search.html b/layouts/page/search.html index 6078ac1..259d398 100644 --- a/layouts/page/search.html +++ b/layouts/page/search.html @@ -7,8 +7,8 @@ {{ define "main" }} <form action="{{ .Permalink }}" class="search-form"{{ with .OutputFormats.Get "json" -}} data-json="{{ .Permalink }}"{{- end }}> <p> - <label>{{ T "searchTitle" }}</label> - <input name="keyword" placeholder="{{ T `searchPlaceholder` }}" /> + <label>{{ T "search.title" }}</label> + <input name="keyword" placeholder="{{ T `search.placeholder` }}" /> </p> <button title="Search"> @@ -20,7 +20,7 @@ <div class="search-result--list article-list--compact"></div> <script> - window.searchResultTitleTemplate = "{{ T `searchResultTitle` }}" + window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}" </script> {{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}} diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 7ea46ec..f518d76 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -12,7 +12,7 @@ <section class="article-time"> {{ partial "helper/icon" "clock" }} <span class="article-time--modified"> - {{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }} + {{ T "article.lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }} </span> </section> {{- end -}} diff --git a/layouts/partials/article/components/related-contents.html b/layouts/partials/article/components/related-contents.html index 94063ef..810b8e9 100644 --- a/layouts/partials/article/components/related-contents.html +++ b/layouts/partials/article/components/related-contents.html @@ -1,7 +1,7 @@ <aside class="related-contents--wrapper"> {{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }} {{ with $related }} - <h2 class="section-title">{{ T "relatedContents" }}</h2> + <h2 class="section-title">{{ T "article.relatedContents" }}</h2> <div class="related-contents"> <div class="flex article-list--tile"> {{ range . }} diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 6bd37b2..2443f4c 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -6,7 +6,7 @@ {{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="%s">Stack</a></b>` $ThemeVersion -}} {{- $DesignedBy := `<a href="https://jimmycai.com" target="_blank" rel="noopener">Jimmy</a>` -}} - {{ T "footerBuiltWith" (dict "Generator" $Generator) | safeHTML }} <br /> - {{ T "footerDesignedBy" (dict "Theme" $Theme "DesignedBy" $DesignedBy) | safeHTML }} + {{ T "footer.builtWith" (dict "Generator" $Generator) | safeHTML }} <br /> + {{ T "footer.designedBy" (dict "Theme" $Theme "DesignedBy" $DesignedBy) | safeHTML }} </section> </footer>
\ No newline at end of file diff --git a/layouts/partials/widget/archives.html b/layouts/partials/widget/archives.html index 038b669..950dbf2 100644 --- a/layouts/partials/widget/archives.html +++ b/layouts/partials/widget/archives.html @@ -2,7 +2,7 @@ <div class="widget-icon"> {{ partial "helper/icon" "infinity" }} </div> - <h2 class="widget-title section-title">{{ T "widgetArchivesTitle" }}</h2> + <h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2> {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} @@ -15,7 +15,7 @@ <div class="archives-year"> <a href="{{ $.Site.Params.widgets.archives.path | relLangURL }}#{{ $id }}"> {{ if eq $index $.Site.Params.widgets.archives.limit }} - <span class="year">{{ T "widgetArchivesMore" }}</span> + <span class="year">{{ T "widget.archives.more" }}</span> {{ else }} <span class="year">{{ .Key }}</span> <span class="count">{{ len $item.Pages }}</span> diff --git a/layouts/partials/widget/search.html b/layouts/partials/widget/search.html index fc6d525..2275eb9 100644 --- a/layouts/partials/widget/search.html +++ b/layouts/partials/widget/search.html @@ -1,7 +1,7 @@ <form action="/search" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}> <p> - <label>{{ T "searchTitle" }}</label> - <input name="keyword" required placeholder="{{ T `searchPlaceholder` }}" /> + <label>{{ T "search.title" }}</label> + <input name="keyword" required placeholder="{{ T `search.placeholder` }}" /> <button title="Search"> {{ partial "helper/icon" "search" }} diff --git a/layouts/partials/widget/tag-cloud.html b/layouts/partials/widget/tag-cloud.html index 39e7c9a..99b8e59 100644 --- a/layouts/partials/widget/tag-cloud.html +++ b/layouts/partials/widget/tag-cloud.html @@ -2,7 +2,7 @@ <div class="widget-icon"> {{ partial "helper/icon" "tag" }} </div> - <h2 class="widget-title section-title">{{ T "widgetTagCloudTitle" }}</h2> + <h2 class="widget-title section-title">{{ T "widget.tagCloud.title" }}</h2> <div class="tagCloud-tags"> {{ range first .Site.Params.widgets.tagCloud.limit .Site.Taxonomies.tags.ByCount }} |