-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[i18n] Fix broken i18n messages (#185011)
- Loading branch information
Showing
30 changed files
with
142 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/plugins/data/common/search/aggs/buckets/lib/time_buckets/i18n_messages.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const dayLabel = (amount: number) => | ||
i18n.translate('data.search.timeBuckets.dayLabel', { | ||
defaultMessage: '{amount, plural, one {a day} other {# days}}', | ||
values: { amount }, | ||
}); | ||
|
||
export const hourLabel = (amount: number) => | ||
i18n.translate('data.search.timeBuckets.hourLabel', { | ||
defaultMessage: '{amount, plural, one {an hour} other {# hours}}', | ||
values: { amount }, | ||
}); | ||
|
||
export const yearLabel = () => | ||
i18n.translate('data.search.timeBuckets.yearLabel', { | ||
defaultMessage: 'a year', | ||
}); | ||
|
||
export const minuteLabel = (amount: number) => | ||
i18n.translate('data.search.timeBuckets.minuteLabel', { | ||
defaultMessage: '{amount, plural, one {a minute} other {# minutes}}', | ||
values: { amount }, | ||
}); | ||
|
||
export const secondLabel = (amount: number) => | ||
i18n.translate('data.search.timeBuckets.secondLabel', { | ||
defaultMessage: '{amount, plural, one {a second} other {# seconds}}', | ||
values: { amount }, | ||
}); | ||
|
||
export const millisecondLabel = (amount: number) => | ||
i18n.translate('data.search.timeBuckets.millisecondLabel', { | ||
defaultMessage: '{amount, plural, one {a millisecond} other {# milliseconds}}', | ||
values: { amount }, | ||
}); | ||
|
||
export const infinityLabel = () => | ||
i18n.translate('data.search.timeBuckets.infinityLabel', { | ||
defaultMessage: 'More than a year', | ||
}); | ||
|
||
export const monthLabel = () => | ||
i18n.translate('data.search.timeBuckets.monthLabel', { | ||
defaultMessage: 'a month', | ||
}); |
Oops, something went wrong.