Internationalization: Translate TimeRangeList component (#58131)

This commit is contained in:
Laura Fernández
2022-11-04 12:21:46 +01:00
committed by GitHub
parent 9c1c10ab9a
commit b7efd46e2d
7 changed files with 16 additions and 3 deletions
@@ -4,6 +4,7 @@ import React, { ReactNode } from 'react';
import { TimeOption } from '@grafana/data';
import { stylesFactory } from '../../../themes';
import { t } from '../../../utils/i18n';
import { TimePickerTitle } from './TimePickerTitle';
import { TimeRangeOption } from './TimeRangeOption';
@@ -65,14 +66,14 @@ const Options = ({ options, value, onChange, title }: Props) => {
return (
<>
<ul aria-roledescription="Time range selection">
<ul aria-roledescription={t('time-picker.time-range.aria-role', 'Time range selection')}>
{options.map((option, index) => (
<TimeRangeOption
key={keyForOption(option, index)}
value={option}
selected={isEqual(option, value)}
onSelect={onChange}
name={title ?? 'Time ranges'}
name={title ?? t('time-picker.time-range.default-title', 'Time ranges')}
/>
))}
</ul>