Skip to content

Commit

Permalink
Update translations 020223 (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolidori committed Feb 3, 2023
1 parent 8c5381c commit 38f989d
Show file tree
Hide file tree
Showing 15 changed files with 360 additions and 137 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

116 changes: 88 additions & 28 deletions ckanext/querytool/fanstatic/javascript/modules/viz-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,66 @@ ckan.module('querytool-viz-preview', function() {
data.push(trace);
}
}

// Workaround for translations
var lang = document.documentElement.getAttribute('lang');

var i18n = {
'en': {
'Solid': 'Solid',
'Dotted': 'Dotted',
'Dashed': 'Dashed',
'Dash Dot': 'Dash Dot',
'Regular': 'Regular',
'Slim': 'Slim',
'Wide': 'Wide'
},
'fr': {
'Solid': 'Solide',
'Dotted': 'Pointé',
'Dashed': 'Trait',
'Dash Dot': 'Trait et point',
'Regular': 'Réguliere',
'Slim': 'Mince',
'Wide': 'Large'
},
'es': {
'Solid': 'Sólido',
'Dotted': 'Punteado',
'Dashed': 'Rayado',
'Dash Dot': 'Rayado punto',
'Regular': 'Regular',
'Slim': 'Delgado',
'Wide': 'Ancho'
},
'km': {
'Solid': 'រឹង',
'Dotted': 'ចំនុចោះ',
'Dashed': 'ដាច់ៗ',
'Dash Dot': 'ដាច់ៗ ចំនុច',
'Regular': 'ទៀង​ទា​ត',
'Slim': 'ស្ដើង',
'Wide': 'ធំទូលាយ'
},
'pt_BR': {
'Solid': 'Sólida',
'Dotted': 'Pontilhada',
'Dashed': 'Hífen',
'Dash Dot': 'Linha e ponto',
'Regular': 'Regular',
'Slim': 'Fina',
'Wide': 'Larga'
},
'zh_CN': {
'Solid': '坚硬的',
'Dotted': '点缀',
'Dashed': '虚线',
'Dash Dot': '破折号',
'Regular': '常规的',
'Slim': '苗条的',
'Wide': '宽的'
}
};

/**** Line TYpes [dotted,solid] *****/
var item_exists = this.el.closest(".chart_field").attr("id");
Expand Down Expand Up @@ -1418,27 +1478,27 @@ ckan.module('querytool-viz-preview', function() {
'" >';

if (html_line_type == "solid") {
html += '<option value="solid" selected>Solid</option>';
html += '<option value="solid" selected>' + i18n[lang]['Solid'] + '</option>';
} else {
html += '<option value="solid">Solid</option>';
html += '<option value="solid">' + i18n[lang]['Solid'] + '</option>';
}

if (html_line_type == "dash") {
html += '<option value="dash" selected>Dashed</option>';
html += '<option value="dash" selected>' + i18n[lang]['Dashed'] + '</option>';
} else {
html += '<option value="dash">Dashed</option>';
html += '<option value="dash">' + i18n[lang]['Dashed'] + '</option>';
}

if (html_line_type == "dashdot") {
html += '<option value="dashdot" selected>Dash Dot</option>';
html += '<option value="dashdot" selected>' + i18n[lang]['Dash Dot'] + '</option>';
} else {
html += '<option value="dashdot">Dash Dot</option>';
html += '<option value="dashdot">' + i18n[lang]['Dash Dot'] + '</option>';
}

if (html_line_type == "dot") {
html += '<option value="dot" selected>Dotted</option>';
html += '<option value="dot" selected>' + i18n[lang]['Dotted'] + '</option>';
} else {
html += '<option value="dot">Dotted</option>';
html += '<option value="dot">' + i18n[lang]['Dotted'] + '</option>';
}

html += "</select>";
Expand All @@ -1456,24 +1516,24 @@ ckan.module('querytool-viz-preview', function() {
'" >';

if (html_line_width == "2") {
html += '<option value="2" selected>Slim</option>';
html += '<option value="2" selected>' + i18n[lang]['Slim'] + '</option>';
} else {
html += '<option value="2">Slim</option>';
html += '<option value="2">' + i18n[lang]['Slim'] + '</option>';
}

if (
html_line_width == "4" ||
!["2", "6"].includes(html_line_width)
) {
html += '<option value="4" selected>Regular</option>';
html += '<option value="4" selected>' + i18n[lang]['Regular'] + '</option>';
} else {
html += '<option value="4">Regular</option>';
html += '<option value="4">' + i18n[lang]['Regular'] + '</option>';
}

if (html_line_width == "6") {
html += '<option value="6" selected>Wide</option>';
html += '<option value="6" selected>' + i18n[lang]['Wide'] + '</option>';
} else {
html += '<option value="6">Wide</option>';
html += '<option value="6">' + i18n[lang]['Wide'] + '</option>';
}

html += "</select>";
Expand Down Expand Up @@ -1509,27 +1569,27 @@ ckan.module('querytool-viz-preview', function() {
'" >';

if (html_line_type == "solid") {
html += '<option value="solid" selected>Solid</option>';
html += '<option value="solid" selected>' + i18n[lang]['Solid'] + '</option>';
} else {
html += '<option value="solid">Solid</option>';
html += '<option value="solid">' + i18n[lang]['Solid'] + '</option>';
}

if (html_line_type == "dash") {
html += '<option value="dash" selected>Dashed</option>';
html += '<option value="dash" selected>' + i18n[lang]['Dashed'] + '</option>';
} else {
html += '<option value="dash">Dashed</option>';
html += '<option value="dash">' + i18n[lang]['Dashed'] + '</option>';
}

if (html_line_type == "dashdot") {
html += '<option value="dashdot" selected>Dash Dot</option>';
html += '<option value="dashdot" selected>' + i18n[lang]['Dash Dot'] + '</option>';
} else {
html += '<option value="dashdot">Dash Dot</option>';
html += '<option value="dashdot">' + i18n[lang]['Dash Dot'] + '</option>';
}

if (html_line_type == "dot") {
html += '<option value="dot" selected>Dotted</option>';
html += '<option value="dot" selected>' + i18n[lang]['Dotted'] + '</option>';
} else {
html += '<option value="dot">Dotted</option>';
html += '<option value="dot">' + i18n[lang]['Dotted'] + '</option>';
}

html += "</select>";
Expand All @@ -1547,24 +1607,24 @@ ckan.module('querytool-viz-preview', function() {
'" >';

if (html_line_width == "2") {
html += '<option value="2" selected>Slim</option>';
html += '<option value="2" selected>' + i18n[lang]['Slim'] + '</option>';
} else {
html += '<option value="2">Slim</option>';
html += '<option value="2">' + i18n[lang]['Slim'] + '</option>';
}

if (
html_line_width == "4" ||
!["2", "6"].includes(html_line_width)
) {
html += '<option value="4" selected>Regular</option>';
html += '<option value="4" selected>' + i18n[lang]['Regular'] + '</option>';
} else {
html += '<option value="4">Regular</option>';
html += '<option value="4">' + i18n[lang]['Regular'] + '</option>';
}

if (html_line_width == "6") {
html += '<option value="6" selected>Wide</option>';
html += '<option value="6" selected>' + i18n[lang]['Wide'] + '</option>';
} else {
html += '<option value="6">Wide</option>';
html += '<option value="6">' + i18n[lang]['Wide'] + '</option>';
}

html += "</select>";
Expand Down
27 changes: 23 additions & 4 deletions ckanext/querytool/i18n/ckanext-querytool.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1844,10 +1844,6 @@ msgstr ""
msgid "Organization"
msgstr ""

#: ckanext/querytool/templates/querytool/admin/snippets/edit_data_form.html:112
msgid "Download Options"
msgstr ""

#: ckanext/querytool/templates/querytool/admin/snippets/edit_data_form.html:115
msgid "Enabled"
msgstr ""
Expand Down Expand Up @@ -2032,3 +2028,26 @@ msgstr ""
msgid "Go"
msgstr ""

# Manually added translations
msgid "Search reports"
msgstr ""

# Manually added translations
msgid "Search datasets"
msgstr ""

# Manually added translations
msgid "Starting color"
msgstr ""

# Manually added translations
msgid "Ending color"
msgstr ""

# Manually added translations
msgid "Report Icon URL"
msgstr ""

# Manually added translations
msgid "Download Options"
msgstr ""
26 changes: 25 additions & 1 deletion ckanext/querytool/i18n/en/LC_MESSAGES/ckanext-querytool.po
Original file line number Diff line number Diff line change
Expand Up @@ -1677,4 +1677,28 @@ msgstr "Custom"
#: ckanext/querytool/templates/ajax_snippets/chart_item.html:1093
#: ckanext/querytool/templates/ajax_snippets/chart_item.html:1102
msgid "Default"
msgstr "Default"
msgstr "Default"

# Manually added translations
msgid "Search reports"
msgstr "Search reports"

# Manually added translations
msgid "Search datasets"
msgstr "Search datasets"

# Manually added translations
msgid "Starting color"
msgstr "Starting color"

# Manually added translations
msgid "Ending color"
msgstr "Ending color"

# Manually added translations
msgid "Download Options"
msgstr "Download Options"

# Manually added translations
msgid "Report Icon URL"
msgstr "Report Icon URL"
24 changes: 24 additions & 0 deletions ckanext/querytool/i18n/es/LC_MESSAGES/ckanext-querytool.po
Original file line number Diff line number Diff line change
Expand Up @@ -1619,3 +1619,27 @@ msgstr "Disfraz"
#: ckanext/querytool/templates/ajax_snippets/chart_item.html:1102
msgid "Default"
msgstr "Defecto"

# Manually added translations
msgid "Search reports"
msgstr "Buscar informes"

# Manually added translations
msgid "Search datasets"
msgstr "Buscar conjuntos de datos"

# Manually added translations
msgid "Starting color"
msgstr "Color inicial"

# Manually added translations
msgid "Ending color"
msgstr "Color final"

# Manually added translations
msgid "Download Options"
msgstr "Opciones de descarga"

# Manually added translations
msgid "Report Icon URL"
msgstr "URL del icono de informe"
24 changes: 24 additions & 0 deletions ckanext/querytool/i18n/fr/LC_MESSAGES/ckanext-querytool.po
Original file line number Diff line number Diff line change
Expand Up @@ -1664,3 +1664,27 @@ msgstr "Personnalisé"
#: ckanext/querytool/templates/ajax_snippets/chart_item.html:1102
msgid "Default"
msgstr "Défaut"

# Manually added translations
msgid "Search reports"
msgstr "Rechercher des rapports"

# Manually added translations
msgid "Search datasets"
msgstr "Rechercher des ensembles de données"

# Manually added translations
msgid "Starting color"
msgstr "Couleur initiale"

# Manually added translations
msgid "Ending color"
msgstr "Couleur finale"

# Manually added translations
msgid "Download Options"
msgstr "Options de téléchargement"

# Manually added translations
msgid "Report Icon URL"
msgstr "URL de l'icône de rapport"
Loading

0 comments on commit 38f989d

Please sign in to comment.