From 02d38623a5b20c03945b25136e714ad08e791a8e Mon Sep 17 00:00:00 2001 From: CoralineAda Date: Thu, 24 May 2018 19:46:54 -0500 Subject: [PATCH] Prep for translations --- README.md | 16 +++++++++++++ config.toml | 4 ---- content/_index.md | 2 ++ content/manifesto/.index-template.html | 19 ---------------- content/manifesto/_index.se.md | 6 ----- content/translations.md | 5 ----- layouts/_default/translations.html | 31 -------------------------- layouts/languages/single.html | 5 ----- layouts/partials/translation-row.html | 5 ----- layouts/shortcodes/translations.html | 8 +++++++ 10 files changed, 26 insertions(+), 75 deletions(-) delete mode 100644 content/manifesto/.index-template.html delete mode 100644 content/manifesto/_index.se.md delete mode 100644 content/translations.md delete mode 100644 layouts/_default/translations.html delete mode 100644 layouts/languages/single.html delete mode 100644 layouts/partials/translation-row.html create mode 100644 layouts/shortcodes/translations.html diff --git a/README.md b/README.md index cdd7e58..a9b72b8 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,19 @@ Be sure to read the Code of Conduct before submitting a pull request, opening an ## Adding your name as a signatory Please use the Google Form linked on the bottom of the page at https://postmeritocracy.org. Do not open a PR to add your name. + +## Adding a translation +* Fork the repo +* Make sure that you have Hugo installed: `brew install hugo` +* Create an empty markdown file called `_index..md` in the `content` directory +* Write your translation there. Be sure to copy the structure of the English version at `index.md`, including all the special codes. +* Add an entry to `config.toml` with your language information under the [Languages] tag. For example, for Swedish, you would enter: + + [Languages.se] + languageName = "Swedish" + languageCode = "se" + +* Start the hugo server: `hugo server -D` +* Navigate to http://localhost:1313/COUNTRY_CODE/ and you should see your translation +* Open a pull request +* I will find another native speaker to look over the translation you made, and then it will be merged! diff --git a/config.toml b/config.toml index 62eebd0..47f4ed0 100644 --- a/config.toml +++ b/config.toml @@ -18,7 +18,3 @@ page = ["html"] languageName = "English" languageCode = "en" weight = 1 - -[Languages.se] -languageName = "Swedish" -languageCode = "se" diff --git a/content/_index.md b/content/_index.md index 94ce779..cb70185 100644 --- a/content/_index.md +++ b/content/_index.md @@ -33,6 +33,8 @@ These core values and principles are: * The field of software development embraces technical change, and is made better by also accepting social change. * We strive to reflect our values in everything that we do. We recognize that values that are espoused but not practiced are not values at all. +{{< translations >}} + ### Signatories

diff --git a/content/manifesto/.index-template.html b/content/manifesto/.index-template.html deleted file mode 100644 index 0d3021e..0000000 --- a/content/manifesto/.index-template.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - $title$ - - - - $body$ - - diff --git a/content/manifesto/_index.se.md b/content/manifesto/_index.se.md deleted file mode 100644 index bb24ab6..0000000 --- a/content/manifesto/_index.se.md +++ /dev/null @@ -1,6 +0,0 @@ -+++ -title = "The Post-Meritocracy Manifesto" -aliases = ["/se"] -+++ - -Foo Swedish diff --git a/content/translations.md b/content/translations.md deleted file mode 100644 index fb933bc..0000000 --- a/content/translations.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = "Post-Meritocracy Manifesto Translations" -aliases = ["i18n"] -layout = "translations" -+++ diff --git a/layouts/_default/translations.html b/layouts/_default/translations.html deleted file mode 100644 index 767d8c7..0000000 --- a/layouts/_default/translations.html +++ /dev/null @@ -1,31 +0,0 @@ -{{ define "main" }} -

-

{{ .Title }}

-

{{ .Description }}

- - - - - - - - {{ $latest := $.Site.RegularPages }} - {{ range $latest }} - {{ if $.Page.Scratch.Get .Language.LanguageName }} - {{ else }} - {{ partial "translation-row.html" . }} - {{ $.Page.Scratch.Set .Language.LanguageName 1 }} - {{ end }} - {{ range .Translations }} - {{ if $.Page.Scratch.Get .Language.LanguageName }} - {{ else }} - {{ partial "translation-row.html" . }} - {{ $.Page.Scratch.Set .Language.LanguageName 1 }} - {{ end }} - {{ end }} - {{ end }} - -
Language
- {{ .Content }} -
-{{ end }} diff --git a/layouts/languages/single.html b/layouts/languages/single.html deleted file mode 100644 index 94cb08f..0000000 --- a/layouts/languages/single.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ define "main" }} - -{{ .Content }} - -{{ end }} diff --git a/layouts/partials/translation-row.html b/layouts/partials/translation-row.html deleted file mode 100644 index 4bc92fe..0000000 --- a/layouts/partials/translation-row.html +++ /dev/null @@ -1,5 +0,0 @@ - - - {{ .Language.LanguageName }} - - diff --git a/layouts/shortcodes/translations.html b/layouts/shortcodes/translations.html new file mode 100644 index 0000000..1649658 --- /dev/null +++ b/layouts/shortcodes/translations.html @@ -0,0 +1,8 @@ +