Browse Source

split config files in separate languages and concatenate them during build

img
Max Mehl 2 years ago
parent
commit
0b03bfeeab

+ 1
- 0
.gitignore View File

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

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

@@ -1,11 +1,15 @@
#!/bin/bash

basedir="${0%/*}/.."
sigdb="$1"
cd "$basedir"
mode=$1

# Clean signatures database
# "$basedir/build/clean_database.py" "$sigdb" "$basedir/data/signatures/data/signatures_clean.json"
# Unite static and language-specific config files to a single file
cat config-static.toml languages/strings.*.toml > config.toml

# Execute hugo buildrun
cd "$basedir"
hugo
if [ "$mode" == "server" ]; then
hugo server
else
hugo
fi

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

@@ -0,0 +1,20 @@
baseurl = "/"
title = "Public Money, Public Code"
theme = "hugo-creative-theme"
DefaultContentLanguage = "en"

# Static strings shared by all languages – these are not to be translated!
[params.static]
url = "https://publiccode.eu"
slogan_1 = "Public Money"
slogan_2 = "Public Code"
promoLink = "https://fsfe.org/promo#pmpc"
[params.static.meta]
author = "Free Software Foundation Europe (FSFE)"
previewImage = "img/share-graphics/imagine.jpg"
fbPageID = "336939393138306"
twitterUser = "@fsfe"

# === TRANSLATIONS ===
[Languages]


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

@@ -0,0 +1,122 @@
# == YOUR LANGUAGE ==

# General strings
[Languages.XY]
languageCode = "xy" # 2-letter code of language (ISO 639-1)
languageName = "" # verbose name of language (e.g. "Français" or "Русский")
description = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
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


# Navigation
[Languages.XY.navigation]
[Languages.XY.navigation.links]
start = "Start"
about = "Über"
arguments = "Arguments"
action = "Take Action"
spread = "Spread"
language = "Language"


# Start banner
[Languages.XY.start]
slogan_1 = "Public Money"
slogan_2 = "Public Code"
subtitle1 = "Why is software that is programmed with taxpayers' money not released as Free Software?"
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."
subtitle3 = "**Code paid by all people should be available to all people!**"


# About section
[Languages.XY.about]
headline = "Sounds complex? No, it's super easy!"
buttonText = "More advantages"


# Arguments section
[Languages.XY.arguments]
headline = "Reasons for Public Code"
followup = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
buttonText = "Sign the Open Letter"
[[Languages.XY.arguments.list]]
icon = "fa-eur" # <-- do not translate this
title = "Tax savings"
description = "Similar applications don't have to be programmed from scratch every time."
[[Languages.XY.arguments.list]]
icon = "fa-handshake-o" # <-- do not translate this
title = "Collaboration"
description = "Efforts on major projects can be joint to share expertise and costs."
[[Languages.XY.arguments.list]]
icon = "fa-users" # <-- do not translate this
title = "Serving the public"
description = "Applications paid by the public should be available for everyone."
[[Languages.XY.arguments.list]]
icon = "fa-lightbulb-o" # <-- do not translate this
title = "Fostering innovation"
description = "With transparent processes others don't have to reinvent the wheel."


# Action section
[Languages.XY.action]
headline = "Tell Your Representatives!"
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.“**"
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."
[Languages.XY.action.form]
name = "Name (required)"
email = "Email (required)"
country = "Your Country"
zip = "Zip Code"
comment = "Your comment (max. 140 characters)"
permPriv = "I have read and accepted the [privacy statement](privacy/)"
permNews = "I want to stay informed about the future of this campaign"
permPub = "I want my signature to appear in the [list of signatures](openletter/all-signatures)"
submit = "Sign Now!"


# Organisations section
[Languages.XY.organisations]
headline = "Supporting Organisations"
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)."


# Spread the word section
[Languages.XY.spread]
headline = "Spread the word!"
promoText = "Order the latest stickers and flyers from FSFE"
promoButtonText = "Get promo material"
promoButtonLink = "https://fsfe.org/promo#pmpc"
shareText = "Tell your friends and followers about Public Code:"
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: "


# Legal Section
[Languages.XY.legal]
by = "This is a campaign by Free Software Foundation Europe"
imprint = "Imprint"
privacy = "Privacy"
transparency = "Transparency"
contribute1 = "The code of this website is Free Software."
contribute2 = "You're welcome to contribute!"
license = "This work is licensed under a [Creative Commons BY-SA 4.0 License](http://creativecommons.org/licenses/by-sa/4.0/)."


# Language selection
[Languages.XY.language]
description = "Read this page in another language"


# 404 Error Page
[Languages.XY.error]
headline = "Error 404 - Page not found"
description = "The page you're looking for does not exist."
button = "Back to start page"


# Specific sub-pages
[Languages.XY.subpage]
[Languages.XY.subpage.signatures]
headline = "Individual Open Letter Signatures"
description = "Below you find the recent signatures of people who agreed to have their signature be public. Will you be the next?"
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 @@
# == GERMAN ==

# General strings
[Languages.de]
languageCode = "de" # 2-letter code of language (ISO 639-1)
languageName = "Deutsch" # verbose name of language (e.g. "Français" or "Русский")
description = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
languageCode = "" # 2-letter code of language (ISO 639-1)
languageName = "" # verbose name of language (e.g. "Français" or "Русский")
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."
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


