chore: Added translate functions (#21816)

This commit is contained in:
Andrew
2022-10-19 04:54:16 +03:00
committed by GitHub
parent f38115489b
commit df7840c041
21 changed files with 95 additions and 90 deletions

View File

@@ -413,8 +413,8 @@ class AnnotationLayer extends React.PureComponent {
let description = '';
if (requiresQuery(sourceType)) {
if (sourceType === ANNOTATION_SOURCE_TYPES.NATIVE) {
label = 'Annotation layer';
description = 'Select the Annotation Layer you would like to use.';
label = t('Annotation layer');
description = t('Select the Annotation Layer you would like to use.');
} else {
label = t('Chart');
description = t(
@@ -426,10 +426,10 @@ class AnnotationLayer extends React.PureComponent {
);
}
} else if (annotationType === ANNOTATION_TYPES.FORMULA) {
label = 'Formula';
description = `Expects a formula with depending time parameter 'x'
label = t('Formula');
description = t(`Expects a formula with depending time parameter 'x'
in milliseconds since epoch. mathjs is used to evaluate the formulas.
Example: '2x+5'`;
Example: '2x+5'`);
}
if (requiresQuery(sourceType)) {
return (
@@ -464,7 +464,7 @@ class AnnotationLayer extends React.PureComponent {
onChange={this.handleValue}
validationErrors={
!this.isValidFormulaAnnotation(value, annotationType)
? ['Bad formula.']
? [t('Bad formula.')]
: []
}
/>
@@ -656,10 +656,10 @@ class AnnotationLayer extends React.PureComponent {
label={t('Style')}
// see '../../../visualizations/nvd3_vis.css'
options={[
{ value: 'solid', label: 'Solid' },
{ value: 'dashed', label: 'Dashed' },
{ value: 'longDashed', label: 'Long dashed' },
{ value: 'dotted', label: 'Dotted' },
{ value: 'solid', label: t('Solid') },
{ value: 'dashed', label: t('Dashed') },
{ value: 'longDashed', label: t('Long dashed') },
{ value: 'dotted', label: t('Dotted') },
]}
value={style}
clearable={false}
@@ -671,7 +671,7 @@ class AnnotationLayer extends React.PureComponent {
label={t('Opacity')}
// see '../../../visualizations/nvd3_vis.css'
options={[
{ value: '', label: 'Solid' },
{ value: '', label: t('Solid') },
{ value: 'opacityLow', label: '0.2' },
{ value: 'opacityMedium', label: '0.5' },
{ value: 'opacityHigh', label: '0.8' },
@@ -693,7 +693,7 @@ class AnnotationLayer extends React.PureComponent {
buttonSize="xsmall"
onClick={() => this.setState({ color: AUTOMATIC_COLOR })}
>
Automatic Color
{t('Automatic Color')}
</Button>
</div>
</div>