Skip to content

Commit

Permalink
Add French translation (electricitymaps#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
corradio authored Feb 8, 2017
1 parent f1c7124 commit fb7e47c
Show file tree
Hide file tree
Showing 13 changed files with 428 additions and 146 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ web/node_modules
*.suo
*.user
/.vs/config
/App_Data/PublishProfiles
*.publishproj
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- './web/server.js:/home/web/server.js'
- './web/views:/home/web/views'
- './web/webpack.config.js:/home/web/webpack.config.js'
- './web/locales:/home/web/locales'
feeder:
build:
context: .
Expand Down
128 changes: 128 additions & 0 deletions web/app/configs/lang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"en": {
"wind": "wind",
"solar": "solar",
"hydro": "hydro",
"hydro storage": "hydro storage",
"biomass": "biomass",
"nuclear": "nuclear",
"geothermal": "geothermal",
"gas": "gas",
"coal": "coal",
"oil": "oil",
"unknown": "unknown",
"exportto": "of export to",
"importfrom": "of import from",
"productionimport": "production/import",
"consumption": "consumption",
"electricityfrom": "electricity comes from",
"electricityto": "electricity is exported to",
"electricitystored": "electricity is stored using",
"zoneShortName": {
"AL": "Albania",
"AT": "Austria",
"BA": "Bosnia and Herzegovina",
"BE": "Belgium",
"BG": "Bulgaria",
"BY": "Belarus",
"CH": "Switzerland",
"CZ": "Czechia",
"DE": "Germany",
"DK": "Denmark",
"EE": "Estonia",
"ES": "Spain",
"FI": "Finland",
"FR": "France",
"GB": "Great Britain",
"GB-NIR": "Northern Ireland",
"GR": "Greece",
"HR": "Croatia",
"HU": "Hungary",
"IE": "Ireland",
"IS": "Iceland",
"IT": "Italy",
"LT": "Lithuania",
"LU": "Luxembourg",
"LV": "Latvia",
"MD": "Moldova",
"ME": "Montenegro",
"MK": "Rep. of Macedonia (FYROM)",
"MT": "Malta",
"NL": "Netherlands",
"NO": "Norway",
"PL": "Poland",
"PT": "Portugal",
"RO": "Romania",
"RS": "Serbia",
"RU": "Russia",
"SE": "Sweden",
"SI": "Slovenia",
"SK": "Slovakia",
"TR": "Turkey",
"UA": "Ukraine"
}
},
"fr": {
"wind": "éolien",
"solar": "solaire",
"hydro": "hydro",
"hydro storage": "stockage hydro",
"biomass": "biomasse",
"nuclear": "nucléaire",
"geothermal": "géothermie",
"gas": "gaz",
"coal": "charbon",
"oil": "fioul",
"unknown": "inconnu",
"exportto": "exportée vers",
"importfrom": " importée depuis",
"productionimport": "production/import",
"consumption": "consommation",
"electricityfrom": "est produite par",
"electricityto": "est exportée vers",
"electricitystored": "est stockée par",
"zoneShortName": {
"AL": "Albanie",
"AT": "Autriche",
"BA": "Bosnie-Herzégovine",
"BE": "Belgique",
"BG": "Bulgarie",
"BY": "Biélorussie",
"CH": "Suisse",
"CZ": "République tchèque",
"DE": "Allemagne",
"DK": "Danemark",
"EE": "Estonie",
"ES": "Espagne",
"FI": "Finlande",
"FR": "France",
"GB": "Grande-Bretagne",
"GB-NIR": "Irlande du Nord",
"GR": "Grèce",
"HR": "Croatie",
"HU": "Hongrie",
"IE": "Irlande",
"IS": "Islande",
"IT": "Italie",
"LT": "Lituanie",
"LU": "Luxembourg",
"LV": "Lettonie",
"MD": "Moldavie",
"ME": "Monténégro",
"MK": "Rép. de Macédoine (FYROM)",
"MT": "Malte",
"NL": "Pays-Bas",
"NO": "Norvège",
"PL": "Pologne",
"PT": "Portugal",
"RO": "Roumanie",
"RS": "Serbie",
"RU": "Russie",
"SE": "Suède",
"SI": "Slovénie",
"SK": "Slovaquie",
"TR": "Turquie",
"UA": "Ukraine"
}
}
}
129 changes: 46 additions & 83 deletions web/app/configs/zones.json
Original file line number Diff line number Diff line change
@@ -1,163 +1,126 @@
{
"AL": {
"country_iso_a2": "AL",
"shortname": "Albania"
"country_iso_a2": "AL"
},
"AT": {
"country_iso_a2": "AT",
"shortname": "Austria"
"country_iso_a2": "AT"
},
"BA": {
"country_iso_a2": "BA",
"shortname": "Bosnia and Herzegovina"
"country_iso_a2": "BA"
},
"BE": {
"country_iso_a2": "BE",
"shortname": "Belgium"
"country_iso_a2": "BE"
},
"BG": {
"country_iso_a2": "BG",
"shortname": "Bulgaria"
"country_iso_a2": "BG"
},
"BY": {
"country_iso_a2": "BY",
"shortname": "Belarus"
"country_iso_a2": "BY"
},
"CH": {
"country_iso_a2": "CH",
"shortname": "Switzerland"
"country_iso_a2": "CH"
},
"CZ": {
"country_iso_a2": "CZ",
"shortname": "Czechia"
"country_iso_a2": "CZ"
},
"DE": {
"country_iso_a2": "DE",
"shortname": "Germany"
"country_iso_a2": "DE"
},
"DK": {
"country_iso_a2": "DK",
"shortname": "Denmark"
"country_iso_a2": "DK"
},
"EE": {
"country_iso_a2": "EE",
"shortname": "Estonia"
"country_iso_a2": "EE"
},
"ES": {
"country_iso_a2": "ES",
"shortname": "Spain"
"country_iso_a2": "ES"
},
"FI": {
"country_iso_a2": "FI",
"shortname": "Finland"
"country_iso_a2": "FI"
},
"FR": {
"country_iso_a2": "FR",
"shortname": "France"
"country_iso_a2": "FR"
},
"GB": {
"country_iso_a2": "GB",
"shortname": "Great Britain",
"_comment": "Key should be GB-GBN (see https://en.wikipedia.org/wiki/ISO_3166-2:GB)"
},
"GB-NIR": {
"country_iso_a2": "GB",
"shortname": "Northern Ireland"
"country_iso_a2": "GB"
},
"GR": {
"country_iso_a2": "GR",
"shortname": "Greece"
"country_iso_a2": "GR"
},
"HR": {
"country_iso_a2": "HR",
"shortname": "Croatia"
"country_iso_a2": "HR"
},
"HU": {
"country_iso_a2": "HU",
"shortname": "Hungary"
"country_iso_a2": "HU"
},
"IE": {
"country_iso_a2": "IE",
"shortname": "Ireland"
"country_iso_a2": "IE"
},
"IS": {
"country_iso_a2": "IS"
},
"IT": {
"country_iso_a2": "IT",
"shortname": "Italy"
"country_iso_a2": "IT"
},
"LT": {
"country_iso_a2": "LT",
"shortname": "Lithuania"
"country_iso_a2": "LT"
},
"LU": {
"country_iso_a2": "LU",
"shortname": "Luxembourg"
"country_iso_a2": "LU"
},
"LV": {
"country_iso_a2": "LV",
"shortname": "Latvia"
"country_iso_a2": "LV"
},
"MD": {
"country_iso_a2": "MD"
},
"ME": {
"country_iso_a2": "ME"
},
"MK": {
"country_iso_a2": "MK",
"shortname": "Rep. of Macedonia (FYROM)"
"country_iso_a2": "MK"
},
"MT": {
"country_iso_a2": "MT"
},
"NL": {
"country_iso_a2": "NL",
"shortname": "Netherlands"
"country_iso_a2": "NL"
},
"NO": {
"country_iso_a2": "NO",
"shortname": "Norway"
"country_iso_a2": "NO"
},
"PL": {
"country_iso_a2": "PL",
"shortname": "Poland"
"country_iso_a2": "PL"
},
"PT": {
"country_iso_a2": "PT",
"shortname": "Portugal"
"country_iso_a2": "PT"
},
"RO": {
"country_iso_a2": "RO",
"shortname": "Romania"
"country_iso_a2": "RO"
},
"RS": {
"country_iso_a2": "RS",
"shortname": "Serbia"
"country_iso_a2": "RS"
},
"RU": {
"country_iso_a2": "RU",
"shortname": "Russia"
"country_iso_a2": "RU"
},
"SE": {
"country_iso_a2": "SE",
"shortname": "Sweden"
"country_iso_a2": "SE"
},
"SI": {
"country_iso_a2": "SI",
"shortname": "Slovenia"
"country_iso_a2": "SI"
},
"SK": {
"country_iso_a2": "SK",
"shortname": "Slovakia"
"country_iso_a2": "SK"
},
"TR": {
},
"IS": {
"country_iso_a2": "IS",
"shortname": "Iceland"
},
"MD": {
"country_iso_a2": "MD",
"shortname": "Moldova"
},
"ME": {
"country_iso_a2": "ME",
"shortname": "Montenegro"
"country_iso_a2": "TR"
},
"UA": {
"country_iso_a2": "UA",
"shortname": "Ukraine"
"country_iso_a2": "UA"
}
}
5 changes: 3 additions & 2 deletions web/app/countrytable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var d3 = require('d3');
var lang = require('json-loader!./configs/lang.json')[locale];
var moment = require('moment');

// TODO:
Expand Down Expand Up @@ -55,7 +56,7 @@ function CountryTable(selector, co2Color, modeColor, modeOrder) {
return 'translate(0,' + (i * (that.ROW_HEIGHT + that.PADDING_Y)) + ')';
});
gNewRow.append('text')
.text(function(d) { return d.mode })
.text(function(d) { return lang[d.mode] || d.mode })
.attr('transform', 'translate(0, ' + this.TEXT_ADJUST_Y + ')');
gNewRow.append('rect')
.attr('class', 'capacity')
Expand Down Expand Up @@ -368,7 +369,6 @@ CountryTable.prototype.resize = function() {

CountryTable.prototype.data = function(arg) {
var that = this;

if (!arg) return this._data;

this._data = arg;
Expand All @@ -393,6 +393,7 @@ CountryTable.prototype.data = function(arg) {
isStorage: d.isStorage,
capacity: capacity,
mode: d.mode,
text: lang[d.mode],
gCo2eqPerkWh: footprint,
gCo2eqPerH: footprint * 1000.0 * Math.max(production, 0)
};
Expand Down
Loading

0 comments on commit fb7e47c

Please sign in to comment.