From f66ad971345f7fc1248fa03642f7cc7690a07c95 Mon Sep 17 00:00:00 2001 From: Samuel Shifterovich Date: Sat, 15 Dec 2018 17:20:27 +0100 Subject: [PATCH] Do all the | default in the language files and access lang strings in index using simple variables --- _data/lang/it/nothing_to_hide.yml | 15 ++------------- _includes/index.html | 10 +++++----- _includes/lang | 4 +++- _includes/langs/nothing_to_hide | 3 +++ 4 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 _includes/langs/nothing_to_hide diff --git a/_data/lang/it/nothing_to_hide.yml b/_data/lang/it/nothing_to_hide.yml index 88d6582c..eee310fa 100644 --- a/_data/lang/it/nothing_to_hide.yml +++ b/_data/lang/it/nothing_to_hide.yml @@ -1,16 +1,5 @@ --- -title: Privacy? I don't have anything to hide. +title: Italian title for nothing to hide quote: > - Over the last 16 months, as I've debated this issue around the world, - every single time somebody has said to me, "I don't really worry about - invasions of privacy because I don't have anything to hide." I always - say the same thing to them. I get out a pen, I write down my email address. - I say, "Here's my email address. What I want you to do when you get home - is email me the passwords to all of your email accounts, not just the - nice, respectable work one in your name, but all of them, because I want - to be able to just troll through what it is you're doing online, read - what I want to read and publish whatever I find interesting. After all, - if you're not a bad person, if you're doing nothing wrong, you should - have nothing to hide." Not a single person hsa taken me up on - that offer + Italian quote --- \ No newline at end of file diff --git a/_includes/index.html b/_includes/index.html index 01522a61..9cbe624c 100644 --- a/_includes/index.html +++ b/_includes/index.html @@ -33,17 +33,17 @@ {% include lang for="nothing_to_hide" lang=selected %}

- Glenn Greenwald: Why privacy matters - {{ lang.quote | default: en.quote }} + {{ quote }}

- + {{ talk_name }} - TED Talk

{{ language['Read also'] | default: english['Read also'] }}

diff --git a/_includes/lang b/_includes/lang index 5eef83e6..b141e835 100644 --- a/_includes/lang +++ b/_includes/lang @@ -1,2 +1,4 @@ {% assign lang = site.data.lang.[include.lang].[include.for] %} -{% assign en = site.data.lang.en.[include.for] %} \ No newline at end of file +{% assign en = site.data.lang.en.[include.for] %} + +{% include langs/{{include.for}} lang=lang en=en %} \ No newline at end of file diff --git a/_includes/langs/nothing_to_hide b/_includes/langs/nothing_to_hide new file mode 100644 index 00000000..5dc782e8 --- /dev/null +++ b/_includes/langs/nothing_to_hide @@ -0,0 +1,3 @@ +{% assign title = include.lang.title | default: include.en.title %} +{% assign quote = include.lang.quote | default: include.en.quote %} +{% assign talk_name = include.lang.talk_name | default: include.en.talk_name %} \ No newline at end of file