Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
feat: incorporate @MastaBaba translation to pt, and add strings
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Apr 11, 2019
1 parent 47d5110 commit e4154c8
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 58 deletions.
22 changes: 12 additions & 10 deletions docs/lib/main.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -19788,10 +19788,16 @@

function makeLimitsSource(parent) {
var par = parent.select('#details-footer #source').html(null);
par.append('h4').text('Source');
par.append('h4').html('Source');
var ul = par.append('ul');
ul.append('li').text('pesticides concentration data: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 measurements in municipalities between 2014 and 2017.');
ul.append('li').text('population estimation: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
var li1 = ul.append('li');
li1.append('span').text('Agrotoxics concentration: ');
li1.append('a').attr('href', 'http://dados.gov.br/dataset/controle-semestral').text('SISAGUA - Controle Semestral');
li1.append('span').text('. Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 tests in municipalities between 2014 and 2017.');
var li2 = ul.append('li');
li2.append('span').text('Population estimates: ');
li2.append('a').attr('href', 'ftp://ftp.ibge.gov.br/Estimativas_de_Populacao/Estimativas_2017/').text('TCU 2017');
li2.append('span').text('. Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
}

function startLoading$1(element) {
Expand Down Expand Up @@ -23926,8 +23932,6 @@
var saturday = weekday(6);

var sundays = sunday.range;
var mondays = monday.range;
var thursdays = thursday.range;

var month = newInterval(function(date) {
date.setDate(1);
Expand Down Expand Up @@ -24017,8 +24021,6 @@
var utcSaturday = utcWeekday(6);

var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcThursdays = utcThursday.range;

var utcMonth = newInterval(function(date) {
date.setUTCDate(1);
Expand Down Expand Up @@ -25332,7 +25334,7 @@
var xx = linear$1().domain([0, cfg$2.max]).rangeRound([0, cfg$2.legendCocktail.width * cfg$2.max]);
var legend = parent.append('g').classed('legend', true) //.style('font-size', '0.8rem')
//.style('font-family', 'sans-serif')
.attr('transform', 'translate(550,66) scale(1.3)');
.attr('transform', 'translate(530,66) scale(1.3)');
legend.selectAll('rect').data(sequence(0, cfg$2.max, 1)).enter().append('rect').attr('height', cfg$2.legendCocktail.height).attr('x', function (el) {
return xx(el);
}).attr('width', cfg$2.legendCocktail.width).attr('fill', function (el) {
Expand All @@ -25343,7 +25345,7 @@
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine1).attr('font-weight', 'bold').text('Number of pesticides detected in');
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine2).attr('font-weight', 'bold').text('drinking water'); // TODO: i18n

label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).text('(light: none, dark: 27 different pesticides)'); // Scale
label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).attr('font-size', '0.9rem').text('(light: none, dark: 27 different pesticides)'); // Scale

legend.append('g').call(axisBottom(xx).tickSize(cfg$2.legendCocktail.tickSize)).select('.domain').remove();
}
Expand All @@ -25361,7 +25363,7 @@
}).attr('width', cfg$2.legendLimits.width);
legend.selectAll('text').data(legendKeys).enter().append('text').attr('x', cfg$2.legendLimits.label.xOffset).attr('y', function (key, idx) {
return yy(idx) + cfg$2.legendLimits.label.yOffset;
}).text(function (key) {
}).attr('font-size', '0.9rem').text(function (key) {
return legendLabels[key];
});
var label = legend.append('g').attr('fill', '#000').attr('text-anchor', 'start'); // TODO: i18n
Expand Down
22 changes: 12 additions & 10 deletions docs/lib/main.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -19788,10 +19788,16 @@

function makeLimitsSource(parent) {
var par = parent.select('#details-footer #source').html(null);
par.append('h4').text('Fuente');
par.append('h4').html('Fuente');
var ul = par.append('ul');
ul.append('li').text('datos de concentración de pesticidas: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 mediciones en municipalidades entre 2014 y 2017.');
ul.append('li').text('población estimada: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
var li1 = ul.append('li');
li1.append('span').text('Concentración de pesticidas: ');
li1.append('a').attr('href', 'http://dados.gov.br/dataset/controle-semestral').text('SISAGUA - Controle Semestral');
li1.append('span').text('. Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 tests a nivel municipal de 2014 a 2017.');
var li2 = ul.append('li');
li2.append('span').text('Estimaciones de población: ');
li2.append('a').attr('href', 'ftp://ftp.ibge.gov.br/Estimativas_de_Populacao/Estimativas_2017/').text('TCU 2017');
li2.append('span').text('. Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
}

function startLoading$1(element) {
Expand Down Expand Up @@ -23926,8 +23932,6 @@
var saturday = weekday(6);

var sundays = sunday.range;
var mondays = monday.range;
var thursdays = thursday.range;

var month = newInterval(function(date) {
date.setDate(1);
Expand Down Expand Up @@ -24017,8 +24021,6 @@
var utcSaturday = utcWeekday(6);

var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcThursdays = utcThursday.range;

var utcMonth = newInterval(function(date) {
date.setUTCDate(1);
Expand Down Expand Up @@ -25332,7 +25334,7 @@
var xx = linear$1().domain([0, cfg$2.max]).rangeRound([0, cfg$2.legendCocktail.width * cfg$2.max]);
var legend = parent.append('g').classed('legend', true) //.style('font-size', '0.8rem')
//.style('font-family', 'sans-serif')
.attr('transform', 'translate(550,66) scale(1.3)');
.attr('transform', 'translate(530,66) scale(1.3)');
legend.selectAll('rect').data(sequence(0, cfg$2.max, 1)).enter().append('rect').attr('height', cfg$2.legendCocktail.height).attr('x', function (el) {
return xx(el);
}).attr('width', cfg$2.legendCocktail.width).attr('fill', function (el) {
Expand All @@ -25343,7 +25345,7 @@
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine1).attr('font-weight', 'bold').text('Número de pesticidas detectados');
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine2).attr('font-weight', 'bold').text('en el agua potable'); // TODO: i18n

label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).text('(claro: 0, oscuro: 27 pesticidas diferentes)'); // Scale
label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).attr('font-size', '0.9rem').text('(claro: 0, oscuro: 27 pesticidas diferentes)'); // Scale

legend.append('g').call(axisBottom(xx).tickSize(cfg$2.legendCocktail.tickSize)).select('.domain').remove();
}
Expand All @@ -25361,7 +25363,7 @@
}).attr('width', cfg$2.legendLimits.width);
legend.selectAll('text').data(legendKeys).enter().append('text').attr('x', cfg$2.legendLimits.label.xOffset).attr('y', function (key, idx) {
return yy(idx) + cfg$2.legendLimits.label.yOffset;
}).text(function (key) {
}).attr('font-size', '0.9rem').text(function (key) {
return legendLabels[key];
});
var label = legend.append('g').attr('fill', '#000').attr('text-anchor', 'start'); // TODO: i18n
Expand Down
38 changes: 20 additions & 18 deletions docs/lib/main.pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -19788,10 +19788,16 @@

function makeLimitsSource(parent) {
var par = parent.select('#details-footer #source').html(null);
par.append('h4').text('Fuente');
par.append('h4').html('Fonte');
var ul = par.append('ul');
ul.append('li').text('datos de concentración de pesticidas: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 mediciones en municipalidades entre 2014 y 2017.');
ul.append('li').text('población estimada: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
var li1 = ul.append('li');
li1.append('span').text('Concentração de agrotóxicos: ');
li1.append('a').attr('href', 'http://dados.gov.br/dataset/controle-semestral').text('SISAGUA - Controle Semestral');
li1.append('span').text('. Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 testes a nível municipal de 2014 a 2017.');
var li2 = ul.append('li');
li2.append('span').text('Estimativas da população: ');
li2.append('a').attr('href', 'ftp://ftp.ibge.gov.br/Estimativas_de_Populacao/Estimativas_2017/').text('TCU 2017');
li2.append('span').text('. Instituto Brasileiro de Geografia e Estatística (IBGE), 2017.');
}

function startLoading$1(element) {
Expand Down Expand Up @@ -23926,8 +23932,6 @@
var saturday = weekday(6);

var sundays = sunday.range;
var mondays = monday.range;
var thursdays = thursday.range;

var month = newInterval(function(date) {
date.setDate(1);
Expand Down Expand Up @@ -24017,8 +24021,6 @@
var utcSaturday = utcWeekday(6);

var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcThursdays = utcThursday.range;

var utcMonth = newInterval(function(date) {
date.setUTCDate(1);
Expand Down Expand Up @@ -25312,10 +25314,10 @@
};
var legendKeys = ['SUP_BR', 'SUP_EU', 'BELOW', 'NO_TEST'];
var legendLabels = {
BELOW: 'todos los pesticidas bajo los límites',
NO_TEST: 'sin datos',
SUP_BR: 'pesticida(s) encima del límite brasilero',
SUP_EU: 'pesticida(s) encima del límite europeo'
BELOW: 'todos os agrotóxicos abaixo dos limites',
NO_TEST: 'sem dados',
SUP_BR: 'pelo menos um acima do limite brasileiro',
SUP_EU: 'pelo menos um acima do limite europeu'
};
function createLegend(parent, dispatcher) {
dispatcher.on('make-app-cocktail.legend', function () {
Expand All @@ -25332,18 +25334,18 @@
var xx = linear$1().domain([0, cfg$2.max]).rangeRound([0, cfg$2.legendCocktail.width * cfg$2.max]);
var legend = parent.append('g').classed('legend', true) //.style('font-size', '0.8rem')
//.style('font-family', 'sans-serif')
.attr('transform', 'translate(550,66) scale(1.3)');
.attr('transform', 'translate(530,66) scale(1.3)');
legend.selectAll('rect').data(sequence(0, cfg$2.max, 1)).enter().append('rect').attr('height', cfg$2.legendCocktail.height).attr('x', function (el) {
return xx(el);
}).attr('width', cfg$2.legendCocktail.width).attr('fill', function (el) {
return cocktailColor(el);
});
var label = legend.append('g').attr('fill', '#000').attr('text-anchor', 'start'); // TODO: i18n

label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine1).attr('font-weight', 'bold').text('Número de pesticidas detectados');
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine2).attr('font-weight', 'bold').text('en el agua potable'); // TODO: i18n
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine1).attr('font-weight', 'bold').text('Número de pesticidas detectados em');
label.append('text').attr('y', -cfg$2.legendCocktail.titleOffsetLine2).attr('font-weight', 'bold').text('na água potável'); // TODO: i18n

label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).text('(claro: 0, oscuro: 27 pesticidas diferentes)'); // Scale
label.append('text').attr('y', -cfg$2.legendCocktail.subtitleOffset).attr('font-size', '0.9rem').text('(claro: nenhum, escuro: 27 agrotóxicos diferentes)'); // Scale

legend.append('g').call(axisBottom(xx).tickSize(cfg$2.legendCocktail.tickSize)).select('.domain').remove();
}
Expand All @@ -25361,13 +25363,13 @@
}).attr('width', cfg$2.legendLimits.width);
legend.selectAll('text').data(legendKeys).enter().append('text').attr('x', cfg$2.legendLimits.label.xOffset).attr('y', function (key, idx) {
return yy(idx) + cfg$2.legendLimits.label.yOffset;
}).text(function (key) {
}).attr('font-size', '0.9rem').text(function (key) {
return legendLabels[key];
});
var label = legend.append('g').attr('fill', '#000').attr('text-anchor', 'start'); // TODO: i18n

label.append('text').attr('y', -cfg$2.legendLimits.titleOffset).attr('font-weight', 'bold').text('Pesticidas detectados por encima');
label.append('text').attr('y', -cfg$2.legendLimits.subtitleOffset).attr('font-weight', 'bold').text('de los límites legales en el agua potable');
label.append('text').attr('y', -cfg$2.legendLimits.titleOffset).attr('font-weight', 'bold').text('Agrotóxicos detectados acima dos limites legais');
label.append('text').attr('y', -cfg$2.legendLimits.subtitleOffset).attr('font-weight', 'bold').text('do limite legal na água potável');
}

function createOverlay(parent, dispatcher, data, canvas, dataWidth) {
Expand Down
21 changes: 18 additions & 3 deletions src/_javascript/details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,25 @@ function makeCocktailSource(parent) {

function makeLimitsSource(parent) {
const par = parent.select('#details-footer #source').html(null);
par.append('h4').text('{{details.cocktail.footer.source1}}');
par.append('h4').html('{{details.cocktail.footer.source1}}');
const ul = par.append('ul');
ul.append('li').text('{{details.cocktail.footer.source2}}');
ul.append('li').text('{{details.cocktail.footer.source3}}');
const li1 = ul.append('li');
li1.append('span').text('{{details.cocktail.footer.source21}}');
li1
.append('a')
.attr('href', 'http://dados.gov.br/dataset/controle-semestral')
.text('{{details.cocktail.footer.source22}}');
li1.append('span').text('{{details.cocktail.footer.source23}}');
const li2 = ul.append('li');
li2.append('span').text('{{details.cocktail.footer.source31}}');
li2
.append('a')
.attr(
'href',
'ftp://ftp.ibge.gov.br/Estimativas_de_Populacao/Estimativas_2017/'
)
.text('{{details.cocktail.footer.source32}}');
li2.append('span').text('{{details.cocktail.footer.source33}}');
}

function startLoading(element) {
Expand Down
4 changes: 3 additions & 1 deletion src/_javascript/map/layers/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function createLegendCocktail(parent) {
.classed('legend', true)
//.style('font-size', '0.8rem')
//.style('font-family', 'sans-serif')
.attr('transform', 'translate(550,66) scale(1.3)');
.attr('transform', 'translate(530,66) scale(1.3)');

legend
.selectAll('rect')
Expand Down Expand Up @@ -81,6 +81,7 @@ function createLegendCocktail(parent) {
label
.append('text')
.attr('y', -cfg.legendCocktail.subtitleOffset)
.attr('font-size', '0.9rem')
.text('{{map.legend.cocktail3}}');

// Scale
Expand Down Expand Up @@ -122,6 +123,7 @@ function createLegendLimits(parent) {
.append('text')
.attr('x', cfg.legendLimits.label.xOffset)
.attr('y', (key, idx) => yy(idx) + cfg.legendLimits.label.yOffset)
.attr('font-size', '0.9rem')
.text(key => legendLabels[key]);

const label = legend
Expand Down
8 changes: 6 additions & 2 deletions src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
"tolimits1": "Discover how many substances have been",
"tolimits2": "detected above the legal limits",
"source1": "Source",
"source2": "pesticides concentration data: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 measurements in municipalities between 2014 and 2017.",
"source3": "population estimation: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
"source21": "Agrotoxics concentration: ",
"source22": "SISAGUA - Controle Semestral",
"source23": ". Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 tests in municipalities between 2014 and 2017.",
"source31": "Population estimates: ",
"source32": "TCU 2017",
"source33": ". Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
}
},
"limits": {
Expand Down
8 changes: 6 additions & 2 deletions src/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
"tolimits1": "Descubra cuántas sustancias fueron",
"tolimits2": "detectadas por encima de los límites legales",
"source1": "Fuente",
"source2": "datos de concentración de pesticidas: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 mediciones en municipalidades entre 2014 y 2017.",
"source3": "población estimada: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
"source21": "Concentración de pesticidas: ",
"source22": "SISAGUA - Controle Semestral",
"source23": ". Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 tests a nivel municipal de 2014 a 2017.",
"source31": "Estimaciones de población: ",
"source32": "TCU 2017",
"source33": ". Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
}
},
"limits": {
Expand Down
28 changes: 16 additions & 12 deletions src/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
"footer": {
"tolimits1": "Descubra quantas substâncias foram",
"tolimits2": "detectado acima dos limites legais",
"source1": "Fuente",
"source2": "datos de concentración de pesticidas: Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 mediciones en municipalidades entre 2014 y 2017.",
"source3": "población estimada: Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
"source1": "Fonte",
"source21": "Concentração de agrotóxicos: ",
"source22": "SISAGUA - Controle Semestral",
"source23": ". Sistema de Informação de Vigilância da Qualidade da Água para Consumo Humano (SISAGUA), 854.140 testes a nível municipal de 2014 a 2017.",
"source31": "Estimativas da população: ",
"source32": "TCU 2017",
"source33": ". Instituto Brasileiro de Geografia e Estatística (IBGE), 2017."
}
},
"limits": {
Expand Down Expand Up @@ -67,16 +71,16 @@
"locale": "pt-BR",
"map": {
"legend": {
"cocktail1": "Número de pesticidas detectados",
"cocktail2": "en el agua potable",
"cocktail3": "(claro: 0, oscuro: 27 pesticidas diferentes)",
"limits1": "Pesticidas detectados por encima",
"limits2": "de los límites legales en el agua potable",
"cocktail1": "Número de pesticidas detectados em",
"cocktail2": "na água potável",
"cocktail3": "(claro: nenhum, escuro: 27 agrotóxicos diferentes)",
"limits1": "Agrotóxicos detectados acima dos limites legais",
"limits2": "do limite legal na água potável",
"limits": {
"BELOW": "todos los pesticidas bajo los límites",
"NO_TEST": "sin datos",
"SUP_BR": "pesticida(s) encima del límite brasilero",
"SUP_EU": "pesticida(s) encima del límite europeo"
"BELOW": "todos os agrotóxicos abaixo dos limites",
"NO_TEST": "sem dados",
"SUP_BR": "pelo menos um acima do limite brasileiro",
"SUP_EU": "pelo menos um acima do limite europeu"
}
},
"tooltip": {
Expand Down

0 comments on commit e4154c8

Please sign in to comment.