Revert changing .js.erb file [SCI-8810] (#5741)

This commit is contained in:
Soufiane 2023-07-10 09:43:00 +02:00 committed by GitHub
parent b44678d09a
commit eb4d0f2065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,13 +39,13 @@ function textValidator(ev, textInput, textLimitMin, textLimitMax, clearErr, tiny
if (textLimitMin === 1) {
errMsg = I18n.t("general.text.not_blank");
} else {
errMsg = I18n.t("general.text.length_too_short", min_length: textLimitMin);
errMsg = I18n.t("general.text.length_too_short", { min_length: textLimitMin });
}
} else if (nameTooLong) {
if(tinyMCEInput){
errMsg = I18n.t("general.text.length_too_long_general");
} else {
errMsg = I18n.t("general.text.length_too_long", max_length: textLimitMax);
errMsg = I18n.t("general.text.length_too_long", { max_length: textLimitMax });
}
}
@ -143,7 +143,7 @@ function filesSizeValidator(ev, fileInputs, fileTypeEnum) {
if (file.size > fileTypeEnum) {
switch (fileTypeEnum) {
case FileTypeEnum.FILE:
return I18n.t('general.file.size_exceeded', file_size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB).strToErrorFormat();
return I18n.t('general.file.size_exceeded', { file_size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB }).strToErrorFormat();
case FileTypeEnum.AVATAR:
return "<%= I18n.t 'general.file.size_exceeded', file_size: Constants::AVATAR_MAX_SIZE_MB %>".strToErrorFormat();
}
@ -164,7 +164,7 @@ function filesSizeValidator(ev, fileInputs, fileTypeEnum) {
if (size > fileTypeEnum) {
switch (fileTypeEnum) {
case FileTypeEnum.FILE:
return I18n.t('general.file.total_size', size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB).strToErrorFormat();
return I18n.t('general.file.total_size', { size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB }).strToErrorFormat();
case FileTypeEnum.AVATAR:
return "<%= I18n.t('users.registrations.edit.avatar_total_size', size: Constants::AVATAR_MAX_SIZE_MB) %>".strToErrorFormat();
}