mirror of
https://github.com/apache/superset.git
synced 2026-04-26 19:44:58 +00:00
chore: Localization of superset pt. 2 (#22772)
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { extent as d3Extent, range as d3Range } from 'd3-array';
|
||||
import { select as d3Select } from 'd3-selection';
|
||||
import { getSequentialSchemeRegistry } from '@superset-ui/core';
|
||||
import { getSequentialSchemeRegistry, t } from '@superset-ui/core';
|
||||
import CalHeatMap from './vendor/cal-heatmap';
|
||||
|
||||
const propTypes = {
|
||||
@@ -85,10 +85,12 @@ function Calendar(element, props) {
|
||||
|
||||
const metricsData = data.data;
|
||||
|
||||
const METRIC_TEXT = t('Metric');
|
||||
|
||||
Object.keys(metricsData).forEach(metric => {
|
||||
const calContainer = div.append('div');
|
||||
if (showMetricName) {
|
||||
calContainer.text(`Metric: ${verboseMap[metric] || metric}`);
|
||||
calContainer.text(`${METRIC_TEXT}: ${verboseMap[metric] || metric}`);
|
||||
}
|
||||
const timestamps = metricsData[metric];
|
||||
const extents = d3Extent(Object.keys(timestamps), key => timestamps[key]);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import d3tip from 'd3-tip';
|
||||
import { getContrastingColor } from '@superset-ui/core';
|
||||
import { getContrastingColor, t } from '@superset-ui/core';
|
||||
|
||||
var d3 = typeof require === 'function' ? require('d3') : window.d3;
|
||||
|
||||
@@ -256,9 +256,9 @@ var CalHeatMap = function () {
|
||||
|
||||
// Formatting of the title displayed when hovering a legend cell
|
||||
legendTitleFormat: {
|
||||
lower: 'less than {min} {name}',
|
||||
inner: 'between {down} and {up} {name}',
|
||||
upper: 'more than {max} {name}',
|
||||
lower: t('less than {min} {name}'),
|
||||
inner: t('between {down} and {up} {name}'),
|
||||
upper: t('more than {max} {name}'),
|
||||
},
|
||||
|
||||
// Animation duration, in ms
|
||||
|
||||
Reference in New Issue
Block a user