add i18n translation support (#156)
* add initial translation * readd _copy params to templates
This commit is contained in:
parent
e418548683
commit
76e4b7174a
17
i18n/de.toml
Normal file
17
i18n/de.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[more]
|
||||||
|
other = "Mehr"
|
||||||
|
|
||||||
|
[allTitle]
|
||||||
|
other = "Alle {{.Title }}"
|
||||||
|
|
||||||
|
[recentTitle]
|
||||||
|
other = "Neuste {{.Title }}"
|
||||||
|
|
||||||
|
[readMore]
|
||||||
|
other = "weiterlesen"
|
||||||
|
|
||||||
|
[whatsInThis]
|
||||||
|
other = "Was ist in dieser {{ .Type }}"
|
||||||
|
|
||||||
|
[related]
|
||||||
|
other = "Ähnliches"
|
17
i18n/en.toml
Normal file
17
i18n/en.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[more]
|
||||||
|
other = "More"
|
||||||
|
|
||||||
|
[allTitle]
|
||||||
|
other = "All {{.Title }}"
|
||||||
|
|
||||||
|
[recentTitle]
|
||||||
|
other = "Recent {{.Title }}"
|
||||||
|
|
||||||
|
[readMore]
|
||||||
|
other = "read more"
|
||||||
|
|
||||||
|
[whatsInThis]
|
||||||
|
other = "What's in this {{ .Type }}"
|
||||||
|
|
||||||
|
[related]
|
||||||
|
other = "Related"
|
|
@ -16,7 +16,7 @@
|
||||||
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}}
|
||||||
{{ with .Site.GetPage "section" $section_name }}
|
{{ with .Site.GetPage "section" $section_name }}
|
||||||
<h1 class="flex-none">
|
<h1 class="flex-none">
|
||||||
{{$.Param "recent_copy" | default "Recent" }} {{ .Title }}
|
{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }}
|
||||||
</h1>
|
</h1>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
{{ if ge $section_count (add $n_posts 1) }}
|
{{ if ge $section_count (add $n_posts 1) }}
|
||||||
<section class="w-100">
|
<section class="w-100">
|
||||||
<h1 class="f3">More</h1>
|
<h1 class="f3">{{ i18n "more" }}</h1>
|
||||||
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
|
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}}
|
||||||
{{ range (first 4 (after $n_posts $section)) }}
|
{{ range (first 4 (after $n_posts $section)) }}
|
||||||
<h2 class="f5 fw4 mb4 dib mr3">
|
<h2 class="f5 fw4 mb4 dib mr3">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}}
|
{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}}
|
||||||
{{ with .Site.GetPage "section" $section_name }}
|
{{ with .Site.GetPage "section" $section_name }}
|
||||||
<a href="{{ .URL }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">All {{.Title }}</a>
|
<a href="{{ .URL }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">{{ i18n "allTitle" . }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
{{- if .Params.toc -}}
|
{{- if .Params.toc -}}
|
||||||
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
||||||
<p class="f5 b mb3">What's in this {{ humanize .Type }}</p>
|
<p class="f5 b mb3">{{ i18n "whatsInThis" humanize .Type }}</p>
|
||||||
{{ .TableOfContents }}
|
{{ .TableOfContents }}
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
{{ with $related }}
|
{{ with $related }}
|
||||||
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
|
||||||
<p class="f5 b mb3">Related</p>
|
<p class="f5 b mb3">{{ i18n "related" }}</p>
|
||||||
<ul class="pa0 list">
|
<ul class="pa0 list">
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<li class="mb2">
|
<li class="mb2">
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
|
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
|
||||||
{{ .Summary }}
|
{{ .Summary }}
|
||||||
</div>
|
</div>
|
||||||
<a href="{{.URL}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{$.Param "read_more_copy" | default "read more" }}</a>
|
<a href="{{.URL}}" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">{{ $.Param "read_more_copy" | default (i18n "readMore") }}</a>
|
||||||
{{/* TODO: add author
|
{{/* TODO: add author
|
||||||
<p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
|
<p class="f6 lh-copy mv0">By {{ .Author }}</p> */}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue