Browse Source

split config files in separate languages and concatenate them during build

pull/85/head
Max Mehl 1 year ago
parent
commit
0b03bfeeab

+ 1
- 0
.gitignore View File

@@ -1,3 +1,4 @@
1 1
 signatures.json
2 2
 ips.json
3 3
 spammer_*.json
4
+site/config.toml

+ 9
- 5
site/build/build.sh View File

@@ -1,11 +1,15 @@
1 1
 #!/bin/bash
2 2
 
3 3
 basedir="${0%/*}/.."
4
-sigdb="$1"
4
+cd "$basedir"
5
+mode=$1
5 6
 
6
-# Clean signatures database
7
-# "$basedir/build/clean_database.py" "$sigdb" "$basedir/data/signatures/data/signatures_clean.json"
7
+# Unite static and language-specific config files to a single file
8
+cat config-static.toml languages/strings.*.toml > config.toml
8 9
 
9 10
 # Execute hugo buildrun
10
-cd "$basedir"
11
-hugo
11
+if [ "$mode" == "server" ]; then
12
+  hugo server
13
+else
14
+  hugo
15
+fi

+ 20
- 0
site/config-static.toml View File

@@ -0,0 +1,20 @@
1
+baseurl = "/"
2
+title = "Public Money, Public Code"
3
+theme = "hugo-creative-theme"
4
+DefaultContentLanguage = "en"
5
+
6
+# Static strings shared by all languages – these are not to be translated!
7
+[params.static]
8
+  url         = "https://publiccode.eu"
9
+  slogan_1    = "Public Money"
10
+  slogan_2    = "Public Code"
11
+  promoLink   = "https://fsfe.org/promo#pmpc"
12
+[params.static.meta]
13
+  author        = "Free Software Foundation Europe (FSFE)"
14
+  previewImage  = "img/share-graphics/imagine.jpg"
15
+  fbPageID      = "336939393138306"
16
+  twitterUser   = "@fsfe"
17
+
18
+# === TRANSLATIONS ===
19
+[Languages]
20
+

+ 122
- 0
site/languages/strings.XY.toml.sample View File

