Browse Source

Update 2021.07.16

- Removed test submodule;
- EN version.
master
Pierre Vanhulst 1 year ago
parent
commit
b056359b32
  1. 3
      .gitmodules
  2. 6
      nuxt.config.js
  3. 52
      src/assets/data/cantons.json
  4. 20
      src/assets/data/parties.json
  5. 26
      src/assets/data/repartitions.js
  6. 9
      src/assets/data/scenarios.js
  7. 92
      src/assets/lang/en.js
  8. 1
      src/layouts/default.vue

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "simulation-fairelection"]
path = simulation-fairelection
url = https://framagit.org/vanhulstp/simulation-fairelection

6
nuxt.config.js

@ -1,4 +1,5 @@
import de from './src/assets/lang/de';
import en from './src/assets/lang/en';
import fr from './src/assets/lang/fr';
const title = 'FairElection: Élections Fédérales 2019';
@ -66,14 +67,15 @@ export default {
i18n: {
locales: [
{ code: 'fr', iso: 'fr-CH' },
{ code: 'de', iso: 'de-CH' }
{ code: 'de', iso: 'de-CH' },
{ code: 'en', iso: 'en-GB' }
],
baseUrl: 'https://simulation.fairelection.ch',
defaultLocale: 'fr',
seo: false,
vueI18n: {
fallbackLocale: 'fr',
messages: { de, fr }
messages: { de, fr, en }
}
},
/*

52
src/assets/data/cantons.json

@ -1,28 +1,28 @@
[
{ "namede": "Aargau", "namefr": "Argovie", "code": "AG", "codeElected": "canton_AG" },
{ "namede": "Appenzell Innerrhoden", "namefr": "Appenzell Rhodes-Intérieures", "code": "AI", "codeElected": "canton_AI" },
{ "namede": "Appenzell Ausserrhoden", "namefr": "Appenzell Rhodes-Extérieures", "code": "AR", "codeElected": "canton_AR" },
{ "namede": "Bern", "namefr": "Berne", "code": "BE", "codeElected": "canton_BE" },
{ "namede": "Basel-Landschaft", "namefr": "Bâle-Campagne", "code": "BL", "codeElected": "canton_BL" },
{ "namede": "Basel-Stadt", "namefr": "Bâle-Ville", "code": "BS", "codeElected": "canton_BS" },
{ "namede": "Freiburg", "namefr": "Fribourg", "code": "FR", "codeElected": "canton_FR" },
{ "namede": "Genf", "namefr": "Genève", "code": "GE", "codeElected": "canton_GE" },
{ "namede": "Glarus", "namefr": "Glaris", "code": "GL", "codeElected": "canton_GL" },
{ "namede": "Graubünden", "namefr": "Grisons", "code": "GR", "codeElected": "canton_GR" },
{ "namede": "Jura", "namefr": "Jura", "code": "JU", "codeElected": "canton_JU" },
{ "namede": "Luzern", "namefr": "Lucerne", "code": "LU", "codeElected": "canton_LU" },
{ "namede": "Neuenburg", "namefr": "Neuchâtel", "code": "NE", "codeElected": "canton_NE" },
{ "namede": "Nidwalden", "namefr": "Nidwald", "code": "NW", "codeElected": "canton_NW" },
{ "namede": "Obwalden", "namefr": "Obwald", "code": "OW", "codeElected": "canton_OW" },
{ "namede": "St. Gallen", "namefr": "Saint-Gall", "code": "SG", "codeElected": "canton_SG" },
{ "namede": "Schaffhausen", "namefr": "Schaffhouse", "code": "SH", "codeElected": "canton_SH" },
{ "namede": "Solothurn", "namefr": "Soleure", "code": "SO", "codeElected": "canton_SO" },
{ "namede": "Schwyz", "namefr": "Schwytz", "code": "SZ", "codeElected": "canton_SZ" },
{ "namede": "Thurgau", "namefr": "Thurgovie", "code": "TG", "codeElected": "canton_TG" },
{ "namede": "Ticino", "namefr": "Tessin", "code": "TI", "codeElected": "canton_TI" },
{ "namede": "Uri", "namefr": "Uri", "code": "UR", "codeElected": "canton_UR" },
{ "namede": "Wallis", "namefr": "Valais", "code": "VS", "codeElected": "canton_VS" },
{ "namede": "Waadt", "namefr": "Vaud", "code": "VD", "codeElected": "canton_VD" },
{ "namede": "Zug", "namefr": "Zug", "code": "ZG", "codeElected": "canton_ZG" },
{ "namede": "Zürich", "namefr": "Zurich", "code": "ZH", "codeElected": "canton_ZH" }
{ "namede": "Aargau", "nameen": "Argovia", "namefr": "Argovie", "code": "AG", "codeElected": "canton_AG" },
{ "namede": "Appenzell Innerrhoden", "nameen": "Appenzell Inner-Rhodes", "namefr": "Appenzell Rhodes-Intérieures", "code": "AI", "codeElected": "canton_AI" },
{ "namede": "Appenzell Ausserrhoden", "nameen": "Appenzell Outer-Rhodes", "namefr": "Appenzell Rhodes-Extérieures", "code": "AR", "codeElected": "canton_AR" },
{ "namede": "Bern", "nameen": "Berne", "namefr": "Berne", "code": "BE", "codeElected": "canton_BE" },
{ "namede": "Basel-Landschaft", "nameen": "Basle-Country", "namefr": "Bâle-Campagne", "code": "BL", "codeElected": "canton_BL" },
{ "namede": "Basel-Stadt", "nameen": "Basle-City", "namefr": "Bâle-Ville", "code": "BS", "codeElected": "canton_BS" },
{ "namede": "Freiburg", "nameen": "Friburg", "namefr": "Fribourg", "code": "FR", "codeElected": "canton_FR" },
{ "namede": "Genf", "nameen": "Geneva", "namefr": "Genève", "code": "GE", "codeElected": "canton_GE" },
{ "namede": "Glarus", "nameen": "Glarus", "namefr": "Glaris", "code": "GL", "codeElected": "canton_GL" },
{ "namede": "Graubünden", "nameen": "Grisons", "namefr": "Grisons", "code": "GR", "codeElected": "canton_GR" },
{ "namede": "Jura", "nameen": "Jura", "namefr": "Jura", "code": "JU", "codeElected": "canton_JU" },
{ "namede": "Luzern", "nameen": "Lucerne", "namefr": "Lucerne", "code": "LU", "codeElected": "canton_LU" },
{ "namede": "Neuenburg", "nameen": "Neuchâtel", "namefr": "Neuchâtel", "code": "NE", "codeElected": "canton_NE" },
{ "namede": "Nidwalden", "nameen": "Nidwald", "namefr": "Nidwald", "code": "NW", "codeElected": "canton_NW" },
{ "namede": "Obwalden", "nameen": "Obwald", "namefr": "Obwald", "code": "OW", "codeElected": "canton_OW" },
{ "namede": "St. Gallen", "nameen": "St. Gall", "namefr": "Saint-Gall", "code": "SG", "codeElected": "canton_SG" },
{ "namede": "Schaffhausen", "nameen": "Schaffhouse", "namefr": "Schaffhouse", "code": "SH", "codeElected": "canton_SH" },
{ "namede": "Solothurn", "nameen": "Soleure", "namefr": "Soleure", "code": "SO", "codeElected": "canton_SO" },
{ "namede": "Schwyz", "nameen": "Schwyz", "namefr": "Schwytz", "code": "SZ", "codeElected": "canton_SZ" },
{ "namede": "Thurgau", "nameen": "Thurgovia", "namefr": "Thurgovie", "code": "TG", "codeElected": "canton_TG" },
{ "namede": "Ticino", "nameen": "Tessin", "namefr": "Tessin", "code": "TI", "codeElected": "canton_TI" },
{ "namede": "Uri", "nameen": "Uri", "namefr": "Uri", "code": "UR", "codeElected": "canton_UR" },
{ "namede": "Wallis", "nameen": "Valais", "namefr": "Valais", "code": "VS", "codeElected": "canton_VS" },
{ "namede": "Waadt", "nameen": "Vaud", "namefr": "Vaud", "code": "VD", "codeElected": "canton_VD" },
{ "namede": "Zug", "nameen": "Zoug", "namefr": "Zoug", "code": "ZG", "codeElected": "canton_ZG" },
{ "namede": "Zürich", "nameen": "Zurich", "namefr": "Zurich", "code": "ZH", "codeElected": "canton_ZH" }
]

20
src/assets/data/parties.json

@ -1,12 +1,12 @@
[
{ "order":3, "id": "party_abbr_3", "namede": "GPS", "namefr": "Vert", "color": "#84b415" },
{ "order":2, "id": "party_abbr_2", "namede": "SP", "namefr": "PS", "color": "#e9534b" },
{ "order":8, "id": "party_abbr_8", "namede": "CVP", "namefr": "PDC", "color": "#d1832a" },
{ "order":9, "id": "party_abbr_9", "namede": "FDP", "namefr": "PLR", "color": "#376fb0" },
{ "order":4, "id": "party_abbr_4", "namede": "EVP", "namefr": "PEV", "color": "#f8da01" },
{ "order":6, "id": "party_abbr_6", "namede": "BDP", "namefr": "PBD", "color": "#e0c31f" },
{ "order":5, "id": "party_abbr_5", "namede": "GLP", "namefr": "VertsLib", "color": "#bfbf3c" },
{ "order":1, "id": "party_abbr_1", "namede": "Linke divers", "namefr": "Autres gauches", "color": "#e32219" },
{ "order":11, "id": "party_abbr_11", "namede": "SVP", "namefr": "UDC", "color": "#49873c" },
{ "order":12, "id": "party_abbr_12", "namede": "Rechte divers", "namefr": "Autres droites", "color": "#c71585"}
{ "order":3, "id": "party_abbr_3", "namede": "GPS", "nameen": "GPS", "namefr": "Vert", "color": "#84b415" },
{ "order":2, "id": "party_abbr_2", "namede": "SP", "nameen": "SP", "namefr": "PS", "color": "#e9534b" },
{ "order":8, "id": "party_abbr_8", "namede": "CVP", "nameen": "CVP", "namefr": "PDC", "color": "#d1832a" },
{ "order":9, "id": "party_abbr_9", "namede": "FDP", "nameen": "FDP", "namefr": "PLR", "color": "#376fb0" },
{ "order":4, "id": "party_abbr_4", "namede": "EVP", "nameen": "EVP", "namefr": "PEV", "color": "#f8da01" },
{ "order":6, "id": "party_abbr_6", "namede": "BDP", "nameen": "BDP", "namefr": "PBD", "color": "#e0c31f" },
{ "order":5, "id": "party_abbr_5", "namede": "GLP", "nameen": "GLP", "namefr": "VertsLib", "color": "#bfbf3c" },
{ "order":1, "id": "party_abbr_1", "namede": "Linke divers", "nameen": "Various Left-Wing", "namefr": "Autres gauches", "color": "#e32219" },
{ "order":11, "id": "party_abbr_11", "namede": "SVP", "nameen": "SVP", "namefr": "UDC", "color": "#49873c" },
{ "order":12, "id": "party_abbr_12", "namede": "Rechte divers", "nameen": "Various Right-Wing", "namefr": "Autres droites", "color": "#c71585"}
]

26
src/assets/data/repartitions.js

@ -1,13 +1,14 @@
import fr from '../lang/fr';
import de from '../lang/de';
import en from '../lang/en';
const ageGroups = [
{ namede: '18-30', namefr: '18-30', value: 'below 30', bounds: [0,29] },
{ namede: '30-39', namefr: '30-39', value: '30-39', bounds: [30,39] },
{ namede: '40-49', namefr: '40-49', value: '40-49', bounds: [40,49] },
{ namede: '50-59', namefr: '50-59', value: '50-59', bounds: [50,59] },
{ namede: '60-69', namefr: '60-69', value: '60-69', bounds: [60, 69] },
{ namede: '69+', namefr: '69+', value: 'above 69', bounds: [70, 150] },
{ namede: '18-30', nameen: '18-30', namefr: '18-30', value: 'below 30', bounds: [0,29] },
{ namede: '30-39', nameen: '30-39', namefr: '30-39', value: '30-39', bounds: [30,39] },
{ namede: '40-49', nameen: '40-49', namefr: '40-49', value: '40-49', bounds: [40,49] },
{ namede: '50-59', nameen: '50-59', namefr: '50-59', value: '50-59', bounds: [50,59] },
{ namede: '60-69', nameen: '60-69', namefr: '60-69', value: '60-69', bounds: [60, 69] },
{ namede: '69+', nameen: '69+', namefr: '69+', value: 'above 69', bounds: [70, 150] },
];
const color2 = [ '#00b48b', '#2d43b2' ];
@ -20,31 +21,34 @@ export default [
{
"id": "gender",
"icon": "/genre.svg",
"namede": de.siegesByGender,
"namede": de.siegesByGender,
"nameen": en.siegesByGender,
"namefr": fr.siegesByGender,
"field": "gender",
"colors": color2,
"variables": [
{ namede: de.variableGenderFemales, namefr: fr.variableGenderFemales, value: 'f' },
{ namede: de.variableGenderMales, namefr: fr.variableGenderMales, value: 'm' }
{ namede: de.variableGenderFemales, nameen: en.variableGenderFemales, namefr: fr.variableGenderFemales, value: 'f' },
{ namede: de.variableGenderMales, nameen: en.variableGenderMales, namefr: fr.variableGenderMales, value: 'm' }
]
},
{
"id": "location",
"icon": "/lieu.svg",
"namede": de.siegesByLocation,
"nameen": en.siegesByLocation,
"namefr": fr.siegesByLocation,
"field": "urbanRural",
"colors": color2,
"variables": [
{ namede: de.variableGenderUrban, namefr: fr.variableGenderUrban, value: 'urban' },
{ namede: de.variableGenderRural, namefr: fr.variableGenderRural, value: 'rural' }
{ namede: de.variableGenderUrban, nameen: en.variableGenderUrban, namefr: fr.variableGenderUrban, value: 'urban' },
{ namede: de.variableGenderRural, nameen: en.variableGenderRural, namefr: fr.variableGenderRural, value: 'rural' }
]
},
{
"id": "age",
"icon": "/age.svg",
"namede": de.siegesByAge,
"nameen": en.siegesByAge,
"namefr": fr.siegesByAge,
"field": "ageGroup",
"colors": color6,

9
src/assets/data/scenarios.js

@ -1,9 +1,10 @@
import fr from '../lang/fr';
import de from '../lang/de';
import en from '../lang/en';
export default [
{ "id": "scenarioBase", "namede": de.scenarioOfficial, "namefr": fr.scenarioOfficial },
{ "id": "scenarioGender", "namede": de.scenarioGender, "namefr": fr.scenarioGender },
{ "id": "scenarioGenderAge", "namede": de.scenarioGenderAge, "namefr": fr.scenarioGenderAge },
{ "id": "scenarioAgeUrban", "namede": de.scenarioLocationAge, "namefr": fr.scenarioLocationAge }
{ "id": "scenarioBase", "namede": de.scenarioOfficial, "nameen": en.scenarioOfficial, "namefr": fr.scenarioOfficial },
{ "id": "scenarioGender", "namede": de.scenarioGender, "nameen": en.scenarioGender, "namefr": fr.scenarioGender },
{ "id": "scenarioGenderAge", "namede": de.scenarioGenderAge, "nameen": en.scenarioGenderAge, "namefr": fr.scenarioGenderAge },
{ "id": "scenarioAgeUrban", "namede": de.scenarioLocationAge, "nameen": en.scenarioLocationAge, "namefr": fr.scenarioLocationAge }
]

92
src/assets/lang/en.js

@ -0,0 +1,92 @@
/**
* La stratégie d'extraction des lignes de texte dans l'application suit la logique suivante :
*
* - On trie toutes les lignes de tous les layouts, ceux-ci par ordre alphabétique ;
* - On trie toutes les lignes de tous les components, ceux-ci par ordre alphabétique ;
* - Certains fichiers de données utilisent eux aussi des lignes de texte, qu'on affiche en dernier.
*
* Lorsqu'une ligne de texte revient dans un fichier, on utilise sa définition pré-existante.
* Vu la taille de l'application, il n'est pas nécessaire de séparer les lignes de textes en plusieurs "sous-domaines".
*/
export default {
// layouts/defaults.vue
subtitle: '2019 National Council Elections',
toFairElection: 'To FairElection',
readyToFair: 'Are you ready to create a more diverse electoral list?',
tryFair: 'Give FairElection a Try',
address: 'Address',
contact: 'Contact Us',
// components/CandidateCard.vue
newElection: 'New Election',
incumbent: 'Incumbent',
urbanArea: 'Urban Area',
ruralArea: 'Rural Area',
votes: 'Votes',
ageGroup: 'Age Groups',
canton: 'Canton',
gender: 'Gender',
female: 'Female',
male: 'Male',
// components/CantonTable.vue
candidatesList: 'List of candidates',
name: 'Name',
elected: 'Elected',
party: 'Party',
location: 'Region',
age: 'Age',
// components/IndexBars.vue
compareTitle: 'Comparison of Results According to Different Representation Criteria',
repartitionOfSieges: 'No Seat | A Single Seat | Distribution of {n} Seats',
filterScenarios: 'Review Comparative Scenarios',
disclaimerData: 'The statistics in this illustration are taken from the #[a(href="https://www.bfs.admin.ch/bfs/de/home.html" target="_blank") Federal Statistical Office].',
// components/IndexDescription.vue
welcome: 'Welcome to the Simulation of the 2019 Swiss National Council Elections !',
welcomeText: '<p>What would the Swiss National Council look like if gender, age group, and region (urban/rural) were proportionally represented? This tool presents three scenarios for applying additional criteria to an election. Select a scenario and click on a canton in order to compare it to the official election result. The simulation is based on the actual 2019 election and the votes that candidates received. The number of seats allocated to each party is fixed and corresponds to the actual election results.</p><p> The criteria of gender, age, and region are applied at the cantonal level. The distribution of ages and regions depends on cantonal demographics (figures from the FSO). Do you have notes or feedback regarding this simulation? <a href="mailto:info@fairelection.ch">Please write to us</a>! </p><p>Interested in how the "FairElection" tool is applied ? The tool is available for free <a href="https://fairelection.ch">here</a> .</p>',
disclaimer: 'Attention',
disclaimerText: 'This simulation does not take all the mechanisms of the official election into account, E.g., Party affiliation (combined electoral lists are treated as a single electoral list), Side effects of the system of proportional representation (large disparities in votes cast for candidates from different parties), Individuals who have abstained from the election, etc. This tool is meant to catalyse discussion, not to replace formal electoral systems.',
// components/IndexHemisphere.vue
selectScenario: 'Select a scenario for the 2019 Swiss National Council Election.',
selectCanton: 'Select a canton in order to view detailed results.',
resultsBy: 'Results {scenario}',
allCantons: 'All Cantons',
nationalComposition: 'This is how the Swiss National Council would look based on the selected scenario...',
hemisphereElectedLineOne: 'Elected according to', // this sentence is split in three, so that it fits the visualization. Extra care for translation!
hemisphereElectedLineTwo: 'the selected',
hemisphereElectedLineThree: 'scenario',
hemisphereRejectedLineOne: 'Individuals', // this sentence is split in three, so that it fits the visualization. Extra care for translation!
hemisphereRejectedLineTwo: 'not elected',
hemisphereRejectedLineThree: 'according to the selected scenario',
clickASiege: 'Click on a seat to learn more about the elected individual.',
// components/IndexRepartitions.vue
detailsCanton: 'Details for the Canton of <em>{canton}</em> | Details for the Canton of <em>{canton}</em> in this scenario <em>{scenario}</em>',
nbVotesText: 'This group of elected individuals received a total of <strong>{totalVotes}</strong> votes. The winners of the actual election received a total of <strong>{baseTotalVotes}</strong> votes. The results of the actual election and the selected scenario differed by <strong>{differenceVotes}</strong> votes (<strong>{differencePercentage}%</strong>)',
nbVotesSimilarText: 'The official election results already fulfill the criteria for the selected scenario.',
// assets/repartitions.js
siegesByGender: 'Distribution of Seats by Gender',
siegesByLocation: 'Distribution of Seats by Region',
siegesByAge: 'Distribution of Seats by Age',
variableGenderFemales: 'Females',
variableGenderMales: 'Males',
variableGenderUrban: 'Urban',
variableGenderRural: 'Rural',
// assets/scenarios.js
scenarioOfficial: 'Official',
scenarioGender: 'with the criteria of gender',
scenarioGenderAge: 'with the criteria of gender and age',
scenarioLocationAge: 'with the criteria of age and region'
}

1
src/layouts/default.vue

@ -10,6 +10,7 @@
select(v-model="locale")
option(value="fr") FR
option(value="de") DE
option(value="en") EN
nuxt
footer.site-footer
section.site-referer

Loading…
Cancel
Save