mirror of https://github.com/grafana/grafana
Internationalisation: More markup following manual review (#108232)
* mark up NestedFolderPiker root item * mark up fieldsbyframerefid * mark up time picker options * mark up field typespull/108296/head
parent
5cf48294f7
commit
43280a6dab
@ -1,57 +1,134 @@ |
||||
import { TimeOption } from '@grafana/data'; |
||||
import { t } from '@grafana/i18n'; |
||||
|
||||
import { ComboboxOption } from '../Combobox/types'; |
||||
|
||||
export const quickOptions: TimeOption[] = [ |
||||
{ from: 'now-5m', to: 'now', display: 'Last 5 minutes' }, |
||||
{ from: 'now-15m', to: 'now', display: 'Last 15 minutes' }, |
||||
{ from: 'now-30m', to: 'now', display: 'Last 30 minutes' }, |
||||
{ from: 'now-1h', to: 'now', display: 'Last 1 hour' }, |
||||
{ from: 'now-3h', to: 'now', display: 'Last 3 hours' }, |
||||
{ from: 'now-6h', to: 'now', display: 'Last 6 hours' }, |
||||
{ from: 'now-12h', to: 'now', display: 'Last 12 hours' }, |
||||
{ from: 'now-24h', to: 'now', display: 'Last 24 hours' }, |
||||
{ from: 'now-2d', to: 'now', display: 'Last 2 days' }, |
||||
{ from: 'now-7d', to: 'now', display: 'Last 7 days' }, |
||||
{ from: 'now-30d', to: 'now', display: 'Last 30 days' }, |
||||
{ from: 'now-90d', to: 'now', display: 'Last 90 days' }, |
||||
{ from: 'now-6M', to: 'now', display: 'Last 6 months' }, |
||||
{ from: 'now-1y', to: 'now', display: 'Last 1 year' }, |
||||
{ from: 'now-2y', to: 'now', display: 'Last 2 years' }, |
||||
{ from: 'now-5y', to: 'now', display: 'Last 5 years' }, |
||||
{ from: 'now-1d/d', to: 'now-1d/d', display: 'Yesterday' }, |
||||
{ from: 'now-2d/d', to: 'now-2d/d', display: 'Day before yesterday' }, |
||||
{ from: 'now-7d/d', to: 'now-7d/d', display: 'This day last week' }, |
||||
{ from: 'now-1w/w', to: 'now-1w/w', display: 'Previous week' }, |
||||
{ from: 'now-1M/M', to: 'now-1M/M', display: 'Previous month' }, |
||||
{ from: 'now-1Q/fQ', to: 'now-1Q/fQ', display: 'Previous fiscal quarter' }, |
||||
{ from: 'now-1y/y', to: 'now-1y/y', display: 'Previous year' }, |
||||
{ from: 'now-1y/fy', to: 'now-1y/fy', display: 'Previous fiscal year' }, |
||||
{ from: 'now/d', to: 'now/d', display: 'Today' }, |
||||
{ from: 'now/d', to: 'now', display: 'Today so far' }, |
||||
{ from: 'now/w', to: 'now/w', display: 'This week' }, |
||||
{ from: 'now/w', to: 'now', display: 'This week so far' }, |
||||
{ from: 'now/M', to: 'now/M', display: 'This month' }, |
||||
{ from: 'now/M', to: 'now', display: 'This month so far' }, |
||||
{ from: 'now/y', to: 'now/y', display: 'This year' }, |
||||
{ from: 'now/y', to: 'now', display: 'This year so far' }, |
||||
{ from: 'now/fQ', to: 'now', display: 'This fiscal quarter so far' }, |
||||
{ from: 'now/fQ', to: 'now/fQ', display: 'This fiscal quarter' }, |
||||
{ from: 'now/fy', to: 'now', display: 'This fiscal year so far' }, |
||||
{ from: 'now/fy', to: 'now/fy', display: 'This fiscal year' }, |
||||
export const getQuickOptions: () => TimeOption[] = () => [ |
||||
{ from: 'now-5m', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-5-mins', 'Last 5 minutes') }, |
||||
{ |
||||
from: 'now-15m', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.last-15-mins', 'Last 15 minutes'), |
||||
}, |
||||
{ |
||||
from: 'now-30m', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.last-30-mins', 'Last 30 minutes'), |
||||
}, |
||||
{ from: 'now-1h', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-1-hour', 'Last 1 hour') }, |
||||
{ from: 'now-3h', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-3-hours', 'Last 3 hours') }, |
||||
{ from: 'now-6h', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-6-hours', 'Last 6 hours') }, |
||||
{ |
||||
from: 'now-12h', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.last-12-hours', 'Last 12 hours'), |
||||
}, |
||||
{ |
||||
from: 'now-24h', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.last-24-hours', 'Last 24 hours'), |
||||
}, |
||||
{ from: 'now-2d', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-2-days', 'Last 2 days') }, |
||||
{ from: 'now-7d', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-7-days', 'Last 7 days') }, |
||||
{ from: 'now-30d', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-30-days', 'Last 30 days') }, |
||||
{ from: 'now-90d', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-90-days', 'Last 90 days') }, |
||||
{ |
||||
from: 'now-6M', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.last-6-months', 'Last 6 months'), |
||||
}, |
||||
{ from: 'now-1y', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-1-year', 'Last 1 year') }, |
||||
{ from: 'now-2y', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-2-years', 'Last 2 years') }, |
||||
{ from: 'now-5y', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.last-5-years', 'Last 5 years') }, |
||||
{ from: 'now-1d/d', to: 'now-1d/d', display: t('grafana-ui.date-time-pickers.quick-options.yesterday', 'Yesterday') }, |
||||
{ |
||||
from: 'now-2d/d', |
||||
to: 'now-2d/d', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.day-before-yesterday', 'Day before yesterday'), |
||||
}, |
||||
{ |
||||
from: 'now-7d/d', |
||||
to: 'now-7d/d', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-day-last-week', 'This day last week'), |
||||
}, |
||||
{ |
||||
from: 'now-1w/w', |
||||
to: 'now-1w/w', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.previous-week', 'Previous week'), |
||||
}, |
||||
{ |
||||
from: 'now-1M/M', |
||||
to: 'now-1M/M', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.previous-month', 'Previous month'), |
||||
}, |
||||
{ |
||||
from: 'now-1Q/fQ', |
||||
to: 'now-1Q/fQ', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.previous-fiscal-quarter', 'Previous fiscal quarter'), |
||||
}, |
||||
{ |
||||
from: 'now-1y/y', |
||||
to: 'now-1y/y', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.previous-year', 'Previous year'), |
||||
}, |
||||
{ |
||||
from: 'now-1y/fy', |
||||
to: 'now-1y/fy', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.previous-fiscal-year', 'Previous fiscal year'), |
||||
}, |
||||
{ from: 'now/d', to: 'now/d', display: t('grafana-ui.date-time-pickers.quick-options.today', 'Today') }, |
||||
{ from: 'now/d', to: 'now', display: t('grafana-ui.date-time-pickers.quick-options.today-so-far', 'Today so far') }, |
||||
{ from: 'now/w', to: 'now/w', display: t('grafana-ui.date-time-pickers.quick-options.this-week', 'This week') }, |
||||
{ |
||||
from: 'now/w', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-week-so-far', 'This week so far'), |
||||
}, |
||||
{ from: 'now/M', to: 'now/M', display: t('grafana-ui.date-time-pickers.quick-options.this-month', 'This month') }, |
||||
{ |
||||
from: 'now/M', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-month-so-far', 'This month so far'), |
||||
}, |
||||
{ from: 'now/y', to: 'now/y', display: t('grafana-ui.date-time-pickers.quick-options.this-year', 'This year') }, |
||||
{ |
||||
from: 'now/y', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-year-so-far', 'This year so far'), |
||||
}, |
||||
{ |
||||
from: 'now/fQ', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-fiscal-quarter-so-far', 'This fiscal quarter so far'), |
||||
}, |
||||
{ |
||||
from: 'now/fQ', |
||||
to: 'now/fQ', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-fiscal-quarter', 'This fiscal quarter'), |
||||
}, |
||||
{ |
||||
from: 'now/fy', |
||||
to: 'now', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-fiscal-year-so-far', 'This fiscal year so far'), |
||||
}, |
||||
{ |
||||
from: 'now/fy', |
||||
to: 'now/fy', |
||||
display: t('grafana-ui.date-time-pickers.quick-options.this-fiscal-year', 'This fiscal year'), |
||||
}, |
||||
]; |
||||
|
||||
export const monthOptions: Array<ComboboxOption<number>> = [ |
||||
{ label: 'January', value: 0 }, |
||||
{ label: 'February', value: 1 }, |
||||
{ label: 'March', value: 2 }, |
||||
{ label: 'April', value: 3 }, |
||||
{ label: 'May', value: 4 }, |
||||
{ label: 'June', value: 5 }, |
||||
{ label: 'July', value: 6 }, |
||||
{ label: 'August', value: 7 }, |
||||
{ label: 'September', value: 8 }, |
||||
{ label: 'October', value: 9 }, |
||||
{ label: 'November', value: 10 }, |
||||
{ label: 'December', value: 11 }, |
||||
export const getMonthOptions: () => Array<ComboboxOption<number>> = () => [ |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-january', 'January'), value: 0 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-february', 'February'), value: 1 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-march', 'March'), value: 2 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-april', 'April'), value: 3 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-may', 'May'), value: 4 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-june', 'June'), value: 5 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-july', 'July'), value: 6 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-august', 'August'), value: 7 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-september', 'September'), value: 8 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-october', 'October'), value: 9 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-november', 'November'), value: 10 }, |
||||
{ label: t('grafana-ui.date-time-pickers.month-options.label-december', 'December'), value: 11 }, |
||||
]; |
||||
|
@ -1,9 +1,11 @@ |
||||
export const ROOT_FOLDER_ITEM = { |
||||
import { t } from '@grafana/i18n'; |
||||
|
||||
export const getRootFolderItem = () => ({ |
||||
isOpen: true, |
||||
level: 0, |
||||
item: { |
||||
kind: 'folder' as const, |
||||
title: 'Dashboards', |
||||
title: t('browse-dashboards.folder-picker.root-title', 'Dashboards'), |
||||
uid: '', |
||||
}, |
||||
}; |
||||
}); |
||||
|
Loading…
Reference in new issue