From 8ce081cd8e7fdc735c4b2d029b12f96ed6a3110c Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Fri, 8 Jun 2018 18:22:10 +0200 Subject: [PATCH] use i18n for most strings --- site/layouts/index.html | 51 ++++++------------- site/layouts/partials/404.html | 6 +-- site/layouts/partials/about.html | 17 ++----- site/layouts/partials/action-box.html | 2 +- site/layouts/partials/action.html | 8 +-- site/layouts/partials/arguments.html | 8 +-- .../layouts/partials/functions/sign-form.html | 18 +++---- site/layouts/partials/head.html | 6 +-- site/layouts/partials/language.html | 3 +- site/layouts/partials/legal.html | 12 ++--- site/layouts/partials/nav.html | 8 +-- site/layouts/partials/organisations.html | 4 +- site/layouts/partials/resources.html | 2 +- site/layouts/partials/sharecolumn.html | 2 +- site/layouts/partials/spread.html | 17 ++----- site/layouts/partials/start.html | 14 ++--- site/layouts/partials/sub-pages/action.html | 2 +- site/layouts/partials/sub-pages/navbar.html | 10 ++-- site/layouts/partials/sub-pages/sigtable.html | 21 ++++---- site/layouts/shortcodes/fsdefinition.html | 6 +-- site/layouts/shortcodes/show_signatures.html | 6 +-- 21 files changed, 89 insertions(+), 134 deletions(-) diff --git a/site/layouts/index.html b/site/layouts/index.html index 53e7d8d..1ecde47 100644 --- a/site/layouts/index.html +++ b/site/layouts/index.html @@ -5,44 +5,23 @@ {{ partial "head.html" . }} - {{ if or .Site.Params.navigation.links.about .Site.Params.navigation.links.reasons .Site.Params.navigation.links.resources .Site.Params.navigation.links.contact }} - {{ partial "nav.html" . }} - {{ end }} - - {{ if .Site.Params.start }} - {{ partial "start.html" . }} - {{ end }} - - {{ if .Site.Params.about }} - {{ partial "about.html" . }} - {{ end }} - - {{ if .Site.Params.arguments.list }} - {{ partial "arguments.html" . }} - {{ end }} - - {{ if .Site.Params.action }} - {{ partial "action.html" . }} - {{ end }} - - {{ if .Site.Params.organisations }} - {{ partial "organisations.html" . }} - {{ end }} - - - - {{ if .Site.Params.spread }} - {{ partial "spread.html" . }} - {{ end }} - {{ if .Site.Params.language }} - {{ partial "language.html" . }} - {{ end }} + {{ partial "nav.html" . }} + {{ partial "start.html" . }} + + {{ partial "about.html" . }} + + {{ partial "arguments.html" . }} + + {{ partial "action.html" . }} + + {{ partial "organisations.html" . }} + + {{ partial "spread.html" . }} + + {{ partial "language.html" . }} + {{ partial "legal.html" . }} {{ partial "sharecolumn.html" . }} diff --git a/site/layouts/partials/404.html b/site/layouts/partials/404.html index 7d5bf79..cb8f077 100644 --- a/site/layouts/partials/404.html +++ b/site/layouts/partials/404.html @@ -2,10 +2,10 @@
-

{{ .Site.Params.error.headline }}

+

{{ i18n "error_headline" }}


-

{{ .Site.Params.error.description }}

- {{ .Site.Params.error.button }} +

{{ i18n "error_description" }}

+ {{ i18n "error_button" }}
diff --git a/site/layouts/partials/about.html b/site/layouts/partials/about.html index b1977e8..75e15b4 100644 --- a/site/layouts/partials/about.html +++ b/site/layouts/partials/about.html @@ -3,23 +3,16 @@
- {{ with .Site.Params.about.headline }} -

{{ . }}

- {{ end }} - {{ if and .Site.Params.about.headline .Site.Params.about.description }} -
- {{ end }} + +

{{ i18n "about_headline" }}

+ +
{{ partial "functions/video_fsfe.html" . }} - {{ with .Site.Params.about.description }} -

{{ . | markdownify }}

