Skip to content

Commit

Permalink
v0.4.11
Browse files Browse the repository at this point in the history
* [add] DataView i18n
  • Loading branch information
gavram authored Mar 18, 2020
1 parent b26d292 commit 406de01
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
9 changes: 8 additions & 1 deletion dist/components/DataView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;

require("../../i18n/i18n");

var _react = _interopRequireDefault(require("react"));

var _reactLoader = _interopRequireDefault(require("react-loader"));

var _datapackageViewsJs = require("@datopian/datapackage-views-js");

var _reactI18next = require("react-i18next");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = function _default(props) {
var _useTranslation = (0, _reactI18next.useTranslation)(),
t = _useTranslation.t;

var views = props.datapackage.views;

var showGuideText = function showGuideText(specType) {
return _react.default.createElement("div", {
className: "dx-guiding-text"
}, specType === 'simple' ? _react.default.createElement("p", null, "Select chart type, group column (ordinate x-axis) and series (abscissa y-axis) on the right hand side panel.") : '', specType === 'tabularmap' ? _react.default.createElement("p", null, "Select geo data column on the right hand side panel.") : '');
}, specType === 'simple' ? _react.default.createElement("p", null, t('Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.')) : '', specType === 'tabularmap' ? _react.default.createElement("p", null, t('Select geo data column on the right hand side panel.')) : '');
};

var checkIfGuideIsNeeded = function checkIfGuideIsNeeded(view) {
Expand Down
4 changes: 3 additions & 1 deletion dist/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"Table": "Table",
"Map": "Map",
"Chart": "Chart",
"Total rows": "Total rows"
"Total rows": "Total rows",
"Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.": "Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.",
"Select geo data column on the right hand side panel.": "Select geo data column on the right hand side panel."
}
4 changes: 3 additions & 1 deletion dist/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"Table": "Tableau",
"Map": "Carte",
"Chart": "Graphique",
"Total rows": "Entrées totales"
"Total rows": "Entrées totales",
"Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.": "Sélectionner le type de graphe, la colonne de groupement (axe horizontal) et la série (axe vertical) dans le panneau de droite",
"Select geo data column on the right hand side panel.": "Sélectionner la colonne de type géographique dans le panneau de droite"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@datopian/data-explorer",
"version": "0.4.10",
"version": "0.4.11",
"private": false,
"main": "/dist/AppWithProvider.js",
"module": "/dist/AppWithProvider.js",
Expand Down
8 changes: 6 additions & 2 deletions src/components/DataView/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import "../../i18n/i18n";
import React from 'react'
import Loader from 'react-loader'
import { DataView } from '@datopian/datapackage-views-js'
import { useTranslation } from "react-i18next";

export default props => {
const { t } = useTranslation();

const views = props.datapackage.views

const showGuideText = (specType) => {
return (
<div className="dx-guiding-text">
{specType === 'simple' ? <p>Select chart type, group column (ordinate x-axis) and series (abscissa y-axis) on the right hand side panel.</p> : '' }
{specType === 'tabularmap' ? <p>Select geo data column on the right hand side panel.</p> : '' }
{specType === 'simple' ? <p>{t('Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.')}</p> : '' }
{specType === 'tabularmap' ? <p>{t('Select geo data column on the right hand side panel.')}</p> : '' }
</div>
)
}
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"Table": "Table",
"Map": "Map",
"Chart": "Chart",
"Total rows": "Total rows"
"Total rows": "Total rows",
"Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.": "Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.",
"Select geo data column on the right hand side panel.": "Select geo data column on the right hand side panel."
}
4 changes: 3 additions & 1 deletion src/i18n/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"Table": "Tableau",
"Map": "Carte",
"Chart": "Graphique",
"Total rows": "Entrées totales"
"Total rows": "Entrées totales",
"Select chart type, group column (abscissa x-axis) and series (ordinate y-axis) on the right hand side panel.": "Sélectionner le type de graphe, la colonne de groupement (axe horizontal) et la série (axe vertical) dans le panneau de droite",
"Select geo data column on the right hand side panel.": "Sélectionner la colonne de type géographique dans le panneau de droite"
}

0 comments on commit 406de01

Please sign in to comment.