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
+10 -1
View File
@@ -1,5 +1,14 @@
{{ define "main" }}
{{ range (.Paginator 1).Pages }}
{{ $pages := ($.Paginator 1).Pages }}
{{ with $.Site.Params.language_alternatives }}
{{ range . }}
{{ with (where $.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge ($p.Paginator 1).Pages }}
{{ end }}
{{ end }}
{{ end }}
{{ range $pages }}
{{ .Render "post" }}
{{ end }}
<div class="PageNavigation">
+17 -7
View File
@@ -1,11 +1,20 @@
{{ define "main" }}
{{ $featured := where .Pages "Params.featured" true }}
{{ $pages := .Pages }}
{{ with $.Site.Params.language_alternatives }}
{{ range . }}
{{ with (where $.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge $p.Pages }}
{{ end }}
{{ end }}
{{ end }}
{{ $featured := (where $pages "Params.featured" true).ByWeight | first 4 }}
<section id="mainContent">
<main>
<div class="content">
<div class="case-studies">
{{ range $featured }}
{{ template "case-study-featured-block" . }}
{{ template "case-study-featured-block" (dict "ctx" $ "page" .) }}
{{ end }}
</div>
</div>
@@ -33,9 +42,9 @@
{{ end }}
<section id="users">
<main>
<h3>Kubernetes Users</h3>
<h3>{{ .Title }}</h3>
<div id="usersGrid">
{{ range .Pages.ByTitle }}
{{ range $pages.ByTitle }}
{{ $logo := .Resources.GetMatch "**logo*.png" }}
{{ $p := . }}
<a target="_blank" href="{{ with $p.Params.content_url }}{{ . | safeURL }}{{ else }}{{ .RelPermalink }}{{ end }}">{{ with $logo }}<img src="{{ .RelPermalink }}" alt="{{ $p.LinkTitle }}">{{ else }}
@@ -49,10 +58,11 @@
{{ .Content }}
{{ end }}
{{ define "case-study-featured-block" }}
{{ $logo := .Resources.GetMatch "**{feature,logo}*.png" }}
{{ $isForeignLanguage := (ne .page.Lang .ctx.Lang)}}
{{ $logo := .page.Resources.GetMatch "**{feature,logo}*.png" }}
<div class="case-study">
{{ with $logo }}<img src="{{ .RelPermalink }}" alt="{{ .Title }}">{{ end }}
<p class="quote">"{{ .Params.quote | html }}"</p>
<a href="{{ .RelPermalink }}">Read about {{ .LinkTitle }}</a>
<p class="quote">"{{ .page.Params.quote | html }}"</p>
<a href="{{ .RelPermalink }}"{{ if $isForeignLanguage }} target="_blank"{{ end }}>{{ T "main_read_about"}} {{ .page.LinkTitle }}</a>
</div>
{{ end }}
+7 -5
View File
@@ -2,8 +2,10 @@
{{ if not .Params.notitle }}
<h1>{{ .Title }}</h1>
{{ end }}
{{ if eq .Lang "en" }}
{{ template "docs-portal-user-journey" . }}
{{ partial "docs/browse.html" (where .Parent.Sections ".Params.toc_hide" "!=" true) }}
{{ end }}
{{ partial "docs/browse.html" .Parent }}
{{ end }}
{{ define "content-id" }}content{{ end }}
@@ -54,13 +56,13 @@
</div>
<div class="paths">
<div class="navButton users">Users</div>
<div class="navButton contributors">Contributors</div>
<a> <div class="navButton browse">Browse Docs</div></a>
<div class="navButton users">{{ T "docs_label_users" }}</div>
<div class="navButton contributors">{{ T "docs_label_contributors" }}</div>
<a> <div class="navButton browse">{{ T "docs_label_browse" }}</div></a>
</div>
<div id="cardWrapper">
<div class="display-bar">I AM...</div>
<div class="display-bar">{{ T "docs_label_i_am" }}</div>
<div class='cards' markdown="1">
<div class='docsection1' id='persona-definition'>.</div>
</div>
+5 -2
View File
@@ -26,8 +26,10 @@
<span class="tag-option"><a id="deselect-all-tags" href="javascript:void(0)">Deselect all</a></span>
</div>
<p>Click on the <a href="javascript:void(0)" class="no-underline">[+]</a> indicators below to get a longer explanation for any particular term.</p>
{{ $glossary_terms := (.Site.GetPage "page" "docs/reference/glossary").Resources.ByType "page" }}
{{ $glossary_terms := sort $glossary_terms "Title" "asc" }}
{{ partial "docs/glossary-terms.html" . }}
{{ $glossary_items := $.Scratch.Get "glossary_items" }}
{{ with $glossary_items }}
{{ $glossary_terms := sort . "Title" "asc" }}
<ul>
{{ range $glossary_terms }}
{{ $.Scratch.Set "tag_classes" "" }}
@@ -53,4 +55,5 @@
{{ end }}
</ul>
{{ end }}
{{ end }}
+12 -2
View File
@@ -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>
+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 -}}
+22 -12
View File
@@ -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 }}
+8 -4
View File
@@ -1,8 +1,11 @@
{{- $id := .Get "term_id" -}}
{{- $text := .Get "text" -}}
{{- $glossaryBundle := .Site.GetPage "page" "docs/reference/glossary" -}}
{{- $glossaryItems := $glossaryBundle.Resources.ByType "page" -}}
{{- $term_info := $glossaryItems.GetMatch (printf "%s*" $id ) -}}
{{- partial "docs/glossary-terms.html" $.Page -}}
{{- $glossary_items := $.Page.Scratch.Get "glossary_items" -}}
{{- if not $glossary_items -}}
{{- errorf "[%s] No glossary items found" .Page.Site.Language.Lang -}}
{{- else -}}
{{- $term_info := $glossary_items.GetMatch (printf "%s*" $id ) -}}
{{- if not $term_info -}}
{{- errorf "[%s] %q: %q is not a valid glossary term_id, see ./docs/reference/glossary/* for a full list" .Page.Site.Language.Lang .Page.Path $id -}}
{{- end }}
@@ -19,4 +22,5 @@
{{- $tooltip | safeHTML -}}
</span>
</a>
{{- end -}}
{{- end -}}
{{- end -}}