@@ -0,0 +1,122 @@
1
+# == YOUR LANGUAGE ==
2
+
3
+# General strings
4
+[Languages.XY]
5
+  languageCode  = "xy"  # 2-letter code of language (ISO 639-1)
6
+  languageName  = ""  # verbose name of language (e.g. "Français" or "Русский")
7
+  description   = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
8
+  fsdefinition  = "Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy."   # https://fsfe.org/about/mission.html may help you with translations
9
+
10
+
11
+# Navigation
12
+[Languages.XY.navigation]
13
+[Languages.XY.navigation.links]
14
+  start     = "Start"
15
+  about     = "Über"
16
+  arguments = "Arguments"
17
+  action    = "Take Action"
18
+  spread    = "Spread"
19
+  language  = "Language"
20
+
21
+
22
+# Start banner
23
+[Languages.XY.start]
24
+  slogan_1   = "Public Money"
25
+  slogan_2   = "Public Code"
26
+  subtitle1  = "Why is software that is programmed with taxpayers' money not released as Free Software?"
27
+  subtitle2  = "We want legislation requiring that publicly financed software developed for public sector must be made publicly available under a [Free and Open Source Software](https://fsfe.org/freesoftware/basics/summary.html 'Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.') licence. If it is public money, it should be public code as well."
28
+  subtitle3  = "**Code paid by all people should be available to all people!**" 
29
+
30
+
31
+# About section
32
+[Languages.XY.about]
33
+  headline    = "Sounds complex? No, it's super easy!"
34
+  buttonText  = "More advantages"
35
+
36
+
37
+# Arguments section
38
+[Languages.XY.arguments]
39
+  headline    = "Reasons for Public Code"
40
+  followup    = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
41
+  buttonText  = "Sign the Open Letter"
42
+[[Languages.XY.arguments.list]]
43
+  icon        = "fa-eur"  # <-- do not translate this
44
+  title       = "Tax savings"
45
+  description = "Similar applications don't have to be programmed from scratch every time."
46
+[[Languages.XY.arguments.list]]
47
+  icon        = "fa-handshake-o"  # <-- do not translate this
48
+  title       = "Collaboration"
49
+  description = "Efforts on major projects can be joint to share expertise and costs."  
50
+[[Languages.XY.arguments.list]]
51
+  icon        = "fa-users"  # <-- do not translate this
52
+  title       = "Serving the public"
53
+  description = "Applications paid by the public should be available for everyone."
54
+[[Languages.XY.arguments.list]]
55
+  icon        = "fa-lightbulb-o"  # <-- do not translate this
56
+  title       = "Fostering innovation"
57
+  description = "With transparent processes others don't have to reinvent the wheel."
58
+
59
+
60
+# Action section
61
+[Languages.XY.action]
62
+  headline      = "Tell Your Representatives!"
63
+  subheadline   = "We demand: **„Implement legislation requiring that publicly financed software developed for public sector must be made publicly available under a [Free and Open Source Software](https://fsfe.org/freesoftware/basics/summary.html 'Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.') licence.“**"
64
+  description   = "**$ORGS organisations** and **$INDS individuals** support this call for action by signing our [Open Letter](openletter/). Help us to make an impact by signing it, too! We will hand over all signatures to representatives all over Europe that are debating software freedom in public administration."
65
+  
66
+[Languages.XY.action.form]
67
+  name      = "Name (required)"
68
+  email     = "Email (required)"
69
+  country   = "Your Country"
70
+  zip       = "Zip Code"
71
+  comment   = "Your comment (max. 140 characters)"
72
+  permPriv  = "I have read and accepted the [privacy statement](privacy/)"
73
+  permNews  = "I want to stay informed about the future of this campaign"
74
+  permPub   = "I want my signature to appear in the [list of signatures](openletter/all-signatures)"
75
+  submit    = "Sign Now!"
76
+
77
+
78
+# Organisations section
79
+[Languages.XY.organisations]
80
+  headline  = "Supporting Organisations"
81
+  text      = "Following organisations support our [Open Letter](openletter/). If your organisation is also interested in joining the call for Public Code, please [contact us](mailto:contact@fsfe.org)."
82
+
83
+
84
+# Spread the word section
85
+[Languages.XY.spread]
86
+  headline          = "Spread the word!"
87
+  promoText         = "Order the latest stickers and flyers from FSFE"
88
+  promoButtonText   = "Get promo material"
89
+  promoButtonLink   = "https://fsfe.org/promo#pmpc"
90
+  shareText         = "Tell your friends and followers about Public Code:"
91
+  defaultSocialText = "If it is public money, it should be public code as well. I support this call for more public code under a Free Software license: "
92
+
93
+
94
+# Legal Section
95
+[Languages.XY.legal]
96
+  by            = "This is a campaign by Free Software Foundation Europe"
97
+  imprint       = "Imprint"
98
+  privacy       = "Privacy"
99
+  transparency  = "Transparency"
100
+  contribute1   = "The code of this website is Free Software." 
101
+  contribute2   = "You're welcome to contribute!"
102
+  license       = "This work is licensed under a [Creative Commons BY-SA 4.0 License](http://creativecommons.org/licenses/by-sa/4.0/)."
103
+
104
+
105
+# Language selection
106
+[Languages.XY.language]
107
+  description = "Read this page in another language"
108
+
109
+
110
+# 404 Error Page
111
+[Languages.XY.error]
112
+  headline    = "Error 404 - Page not found"
113
+  description = "The page you're looking for does not exist."
114
+  button      = "Back to start page"
115
+
116
+
117
+# Specific sub-pages
118
+[Languages.XY.subpage]
119
+[Languages.XY.subpage.signatures]
120
+  headline      = "Individual Open Letter Signatures"
121
+  description   = "Below you find the recent signatures of people who agreed to have their signature be public. Will you be the next?"
122
+  allSignatures = "Have a look at [all public signatures](all-signatures/)."

site/config.de.toml → site/languages/strings.de.toml View File

@@ -1,16 +1,18 @@
1
+# == GERMAN ==
2
+
1 3
 # General strings
2 4
 [Languages.de]
5
+  languageCode  = "de"  # 2-letter code of language (ISO 639-1)
6
+  languageName  = "Deutsch"  # verbose name of language (e.g. "Français" or "Русский")
3 7
   description   = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
