Add new eslint plugin to check for valid i18n keys
This commit is contained in:
parent
465b4cb0fb
commit
569b6e14a6
39 changed files with 447 additions and 78 deletions
|
@ -141,11 +141,10 @@ export function formatDate(
|
|||
|
||||
const m = moment(rawTimestamp);
|
||||
|
||||
const formatI18nKey =
|
||||
const rawFormatString =
|
||||
Math.abs(m.diff(Date.now())) < 6 * MONTH
|
||||
? 'TimelineDateHeader--date-in-last-6-months'
|
||||
: 'TimelineDateHeader--date-older-than-6-months';
|
||||
const rawFormatString = i18n(formatI18nKey);
|
||||
? i18n('TimelineDateHeader--date-in-last-6-months')
|
||||
: i18n('TimelineDateHeader--date-older-than-6-months');
|
||||
const formatString = sanitizeFormatString(rawFormatString, 'LL');
|
||||
|
||||
return m.format(formatString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue