Make release-data time format localizable

pull/30924/head
Tim Bannister 2021-12-14 17:39:21 +00:00
parent 270bc93258
commit 3fcc2c812f
2 changed files with 9 additions and 4 deletions

View File

@ -217,6 +217,11 @@ other = ")"
[release_date_before]
other = "(released: "
# See https://gohugo.io/functions/format/#gos-layout-string
# Use a suitable format for your locale
[release_date_format]
other = "2006-01-02"
[seealso_heading]
other = "See Also"

View File

@ -7,20 +7,20 @@
{{ if not $data.previousPatches }}
<!-- initial minor release -->
<div>
<b class="release-inline-heading">{{ T "latest_release" }}</b><span class="release-inline-value">{{ printf "%s.0" $dataVersion }}{{ if isset $data "releaseDate" }} {{ T "release_date_before" }}{{ printf "%s" $data.releaseDate }}{{ T "release_date_after" }}{{- end -}}</span>
<b class="release-inline-heading">{{ T "latest_release" }}</b><span class="release-inline-value">{{ printf "%s.0" $dataVersion }}{{ if isset $data "releaseDate" }} {{ T "release_date_before" }}<time datetime="{{ time.Format "2006-01-02" $data.releaseDate }}">{{ time.Format ( T "release_date_format") $data.releaseDate }}</time>{{ T "release_date_after" }}{{- end -}}</span>
</div>
<div>
<b class="release-inline-heading">{{ T "end_of_life" }}</b><span class="release-eoldate release-inline-value">{{ printf "%s" $data.endOfLifeDate }}</span>
<b class="release-inline-heading">{{ T "end_of_life" }}</b><span class="release-eoldate release-inline-value"><time datetime="{{ time.Format "2006-01-02" $data.endOfLifeDate }}">{{ time.Format ( T "release_date_format") $data.endOfLifeDate }}</time></span>
</div>
<div>
<b class="release-inline-heading">{{ T "previous_patches" }}</b> <span class="notapplicable release-inline-value">{{ T "not_applicable" }}</span>
</div>
{{- else -}}
<div>
<b class="release-inline-heading">{{ T "latest_release" }}</b><span class="release-inline-value">{{ index $data.previousPatches 0 "release" }} {{ T "release_date_before" }}{{ printf "%s" ( index $data.previousPatches 0 "targetDate" ) }}{{ T "release_date_after" }}</span>
<b class="release-inline-heading">{{ T "latest_release" }}</b><span class="release-inline-value">{{ index $data.previousPatches 0 "release" }} {{ T "release_date_before" }}<time datetime="{{ time.Format "2006-01-02" ( index $data.previousPatches 0 "targetDate" ) }}">{{ time.Format ( T "release_date_format") ( index $data.previousPatches 0 "targetDate" ) }}</time>{{ T "release_date_after" }}</span>
</div>
<div>
<b class="release-inline-heading">{{ T "end_of_life" }}</b><span class="release-eoldate release-inline-value">{{ printf "%s" $data.endOfLifeDate }}</span>
<b class="release-inline-heading">{{ T "end_of_life" }}</b><span class="release-eoldate release-inline-value"><time datetime="{{ time.Format "2006-01-02" $data.endOfLifeDate }}">{{ time.Format ( T "release_date_format") $data.endOfLifeDate }}</time></span>
</div>
<div>
<b>{{ T "previous_patches" }}</b>