Skip to content

Commit 54f7c41

Browse files
committed
Added simple localization features.
1 parent 511076e commit 54f7c41

8 files changed

+39
-35
lines changed

_config.yml

+21-23
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# 'jekyll serve'. If you change this file, please restart the server process.
77

88
# Site settings
9-
title: MyDem0cracy.ca
109
email: your-email@domain.com
1110
description: > # this means to ignore newlines until "baseurl:"
1211
How do you think Canada’s democracy should work? D’après vous, comment la
@@ -23,33 +22,23 @@ kramdown:
2322

2423
# Third-party services
2524
# just leave someone empty to disable it
26-
google_analytics: UA-77242163-1
2725
disqus_shortname:
2826

2927
# used this for post_excerpt at index_page
3028
excerpt_separator: <!--description-->
3129

32-
polis:
33-
conversation_id: 69fnuffbkm
34-
35-
mydem0cracy:
36-
english:
37-
text:
38-
sub_title: >-
39-
MyDem0cracy.ca is an innovative way to join the national conversation on
40-
electoral reform. By answering a few questions, you can draw a picture of
41-
your democratic values. You can share your results with friends. It only
42-
takes a few minutes to answer and your feedback will help shape a
43-
healthier democracy.
44-
welcome_message: >-
45-
As you answer the questions, remember that there are no wrong answers and
46-
your individual responses will always remain anonymous. This is a
47-
different way of consulting Canadians – we hope you enjoy this, and learn
48-
something too. Thank you for participating.
49-
question_permission: >-
50-
If you are under 16 years of age, please speak to your parent or guardian
51-
to get their agreement before you begin the MyDem0cracy.ca experience.
5230

31+
# Used to render to proper text/config in language-specific branches
32+
locale: en
33+
34+
locales:
35+
en:
36+
site:
37+
title: MyDem0cracy.ca
38+
google_analytics: UA-77242163-1
39+
polis_conversation_id: 69fnuffbkm
40+
change_locale_text: Français
41+
change_locale_url: https://mydem0cratie.ca
5342
methodology: |
5443
### Seed comments
5544
@@ -73,5 +62,14 @@ mydem0cracy:
7362
Basically, we'd like to build consensus through conversation rather than continue to yell at each other from across the table.
7463
7564
76-
french:
65+
fr:
66+
site:
67+
title: MaDem0cratie.ca
68+
google_analytics: UA-77242163-2
69+
polis_conversation_id: 4h8wyzbbca
70+
change_locale_text: English
71+
change_locale_url: https://mydem0cracy.ca
7772
methodology: |
73+
foobar
74+
about: |
75+
foobar

_includes/ga.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{% if site.google_analytics %}
1+
{% assign google_analytics = site.locales[site.locale].google_analytics %}
2+
{% if google_analytics %}
23
<script>
34
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
45
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
56
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
67
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
7-
ga('create', '{{ site.google_analytics }}', 'auto');
8+
ga('create', '{{ google_analytics }}', 'auto');
89
ga('send', 'pageview');
910
</script>
1011
{% endif %}

_includes/head.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
<meta http-equiv="X-UA-Compatible" content="IE=edge">
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55

6-
<title>{% if page.title %}{{ site.title}} - {{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
6+
<title>
7+
{% if page.title %}
8+
{{ site.locales[site.locale].site.title }} - {{ page.title }}
9+
{% else %}
10+
{{ site.locales[site.locale].site.title }}
11+
{% endif %}
12+
</title>
713
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
814

915
<!-- evil icon -->

_includes/header.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</a>
88
</div>
99
<div class="navbar-title-language-switcher">
10-
<a class="LanguageSwitcher-holder" href="https://mydem0cratie.ca" lang="fr">
11-
<span>Français</span>
10+
<a class="LanguageSwitcher-holder" href="{{ site.mydem0cracy[site.language].change_locale_url }}">
11+
<span>{{ site.mydem0cracy[site.language].change_locale_text }}</span>
1212
</a>
1313
</div>
1414
</div>

about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ layout: page
33
title: About
44
permalink: /about/
55
---
6-
{{site.about | markdownify}}
6+
{{ site.locales[site.locale].about | markdownify }}

index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: default
33
---
4-
<div class='polis' data-conversation_id='{{ site.polis.conversation_id }}'></div>
4+
{% assign conversation_id = site.locales[site.locale].polis_conversation_id %}
5+
<div class='polis' data-conversation_id='{{ conversation_id }}'></div>
56
<script async='true' src='https://pol.is/embed.js'></script>

methodology.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ title: Methodology
44
permalink: /methodology/
55
---
66

7-
{{site.methodology | markdownify}}
7+
{{ site.locales[site.locale].methodology | markdownify }}
8+

privacy.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
---
2-
layout: default
2+
layout: page
33
title: Privacy Policy
44
---
5-
6-
# Privacy Policy
7-
85
This privacy policy (this "Policy") describes the collection of personal information
96
by MyDem0cracy.ca ("MyDem0cracy", "we", "us") from users of our websites at
107
[mydem0cracy.ca](mydem0cracy.ca) and [madem0cratie.ca](madem0cratie.ca) (the

0 commit comments

Comments
 (0)