@talend/react-components
Version:
Set of react components.
69 lines (67 loc) • 2.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getErrorMessage;
var _i18next = _interopRequireDefault(require("i18next"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/*
* Unexpected issues when importing t directly with named import
* https://github.com/i18next/i18next/issues/1287
* */
// eslint-disable-next-line import/no-named-as-default-member
function getErrorMessage(key) {
switch (key) {
case 'INVALID_HOUR_EMPTY':
return _i18next.default.t('INVALID_HOUR_EMPTY', {
defaultValue: 'Hour is required'
});
case 'INVALID_HOUR_NUMBER':
return _i18next.default.t('INVALID_HOUR_NUMBER', {
defaultValue: 'Hour must be between 00 and 23'
});
case 'INVALID_MINUTES_EMPTY':
return _i18next.default.t('INVALID_MINUTES_EMPTY', {
defaultValue: 'Minutes are required'
});
case 'INVALID_MINUTES_NUMBER':
return _i18next.default.t('INVALID_MINUTES_NUMBER', {
defaultValue: 'Minutes value must be between 00 and 59'
});
case 'INVALID_SECONDS_EMPTY':
return _i18next.default.t('INVALID_SECONDS_EMPTY', {
defaultValue: 'Seconds are required'
});
case 'INVALID_SECONDS_NUMBER':
return _i18next.default.t('INVALID_SECONDS_NUMBER', {
defaultValue: 'Seconds value must be between 00 and 59'
});
case 'INVALID_DATE_FORMAT':
return _i18next.default.t('INVALID_DATE_FORMAT', {
defaultValue: 'Date format is invalid'
});
case 'INVALID_MONTH_NUMBER':
return _i18next.default.t('INVALID_MONTH_NUMBER', {
defaultValue: 'Month must be between 01 and 12'
});
case 'INVALID_DAY_NUMBER':
return _i18next.default.t('INVALID_DAY_NUMBER', {
defaultValue: 'Day is invalid'
});
case 'INVALID_DAY_OF_MONTH':
return _i18next.default.t('INVALID_DAY_OF_MONTH', {
defaultValue: "Day value doesn't match an existing day in the month"
});
case 'TIME_FORMAT_INVALID':
return _i18next.default.t('TIME_FORMAT_INVALID', {
defaultValue: 'Time is invalid'
});
case 'DATETIME_INVALID_FORMAT':
return _i18next.default.t('DATETIME_INVALID_FORMAT', {
defaultValue: 'Datetime is invalid'
});
default:
return '';
}
}
//# sourceMappingURL=error-messages.js.map