Merge missing translations (#10355)
* Merge missing translations * Disable Norwegian
This commit is contained in:
committed by
k8s-ci-robot
parent
4b77af7466
commit
32014f94b3
@@ -1,5 +1,14 @@
|
||||
{{ $pages := .CurrentSection.Pages }}
|
||||
{{ with $.Site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.CurrentSection.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
{{ $pages = $pages | lang.Merge $p.Pages }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="panel-group" id="blog-archive">
|
||||
{{ range $i, $e := .CurrentSection.Pages.GroupByPublishDate "2006" }}
|
||||
{{ range $i, $e := $pages.GroupByPublishDate "2006" }}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
@@ -11,7 +20,8 @@
|
||||
<div class="panel-body">
|
||||
<ul class="list-group">
|
||||
{{ range .Pages }}
|
||||
<li class="list-group-item"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a> <span class="date">{{ .PublishDate.Format "Jan 2" }}</span> </li>
|
||||
{{ $isForeignLanguage := (ne .Lang $.Lang)}}
|
||||
<li class="list-group-item"><a href="{{ .Permalink }}"{{ if $isForeignLanguage }} target="_blank" {{ end }}>{{ .LinkTitle }}</a> <span class="date">{{ .PublishDate.Format "Jan 2" }}</span>{{ if $isForeignLanguage }} <small>({{ .Lang | upper }})</small>{{ end }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
|
||||
<div id='browsedocsWrapper'>
|
||||
<div class="browseheader" id="browsedocs">
|
||||
<a name="browsedocs">Browse Docs</a>
|
||||
<a name="browsedocs">{{ T "docs_label_browse" }}</a>
|
||||
</div>
|
||||
<div class="browsedocs">
|
||||
{{ range . }}
|
||||
{{ template "docs-browse-section" . }}
|
||||
{{ end }}
|
||||
{{ template "docs-browse-section" (dict "ctx" . "page" .) }}
|
||||
</div><!-- end browsedocs -->
|
||||
|
||||
|
||||
{{ define "docs-browse-section" }}
|
||||
{{ $pages := .page.Pages }}
|
||||
{{ $sections := .page.Sections }}
|
||||
{{ with $.ctx.Site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.page.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
{{ $pages = $pages | lang.Merge $p.Pages }}
|
||||
{{ $sections = $sections | lang.Merge $p.Sections }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $pages := where $pages ".Params.toc_hide" "!=" true }}
|
||||
{{ $sections := where $sections ".Params.toc_hide" "!=" true }}
|
||||
{{ if not .page.Parent.IsHome }}
|
||||
<div class="browsesection">
|
||||
<div class="docstitle">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ .Params.bigheader | default .Title }}</a></h3>
|
||||
<h3><a href="{{ .page.RelPermalink }}">{{ .page.Params.bigheader | default .page.Title }}</a></h3>
|
||||
</div>
|
||||
{{ $pages := .Pages | union .Sections }}
|
||||
{{ $pages := where $pages ".Params.toc_hide" "!=" true }}
|
||||
{{ if ge (len $pages) 1 }}
|
||||
<div class="pages">
|
||||
{{ $num_pages := len $pages }}
|
||||
@@ -27,7 +36,8 @@
|
||||
{{ if eq $offset 1 }}
|
||||
<div class="browsecolumn">
|
||||
{{ end }}
|
||||
<a href="{{ .RelPermalink }}">{{ printf "%02d - %s" (add $i 1) .LinkTitle }}</a><br>
|
||||
{{ $isForeignLanguage := (ne .Lang $.ctx.Lang)}}
|
||||
<a href="{{ .RelPermalink }}"{{ if $isForeignLanguage }} target="_blank" {{ end }}>{{ printf "%02d - %s" (add $i 1) .LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .Lang | upper }})</small>{{ end }}</a><br>
|
||||
{{ if or (eq $offset $column_size) (eq (add $i 1) $num_pages)}}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -37,3 +47,7 @@
|
||||
{{ end }}
|
||||
</div><!-- end browsesection -->
|
||||
{{ end }}
|
||||
{{ range $sections.ByWeight }}
|
||||
{{ template "docs-browse-section" (dict "ctx" $.ctx "page" .) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{{ $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" }}
|
||||
{{- if $glossaryBundle -}}
|
||||
{{ $pages := $glossaryBundle.Resources.ByType "page" }}
|
||||
{{- range $.Site.Params.language_alternatives -}}
|
||||
{{- with (where $glossaryBundle.Translations ".Lang" . ) -}}
|
||||
{{ $p := (index . 0) }}
|
||||
{{ $pages = $pages | lang.Merge ($p.Resources.ByType "page") }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $.Scratch.Set "glossary_items" $pages -}}
|
||||
{{- else -}}
|
||||
{{- errorf "[%s] Glossary Bundle not found for language. Create at least an index.md file inside docs/reference/glossary" .Page.Site.Language.Lang -}}
|
||||
{{- end -}}
|
||||
+22
-12
@@ -1,27 +1,37 @@
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ template "section-tree-nav" . }}
|
||||
{{ template "section-tree-nav" (dict "ctx" . "section" .) }}
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ $sections := where (union .Pages .Sections).ByWeight ".Params.toc_hide" "!=" true }}
|
||||
{{ $pages := (union .section.Pages .section.Sections) }}
|
||||
{{ with $.ctx.Site.Params.language_alternatives }}
|
||||
{{ range . }}
|
||||
{{ with (where $.section.Translations ".Lang" . ) }}
|
||||
{{ $p := index . 0 }}
|
||||
{{ $pages = $pages | lang.Merge (union $p.Pages $p.Sections) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $sections := where $pages.ByWeight ".Params.toc_hide" "!=" true }}
|
||||
{{ range $sections }}
|
||||
{{ if .IsPage }}
|
||||
{{ template "section-tree-nav-page" . }}
|
||||
{{ template "section-tree-nav-page" (dict "ctx" $.ctx "page" .) }}
|
||||
{{ else }}
|
||||
{{ template "section-tree-nav-section" . }}
|
||||
{{ template "section-tree-nav-section" (dict "ctx" $.ctx "section" .) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ define "section-tree-nav-section" }}
|
||||
<div class="item" data-title="{{ .LinkTitle }}">
|
||||
<div class="container">
|
||||
{{ if ge (len .Content) 10 }}
|
||||
<div class="item" data-title="{{ .section.LinkTitle }}">
|
||||
<div class="container">
|
||||
{{ if ge (len .section.Content) 10 }}
|
||||
{{/* The section page has content, so link to it. */}}
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ $isForeignLanguage := (ne .section.Lang $.ctx.Lang)}}
|
||||
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .section.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .section.Lang | upper }})</small>{{ end }}" href="{{ .section.RelPermalink }}"></a>
|
||||
{{ end }}
|
||||
{{ template "section-tree-nav" . }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ define "section-tree-nav-page" }}
|
||||
<a class="item" data-title="{{ .LinkTitle }}" href="{{ .RelPermalink }}"></a>
|
||||
{{ end }}
|
||||
|
||||
{{ $isForeignLanguage := (ne .page.Lang $.ctx.Lang)}}
|
||||
<a class="item" {{ if $isForeignLanguage }}target="_blank" {{ end }}data-title="{{ .page.LinkTitle }}{{ if $isForeignLanguage }} <small>({{ .page.Lang | upper }})</small>{{ end }}" href="{{ .page.RelPermalink }}"></a>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user