- {{ end }} - {{ with .Site.Params.about.buttonText }} - {{ . }} - {{ end }} + {{ i18n "about_buttonText" }}
diff --git a/site/layouts/partials/action-box.html b/site/layouts/partials/action-box.html index 229b089..14b32ed 100644 --- a/site/layouts/partials/action-box.html +++ b/site/layouts/partials/action-box.html @@ -1,4 +1,4 @@ {{ "" | safeHTML }} -{{ replace .Site.Params.action.box.text "$INDS" (partial "functions/count_signatures.html" .) | markdownify }} +{{ replace (i18n "action_box_text") "$INDS" (partial "functions/count_signatures.html" .) | markdownify }} diff --git a/site/layouts/partials/action.html b/site/layouts/partials/action.html index 436dc5a..fa44e08 100644 --- a/site/layouts/partials/action.html +++ b/site/layouts/partials/action.html @@ -3,11 +3,11 @@
-

{{ .Site.Params.action.headline }}

+

{{ i18n "action_headline" }}


-

{{ .Site.Params.action.intro | markdownify }}

-

{{ .Site.Params.action.demand | markdownify }}

-

{{ (replace (replace .Site.Params.action.description "$ORGS" (partial "functions/count_organisations.html" .) ) "$INDS" (partial "functions/count_signatures.html" .)) | markdownify }}

+

{{ i18n "action_intro" | markdownify }}

+

{{ i18n "action_demand" | markdownify }}

+

{{ (replace (replace (i18n "action_description") "$ORGS" (partial "functions/count_organisations.html" .) ) "$INDS" (partial "functions/count_signatures.html" .)) | markdownify }}

{{ partial "functions/sign-form.html" . }}
diff --git a/site/layouts/partials/arguments.html b/site/layouts/partials/arguments.html index 4657216..46ce326 100644 --- a/site/layouts/partials/arguments.html +++ b/site/layouts/partials/arguments.html @@ -3,7 +3,7 @@
-

{{ .Site.Params.arguments.headline }}

+

{{ i18n "arguments_headline" }}


@@ -22,10 +22,10 @@
{{ end }}
-

{{ .Site.Params.fsdefinition }}

+

{{ i18n "fsdefinition" }}

-

{{ .Site.Params.arguments.followup | markdownify }}

- {{ .Site.Params.arguments.buttonText }} +

{{ i18n "arguments_followup" | markdownify }}

+ {{ i18n "arguments_buttonText" }}
diff --git a/site/layouts/partials/functions/sign-form.html b/site/layouts/partials/functions/sign-form.html index a6be365..1ca4ac4 100644 --- a/site/layouts/partials/functions/sign-form.html +++ b/site/layouts/partials/functions/sign-form.html @@ -1,15 +1,15 @@

@@ -45,5 +45,5 @@
- +
diff --git a/site/layouts/partials/head.html b/site/layouts/partials/head.html index 62a34c1..215eded 100644 --- a/site/layouts/partials/head.html +++ b/site/layouts/partials/head.html @@ -3,7 +3,7 @@ {{ with .Site.Params.static.meta.author }}{{ end }} -{{ with .Site.Params.description }}{{ end }} + {{ .Hugo.Generator }} {{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }} @@ -17,7 +17,7 @@ - + {{ range .Translations }} {{ end }} @@ -26,7 +26,7 @@ - + diff --git a/site/layouts/partials/language.html b/site/layouts/partials/language.html index f503494..260d2c0 100644 --- a/site/layouts/partials/language.html +++ b/site/layouts/partials/language.html @@ -3,8 +3,7 @@
- -

{{ .Site.Params.language.description }}:

+

{{ i18n "language_description" }}:

  • {{ .Site.Params.languageName }}
  • diff --git a/site/layouts/partials/legal.html b/site/layouts/partials/legal.html index 97afe7e..778e47f 100644 --- a/site/layouts/partials/legal.html +++ b/site/layouts/partials/legal.html @@ -2,13 +2,13 @@ diff --git a/site/layouts/partials/nav.html b/site/layouts/partials/nav.html index 535c79b..c9069dd 100644 --- a/site/layouts/partials/nav.html +++ b/site/layouts/partials/nav.html @@ -26,16 +26,16 @@