4
-  languageCode  = ""  # 2-letter code of language (ISO 639-1)
5
-  languageName  = ""  # verbose name of language (e.g. "Français" or "Русский")
6
-  fsdefinition  = "Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy."
8
+  fsdefinition  = "Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy."   # https://fsfe.org/about/mission.html may help you with translations
7 9
 
8 10
 
9 11
 # Navigation
10 12
 [Languages.de.navigation]
11 13
 [Languages.de.navigation.links]
12 14
   start     = "Start"
13
-  about     = "About"
15
+  about     = "Über"
14 16
   arguments = "Arguments"
15 17
   action    = "Take Action"
16 18
   spread    = "Spread"
@@ -38,19 +40,19 @@
38 40
   followup    = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
39 41
   buttonText  = "Sign the Open Letter"
40 42
 [[Languages.de.arguments.list]]
41
-  icon        = "fa-eur"
43
+  icon        = "fa-eur"  # <-- do not translate this
42 44
   title       = "Tax savings"
43 45
   description = "Similar applications don't have to be programmed from scratch every time."
44 46
 [[Languages.de.arguments.list]]
45
-  icon        = "fa-handshake-o"
47
+  icon        = "fa-handshake-o"  # <-- do not translate this
46 48
   title       = "Collaboration"
47 49
   description = "Efforts on major projects can be joint to share expertise and costs."  
48 50
 [[Languages.de.arguments.list]]
49
-  icon        = "fa-users"
51
+  icon        = "fa-users"  # <-- do not translate this
50 52
   title       = "Serving the public"
51 53
   description = "Applications paid by the public should be available for everyone."
52 54
 [[Languages.de.arguments.list]]
53
-  icon        = "fa-lightbulb-o"
55
+  icon        = "fa-lightbulb-o"  # <-- do not translate this
54 56
   title       = "Fostering innovation"
55 57
   description = "With transparent processes others don't have to reinvent the wheel."
56 58
 

site/config.toml → site/languages/strings.en.toml View File

@@ -1,33 +1,16 @@
1
-baseurl = "/"
2
-title = "Public Money, Public Code"
3
-theme = "hugo-creative-theme"
4
-DefaultContentLanguage = "en"
5
-
6
-# Static strings shared by all languages
7
-[params.static]
8
-  url         = "https://publiccode.eu"
9
-  slogan_1    = "Public Money"
10
-  slogan_2    = "Public Code"
11
-  promoLink   = "https://fsfe.org/promo#pmpc"
12
-[params.static.meta]
13
-  author        = "Free Software Foundation Europe (FSFE)"
14
-  previewImage  = "img/share-graphics/imagine.jpg"
15
-  fbPageID      = "336939393138306"
16
-  twitterUser   = "@fsfe"
17
-
1
+# == ENGLISH ==
18 2
 
19 3
 # General strings
20
-[params]
4
+[Languages.en]
21 5
   languageCode  = "en"
22 6
   languageName  = "English"
23 7
   description   = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
24
-  # For translation fsdefinition, https://fsfe.org/about/mission.html may help you
25 8
   fsdefinition  = "Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy."
26 9
 
27 10
 
28 11
 # Navigation
29
-[params.navigation]
30
-[params.navigation.links]
12
+[Languages.en.navigation]
13
+[Languages.en.navigation.links]
31 14
   start     = "Start"
32 15
   about     = "About"
33 16
   arguments = "Arguments"
@@ -37,48 +20,48 @@ DefaultContentLanguage = "en"
37 20
 
38 21
 
39 22
 # Start banner
40
-[params.start]
23
+[Languages.en.start]
41 24
   subtitle1   = "Why is software that is programmed with taxpayers' money not released as Free Software?"
42 25
   subtitle2   = "We want legislation requiring that publicly financed software developed for public sector must be made publicly available under a [Free and Open Source Software](https://fsfe.org/freesoftware/basics/summary.html 'Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.') licence. If it is public money, it should be public code as well."
43 26
   subtitle3   = "**Code paid by all people should be available to all people!**" 
44 27
 
45 28
 
46 29
 # About section
47
-[params.about]
30
+[Languages.en.about]
48 31
   headline    = "Sounds complex? No, it's super easy!"
49 32
   buttonText  = "More advantages"
50 33
 
51 34
 
52 35
 # Arguments section
53
-[params.arguments]
36
+[Languages.en.arguments]
54 37
   headline    = "Reasons for Public Code"