# Navigation
[Languages.de.navigation]
[Languages.de.navigation.links]
start = "Start"
about = "About"
about = "Über"
arguments = "Arguments"
action = "Take Action"
spread = "Spread"
@@ -38,19 +40,19 @@
followup = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
buttonText = "Sign the Open Letter"
[[Languages.de.arguments.list]]
icon = "fa-eur"
icon = "fa-eur" # <-- do not translate this
title = "Tax savings"
description = "Similar applications don't have to be programmed from scratch every time."
[[Languages.de.arguments.list]]
icon = "fa-handshake-o"
icon = "fa-handshake-o" # <-- do not translate this
title = "Collaboration"
description = "Efforts on major projects can be joint to share expertise and costs."
[[Languages.de.arguments.list]]
icon = "fa-users"
icon = "fa-users" # <-- do not translate this
title = "Serving the public"
description = "Applications paid by the public should be available for everyone."
[[Languages.de.arguments.list]]
icon = "fa-lightbulb-o"
icon = "fa-lightbulb-o" # <-- do not translate this
title = "Fostering innovation"
description = "With transparent processes others don't have to reinvent the wheel."


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

@@ -1,33 +1,16 @@
baseurl = "/"
title = "Public Money, Public Code"
theme = "hugo-creative-theme"
DefaultContentLanguage = "en"

# Static strings shared by all languages
[params.static]
url = "https://publiccode.eu"
slogan_1 = "Public Money"
slogan_2 = "Public Code"
promoLink = "https://fsfe.org/promo#pmpc"
[params.static.meta]
author = "Free Software Foundation Europe (FSFE)"
previewImage = "img/share-graphics/imagine.jpg"
fbPageID = "336939393138306"
twitterUser = "@fsfe"

# == ENGLISH ==

# General strings
[params]
[Languages.en]
languageCode = "en"
languageName = "English"
description = "Public Money, Public Code - A campaign for releasing publicly financed software as Free Software"
# For translation fsdefinition, https://fsfe.org/about/mission.html may help you
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."


# Navigation
[params.navigation]
[params.navigation.links]
[Languages.en.navigation]
[Languages.en.navigation.links]
start = "Start"
about = "About"
arguments = "Arguments"
@@ -37,48 +20,48 @@ DefaultContentLanguage = "en"


# Start banner
[params.start]
[Languages.en.start]
subtitle1 = "Why is software that is programmed with taxpayers' money not released as Free Software?"
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."
subtitle3 = "**Code paid by all people should be available to all people!**"


# About section
[params.about]
[Languages.en.about]
headline = "Sounds complex? No, it's super easy!"
buttonText = "More advantages"


# Arguments section
[params.arguments]
[Languages.en.arguments]
headline = "Reasons for Public Code"
followup = "Do you believe that Free Software must be the default option for publicly financed software? **Then let's convince your political representatives!**"
buttonText = "Sign the Open Letter"
[[params.arguments.list]]
[[Languages.en.arguments.list]]
icon = "fa-eur"
title = "Tax savings"
description = "Similar applications don't have to be programmed from scratch every time."
[[params.arguments.list]]
[[Languages.en.arguments.list]]
icon = "fa-handshake-o"
title = "Collaboration"
description = "Efforts on major projects can be joint to share expertise and costs."
[[params.arguments.list]]
[[Languages.en.arguments.list]]
icon = "fa-users"
title = "Serving the public"
description = "Applications paid by the public should be available for everyone."
[[params.arguments.list]]
[[Languages.en.arguments.list]]
icon = "fa-lightbulb-o"
title = "Fostering innovation"
description = "With transparent processes others don't have to reinvent the wheel."


# Action section
[params.action]
[Languages.en.action]
headline = "Tell Your Representatives!"
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.“**"
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."
[params.action.form]
[Languages.en.action.form]
name = "Name (required)"
email = "Email (required)"
country = "Your Country"
@@ -91,13 +74,13 @@ DefaultContentLanguage = "en"


# Organisations section
[params.organisations]
[Languages.en.organisations]
headline = "Supporting Organisations"
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)."


# Spread the word section
[params.spread]
[Languages.en.spread]
headline = "Spread the word!"
promoText = "Order the latest stickers and flyers from FSFE"
promoButtonText = "Get promo material"
@@ -106,7 +89,7 @@ DefaultContentLanguage = "en"


# Legal Section
[params.legal]
[Languages.en.legal]
by = "This is a campaign by Free Software Foundation Europe"
imprint = "Imprint"
privacy = "Privacy"
@@ -117,27 +100,22 @@ DefaultContentLanguage = "en"


# Language selection
[params.language]
[Languages.en.language]
description = "Read this page in another language"


# 404 Error Page
[params.error]
[Languages.en.error]
headline = "Error 404 - Page not found"
description = "The page you're looking for does not exist."
button = "Back to start page"


# Specific sub-pages
[params.subpage]
[params.subpage.signatures]
[Languages.en.subpage]
[Languages.en.subpage.signatures]
headline = "Individual Open Letter Signatures"
description = "Below you find the recent signatures of people who agreed to have their signature be public. Will you be the next?"
allSignatures = "Have a look at [all public signatures](all-signatures/)."


# === TRANSLATIONS ===
[Languages]
[Languages.en]

# == GERMAN ==

Loading…
Cancel
Save