Merge missing translations (#10355)

* Merge missing translations

* Disable Norwegian
This commit is contained in:
Bjørn Erik Pedersen
2018-10-01 22:38:37 +03:00
committed by k8s-ci-robot
parent 4b77af7466
commit 32014f94b3
29 changed files with 2303 additions and 45 deletions
+23 -9
View File
@@ -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 }}
+13
View File
@@ -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 -}}