Internationalization: Translate TimePickerFooter component (#58390)

This commit is contained in:
Laura Fernández 2022-11-08 15:56:19 +01:00 committed by GitHub
parent 42b2e630b7
commit 3790e105e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import { selectors } from '@grafana/e2e-selectors';
import { Field, RadioButtonGroup, Select } from '../..';
import { stylesFactory, useTheme2 } from '../../../themes';
import { t, Trans } from '../../../utils/i18n';
import { Button } from '../../Button';
import { TimeZonePicker } from '../TimeZonePicker';
import { TimeZoneDescription } from '../TimeZonePicker/TimeZoneDescription';
@ -58,7 +59,10 @@ export const TimePickerFooter: FC<Props> = (props) => {
return (
<div>
<section aria-label="Time zone selection" className={style.container}>
<section
aria-label={t('time-picker.footer.time-zone-selection', 'Time zone selection')}
className={style.container}
>
<div className={style.timeZoneContainer}>
<div className={style.timeZone}>
<TimeZoneTitle title={info.name} />
@ -69,7 +73,7 @@ export const TimePickerFooter: FC<Props> = (props) => {
</div>
<div className={style.spacer} />
<Button variant="secondary" onClick={onToggleChangeTimeSettings} size="sm">
Change time settings
<Trans i18nKey="time-picker.footer.change-settings-button">Change time settings</Trans>
</Button>
</section>
{isEditing ? (
@ -78,8 +82,8 @@ export const TimePickerFooter: FC<Props> = (props) => {
<RadioButtonGroup
value={editMode}
options={[
{ label: 'Time zone', value: 'tz' },
{ label: 'Fiscal year', value: 'fy' },
{ label: t('time-picker.footer.time-zone-option', 'Time zone'), value: 'tz' },
{ label: t('time-picker.footer.fiscal-year-option', 'Fiscal year'), value: 'fy' },
]}
onChange={setEditMode}
></RadioButtonGroup>
@ -106,7 +110,10 @@ export const TimePickerFooter: FC<Props> = (props) => {
aria-label={selectors.components.TimeZonePicker.containerV2}
className={cx(style.timeZoneContainer, style.timeSettingContainer)}
>
<Field className={style.fiscalYearField} label={'Fiscal year start month'}>
<Field
className={style.fiscalYearField}
label={t('time-picker.footer.fiscal-year-start', 'Fiscal year start month')}
>
<Select
value={fiscalYearStartMonth}
menuShouldPortal={false}

View File

@ -417,6 +417,13 @@
"cancel-button": "",
"select-time": ""
},
"footer": {
"change-settings-button": "",
"fiscal-year-option": "",
"fiscal-year-start": "",
"time-zone-option": "",
"time-zone-selection": ""
},
"range-content": {
"apply-button": "",
"default-error": "",

View File

@ -417,6 +417,13 @@
"cancel-button": "Cancel",
"select-time": "Select a time range"
},
"footer": {
"change-settings-button": "Change time settings",
"fiscal-year-option": "Fiscal year",
"fiscal-year-start": "Fiscal year start month",
"time-zone-option": "Time zone",
"time-zone-selection": "Time zone selection"
},
"range-content": {
"apply-button": "Apply time range",
"default-error": "Please enter a past date or \"now\"",

View File

@ -417,6 +417,13 @@
"cancel-button": "",
"select-time": ""
},
"footer": {
"change-settings-button": "",
"fiscal-year-option": "",
"fiscal-year-start": "",
"time-zone-option": "",
"time-zone-selection": ""
},
"range-content": {
"apply-button": "",
"default-error": "",

View File

@ -417,6 +417,13 @@
"cancel-button": "",
"select-time": ""
},
"footer": {
"change-settings-button": "",
"fiscal-year-option": "",
"fiscal-year-start": "",
"time-zone-option": "",
"time-zone-selection": ""
},
"range-content": {
"apply-button": "",
"default-error": "",

View File

@ -417,6 +417,13 @@
"cancel-button": "Cäʼnčęľ",
"select-time": "Ŝęľęčŧ ä ŧįmę řäʼnģę"
},
"footer": {
"change-settings-button": "Cĥäʼnģę ŧįmę şęŧŧįʼnģş",
"fiscal-year-option": "Fįşčäľ yęäř",
"fiscal-year-start": "Fįşčäľ yęäř şŧäřŧ mőʼnŧĥ",
"time-zone-option": "Ŧįmę žőʼnę",
"time-zone-selection": "Ŧįmę žőʼnę şęľęčŧįőʼn"
},
"range-content": {
"apply-button": "Åppľy ŧįmę řäʼnģę",
"default-error": "Pľęäşę ęʼnŧęř ä päşŧ đäŧę őř \"ʼnőŵ\"",

View File

@ -417,6 +417,13 @@
"cancel-button": "",
"select-time": ""
},
"footer": {
"change-settings-button": "",
"fiscal-year-option": "",
"fiscal-year-start": "",
"time-zone-option": "",
"time-zone-selection": ""
},
"range-content": {
"apply-button": "",
"default-error": "",