feat: add new lang string for minutes

This commit is contained in:
Barış Soner Uşaklı
2023-10-31 11:32:43 -04:00
parent 4c4f3ac983
commit d8d26c9f57
2 changed files with 6 additions and 1 deletions

View File

@@ -104,6 +104,7 @@
"category-not-selected": "Category not selected.",
"too-many-posts": "You can only post once every %1 second(s) - please wait before posting again",
"too-many-posts-newbie": "As a new user, you can only post once every %1 second(s) until you have earned %2 reputation - please wait before posting again",
"too-many-posts-newbie-minutes": "As a new user, you can only post once every %1 minute(s) until you have earned %2 reputation - please wait before posting again",
"already-posting": "You are already posting",
"tag-too-short": "Please enter a longer tag. Tags should contain at least %1 character(s)",
"tag-too-long": "Please enter a shorter tag. Tags can't be longer than %1 character(s)",

View File

@@ -58,7 +58,11 @@ module.exports = function (User) {
meta.config.newbiePostDelayThreshold > userData.reputation &&
now - lasttime < meta.config.newbiePostDelay * 1000
) {
throw new Error(`[[error:too-many-posts-newbie, ${meta.config.newbiePostDelay}, ${meta.config.newbiePostDelayThreshold}]]`);
if (meta.config.newbiewPostDelay % 60 === 0) {
throw new Error(`[[error:too-many-posts-newbie-minutes, ${Math.floor(meta.config.newbiePostDelay / 60)}, ${meta.config.newbiePostDelayThreshold}]]`);
} else {
throw new Error(`[[error:too-many-posts-newbie, ${meta.config.newbiePostDelay}, ${meta.config.newbiePostDelayThreshold}]]`);
}
} else if (now - lasttime < meta.config.postDelay * 1000) {
throw new Error(`[[error:too-many-posts, ${meta.config.postDelay}]]`);
}