55 38
   followup    = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
56 39
   buttonText  = "Sign the Open Letter"
57
-[[params.arguments.list]]
40
+[[Languages.en.arguments.list]]
58 41
   icon        = "fa-eur"
59 42
   title       = "Tax savings"
60 43
   description = "Similar applications don't have to be programmed from scratch every time."
61
-[[params.arguments.list]]
44
+[[Languages.en.arguments.list]]
62 45
   icon        = "fa-handshake-o"
63 46
   title       = "Collaboration"
64 47
   description = "Efforts on major projects can be joint to share expertise and costs."  
65
-[[params.arguments.list]]
48
+[[Languages.en.arguments.list]]
66 49
   icon        = "fa-users"
67 50
   title       = "Serving the public"
68 51
   description = "Applications paid by the public should be available for everyone."
69
-[[params.arguments.list]]
52
+[[Languages.en.arguments.list]]
70 53
   icon        = "fa-lightbulb-o"
71 54
   title       = "Fostering innovation"
72 55
   description = "With transparent processes others don't have to reinvent the wheel."
73 56
 
74 57
 
75 58
 # Action section
76
-[params.action]
59
+[Languages.en.action]
77 60
   headline      = "Tell Your Representatives!"
78 61
   subheadline   = "We demand: **„Implement legislation requiring that publicly financed software developed for public sector must be made publicly available under a [Free and Open Source Software](https://fsfe.org/freesoftware/basics/summary.html 'Free Software gives everybody the rights to use, study, share and improve software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.') licence.“**"
79 62
   description   = "**$ORGS organisations** and **$INDS individuals** support this call for action by signing our [Open Letter](openletter/). Help us to make an impact by signing it, too! We will hand over all signatures to representatives all over Europe that are debating software freedom in public administration."
80 63
   
81
-[params.action.form]
64
+[Languages.en.action.form]
82 65
   name      = "Name (required)"
83 66
   email     = "Email (required)"
84 67
   country   = "Your Country"
@@ -91,13 +74,13 @@ DefaultContentLanguage = "en"
91 74
 
92 75
 
93 76
 # Organisations section
94
-[params.organisations]
77
+[Languages.en.organisations]
95 78
   headline  = "Supporting Organisations"
96 79
   text      = "Following organisations support our [Open Letter](openletter/). If your organisation is also interested in joining the call for Public Code, please [contact us](mailto:contact@fsfe.org)."
97 80
 
98 81
 
99 82
 # Spread the word section
100
-[params.spread]
83
+[Languages.en.spread]
101 84
   headline          = "Spread the word!"
102 85
   promoText         = "Order the latest stickers and flyers from FSFE"
103 86
   promoButtonText   = "Get promo material"
@@ -106,7 +89,7 @@ DefaultContentLanguage = "en"
106 89
 
107 90
 
108 91
 # Legal Section
109
-[params.legal]
92
+[Languages.en.legal]
110 93
   by            = "This is a campaign by Free Software Foundation Europe"
111 94
   imprint       = "Imprint"
112 95
   privacy       = "Privacy"
@@ -117,27 +100,22 @@ DefaultContentLanguage = "en"
117 100
 
118 101
 
119 102
 # Language selection
120
-[params.language]
103
+[Languages.en.language]
121 104
   description = "Read this page in another language"
122 105
 
123 106
 
124 107
 # 404 Error Page
125
-[params.error]
108
+[Languages.en.error]
126 109
   headline    = "Error 404 - Page not found"
127 110
   description = "The page you're looking for does not exist."
128 111
   button      = "Back to start page"
129 112
 
130 113
 
131 114
 # Specific sub-pages
132
-[params.subpage]
133
-[params.subpage.signatures]
115
+[Languages.en.subpage]
116
+[Languages.en.subpage.signatures]
134 117
   headline      = "Individual Open Letter Signatures"
135 118
   description   = "Below you find the recent signatures of people who agreed to have their signature be public. Will you be the next?"
136 119
   allSignatures = "Have a look at [all public signatures](all-signatures/)."
137 120
 
138 121
 
139
-# === TRANSLATIONS ===
140
-[Languages]
141
-[Languages.en]
142
-
143
-# == GERMAN ==

Loading…
Cancel
Save