From b04eba2d914742cd97abec032e456ae4a748cd61 Mon Sep 17 00:00:00 2001 From: Artur Mullakhmetov Date: Wed, 4 Nov 2020 20:15:29 +0300 Subject: [PATCH 01/16] do not decrease comments count in case of repeated deletion --- backend/app/store/engine/bolt.go | 13 ++++++---- backend/app/store/engine/bolt_test.go | 36 ++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/backend/app/store/engine/bolt.go b/backend/app/store/engine/bolt.go index 0eb11f42..25725a0e 100644 --- a/backend/app/store/engine/bolt.go +++ b/backend/app/store/engine/bolt.go @@ -797,6 +797,14 @@ func (b *BoltDB) deleteComment(bdb *bolt.DB, locator store.Locator, commentID st if e = b.load(postBkt, commentID, &comment); e != nil { return errors.Wrapf(e, "can't load key %s from bucket %s", commentID, locator.URL) } + + if !comment.Deleted { + // decrement comments count for post url + if _, e = b.count(tx, comment.Locator.URL, -1); e != nil { + return errors.Wrapf(e, "failed to decrement count for %s", comment.Locator) + } + } + // set deleted status and clear fields comment.SetDeleted(mode) @@ -810,11 +818,6 @@ func (b *BoltDB) deleteComment(bdb *bolt.DB, locator store.Locator, commentID st return errors.Wrapf(e, "can't delete key %s from bucket %s", commentID, lastBucketName) } - // decrement comments count for post url - if _, e = b.count(tx, comment.Locator.URL, -1); e != nil { - return errors.Wrapf(e, "failed to decrement count for %s", comment.Locator) - } - return nil }) } diff --git a/backend/app/store/engine/bolt_test.go b/backend/app/store/engine/bolt_test.go index dd30303b..61461c7c 100644 --- a/backend/app/store/engine/bolt_test.go +++ b/backend/app/store/engine/bolt_test.go @@ -694,6 +694,10 @@ func TestBolt_DeleteComment(t *testing.T) { assert.True(t, res[0].Deleted, "marked deleted") assert.Equal(t, store.User{Name: "user name", ID: "user1", Picture: "", Admin: false, Blocked: false, IP: ""}, res[0].User) + // repeated deletion should not decrease comments count + err = b.Delete(delReq) + assert.NoError(t, err) + assert.Equal(t, "some text2", res[1].Text) assert.False(t, res[1].Deleted) @@ -807,10 +811,22 @@ func TestBoltAdmin_DeleteUserHard(t *testing.T) { b, teardown := prep(t) defer teardown() - err := b.Delete(DeleteRequest{Locator: store.Locator{SiteID: "radio-t"}, UserID: "user1", DeleteMode: store.HardDelete}) + comments, err := b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) + assert.NoError(t, err) + + // soft delete one comment + delReq := DeleteRequest{ + Locator: store.Locator{URL: "https://radio-t.com", SiteID: "radio-t"}, + CommentID: comments[0].ID, + DeleteMode: store.SoftDelete, + } + err = b.Delete(delReq) + assert.NoError(t, err) + + err = b.Delete(DeleteRequest{Locator: store.Locator{SiteID: "radio-t"}, UserID: "user1", DeleteMode: store.HardDelete}) require.NoError(t, err) - comments, err := b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) + comments, err = b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) assert.NoError(t, err) require.Equal(t, 2, len(comments), "2 comments with deleted info") assert.Equal(t, store.User{Name: "deleted", ID: "deleted", Picture: "", Admin: false, Blocked: false, IP: ""}, comments[0].User) @@ -836,10 +852,22 @@ func TestBoltAdmin_DeleteUserSoft(t *testing.T) { b, teardown := prep(t) defer teardown() - err := b.Delete(DeleteRequest{Locator: store.Locator{SiteID: "radio-t"}, UserID: "user1", DeleteMode: store.SoftDelete}) + comments, err := b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) + assert.NoError(t, err) + + // soft delete one comment + delReq := DeleteRequest{ + Locator: store.Locator{URL: "https://radio-t.com", SiteID: "radio-t"}, + CommentID: comments[0].ID, + DeleteMode: store.SoftDelete, + } + err = b.Delete(delReq) + assert.NoError(t, err) + + err = b.Delete(DeleteRequest{Locator: store.Locator{SiteID: "radio-t"}, UserID: "user1", DeleteMode: store.SoftDelete}) require.NoError(t, err) - comments, err := b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) + comments, err = b.Find(FindRequest{Locator: store.Locator{SiteID: "radio-t", URL: "https://radio-t.com"}, Sort: "time"}) assert.NoError(t, err) require.Equal(t, 2, len(comments), "2 comments with deleted info") assert.Equal(t, store.User{Name: "user name", ID: "user1", Picture: "", Admin: false, Blocked: false, IP: ""}, comments[0].User) From b88f99e09981188c3c02b789ea5c1f99243958ee Mon Sep 17 00:00:00 2001 From: Ivanezko Date: Wed, 4 Nov 2020 09:43:36 +0200 Subject: [PATCH 02/16] add ukranian locale --- frontend/app/locales/ua.json | 170 +++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 frontend/app/locales/ua.json diff --git a/frontend/app/locales/ua.json b/frontend/app/locales/ua.json new file mode 100644 index 00000000..4b7eee56 --- /dev/null +++ b/frontend/app/locales/ua.json @@ -0,0 +1,170 @@ +{ + "anonymousLoginForm.length-limit": "Довжина імені повинна бути більше 3 символів", + "anonymousLoginForm.log-in": "Увійти", + "anonymousLoginForm.symbol-limit": "Ім’я користувача повинно починатися з літери і містити тільки латинські букви,цифри,знаки підкреслення і прогалини", + "anonymousLoginForm.user-name": "Ім’я користувача", + "authPanel.anonymous-provider": "Анонімно", + "authPanel.disable-comments": "Увімкнути коментарі", + "authPanel.disabled-cookies": "Заборонені third-party cookies не дозволяють працювати коментарям", + "authPanel.enable-comments": "Включить комментарии", + "authPanel.enable-cookies": "Дозвольте Cookies", + "authPanel.hide-settings": "Заховати налаштування", + "authPanel.logged-as": "Ви увійшли як", + "authPanel.login": "Вхід:", + "authPanel.logout": "Вийти?", + "authPanel.new-page": "нова сторінка", + "authPanel.or-provider": "або", + "authPanel.other-provider": "Інший", + "authPanel.read-only": "Тільки для читання", + "authPanel.request-to-delete-data": "Запросити видалення моїх даних", + "authPanel.show-settings": "Показати налаштування", + "blockingDuration.day": "На день", + "blockingDuration.month": "На місяць", + "blockingDuration.permanently": "Назавжди", + "blockingDuration.week": "На неділю", + "comment.block": "Блокувати", + "comment.block-user": "Заблокувати користувача {userName} {duration}?", + "comment.blocked-user": "Заблокованний", + "comment.blocking-period": "Період блокування", + "comment.cancel": "Відмінити", + "comment.controversy": "Спірність: {value}", + "comment.copied": "Скопійовано!", + "comment.copy": "Скопіювати", + "comment.delete": "Видалити", + "comment.delete-message": "Видалити коментар?", + "comment.deleted-comment": "Коментар був видалений", + "comment.deleted-user": "Видален", + "comment.edit": "Редагувати", + "comment.expired-time": "Час редагування минув.", + "comment.go-to-parent": "До батьківського коментарю", + "comment.hide": "Заховати", + "comment.hide-user-comment": "Заховати коментар від користувача {userName}?", + "comment.pin": "Закріпити", + "comment.pin-comment": "Закріпити коментар?", + "comment.reply": "Відповісти", + "comment.time": "{day} в {time}", + "comment.toggle-verification": "Змінити статус справжності облікового запису", + "comment.unblock": "Розблокувати", + "comment.unblock-user": "Розблокувати користувача?", + "comment.unpin": "Відкріпити", + "comment.unpin-comment": "Відкріпити коментар?", + "comment.unverified-user": "Не перевірений на справжність обліковий запис", + "comment.unverify-user": " Прибрати статус справжності облікового запису для{userName}?", + "comment.verified-user": "Справжність облікового запису", + "comment.verify-user": "Підтвердити справжність облікового запису для{userName}?", + "comment.vote-error": "Помилка голосування: {voteErrorMessage}", + "commentForm.anonymous-uploading-disabled": "Завантаження зображень анонімними користувачами заборонена.Будь ласка увійдіть як не анонімний користувач.", + "commentForm.exceeded-size": "Розмір файла {fileName} повинен бути менший ніж {maxImageSize}", + "commentForm.input-placeholder": "Написати коментар", + "commentForm.new-comment": "Новий коментар", + "commentForm.notice-about-styling": "Підтримуеться Markdown форматування", + "commentForm.preview": "Предперегляд", + "commentForm.reply": "Відповісти", + "commentForm.save": "Зберегти", + "commentForm.send": "Відправити", + "commentForm.subscribe-by": "Підписатися", + "commentForm.subscribe-or": "або", + "commentForm.unauthorized-uploading-disabled": "Завантаження зображень недоступна для неавторизованих користувачів. Авторизуйтесь як не анонімний користувач для завантаження зображень.", + "commentForm.unexpected-error": "Щось пішло не так, спробуйте ще раз пізніше.", + "commentForm.upload-file-fail": "{fileName} неможливо завантажити через помилку: \"{errorMessage}\"", + "commentForm.uploading": "Завантаження...", + "commentForm.uploading-file": "Завантаження {fileName}...", + "commentSort.sort-by": "Сортувати по", + "commentsSort.best": "Кращі", + "commentsSort.least-controversial": "Найменш спірні", + "commentsSort.least-recently-updated": "Давно оновлені", + "commentsSort.most-controversial": "Найбільш спірні", + "commentsSort.newest": "Нові", + "commentsSort.oldest": "Старі", + "commentsSort.recently-updated": "Нещодавно оновлені", + "commentsSort.worst": "Гірші", + "emailLoginForm.back": "Назад", + "emailLoginForm.confirm": "Підтвердити", + "emailLoginForm.email-address": "Email адрес", + "emailLoginForm.empty-token": "Поле введення токена не повинно бути порожнім", + "emailLoginForm.expired-token": "Час дії токена минув", + "emailLoginForm.invalid-email": "Введений некоректний email адрес", + "emailLoginForm.loading": "Завантаження...", + "emailLoginForm.send-verification": "Відправити перевірку", + "emailLoginForm.token": "Токен", + "emailLoginForm.user-not-found": "Користувач не знайдений", + "errors.0": "Щось пішло не так,спробуйте ще раз пізніше.", + "errors.1": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", + "errors.10": "Час редагування коментаря минув.", + "errors.11": "На ваш коментар вже відповіли, редагування недоступне.", + "errors.12": "Не вдалося проголосувати. Спробуйте ще раз пізніше.", + "errors.13": "Ви не можете голосувати за свій коментар.", + "errors.14": "Ви вже голосували за цей коментар.", + "errors.15": "Занадто багато голосів за коментар .", + "errors.16": "Коментар досяг мінімальної оцінки.", + "errors.17": "Дія відклонена. Спробуйте ще раз пізніше.", + "errors.18": "Запрашиваемый файл не найден.", + "errors.2": "Не вдалося обробити відповідь від сервера.", + "errors.3": "Недостатньо прав на здійснення цієї дії.", + "errors.4": "Неправильно відформатований коментар.", + "errors.5": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", + "errors.6": "Сайт не знайдено. Перезавантажте сторінку і спробуйте ще раз.", + "errors.7": "Користувач був заблокований.", + "errors.8": "Користувач був заблокований.", + "errors.9": "Не вдалося зберегти зміни.Спробуйте ще раз пізніше.", + "errors.failed-fetch": "Немає відповіді с сервера.Перевірте ваше з’єднання з інтернетом або спробуйте пізніше.", + "errors.forbidden": "Заборонено.", + "errors.not-authorized": "Не авторизований.", + "errors.to-many-request": "Занадто багато запитів.", + "errors.unexpected-error": "Щось пішло не так.", + "root.pinned-comments": "Закріпленні коментарі", + "root.powered-by": "Powered by Remark42", + "root.show-more": "Показати ще", + "settings.block": "блокувати", + "settings.block-time": "до {day} в {time}", + "settings.block-user": "Заблокувати користувача {userName}?", + "settings.blocked-users-header": "Заблоковані користувачі:", + "settings.blocked-users-title": "Заблоковані користувачі", + "settings.hidden-user-header": "Приховані користувачі:", + "settings.hidden-users-title": "Приховані користувачі", + "settings.hide": "Приховати", + "settings.no-blocked-users": "Немає заблокованих користувачів.", + "settings.no-hidden-users": "Немає прихованих користувачів.", + "settings.permanently": "назавжди", + "settings.show": "Показати", + "settings.unblock": "розблокувати", + "settings.unblock-user": "Розблокувати користувача {userName}?", + "settings.unknown": "безіменний", + "subscribeByEmail.back": "Назад", + "subscribeByEmail.close": "Закрити", + "subscribeByEmail.email": "Email", + "subscribeByEmail.expired-token": "Час дії токена минув", + "subscribeByEmail.have-been-subscribed": "Ви були підписані на оновлення по email", + "subscribeByEmail.have-been-unsubscribed": "Ви були відписані від оновлень по email", + "subscribeByEmail.only-registered-users": "Доступно тільки для зареєстрованих користувачів", + "subscribeByEmail.submit": "Відправити", + "subscribeByEmail.subscribe": "Підписатися", + "subscribeByEmail.subscribe-by-email": "Підписатися по Email", + "subscribeByEmail.subscribe-to-replies": "Підписатися на відповіді", + "subscribeByEmail.subscribed": "Ви були підписані на оновлення по email", + "subscribeByEmail.token": "Токен", + "subscribeByEmail.unsubscribe": "Відмовитися від підписки", + "subscribeByRSS.button-title": "Підписатися по RSS", + "subscribeByRSS.replies": "Відповіді", + "subscribeByRSS.site": "Сайт", + "subscribeByRSS.thread": "Ветка", + "subscribeByRSS.title": "RSS", + "toolbar.attach-image": "Прикріпити зображення,перетягніть або вставте зображення з буфера обміну", + "toolbar.bold": "Жирний ", + "toolbar.code": "Код", + "toolbar.header": "Заголовок", + "toolbar.italic": "Курсив ", + "toolbar.link": "Посилання ", + "toolbar.ordered-list": "Упорядкованний список", + "toolbar.quote": "Цитата", + "toolbar.unordered-list": "Неупорядкованний список", + "user-info.last-comments": "Останні коментарі {userName}", + "user-info.unexpected-error": "Щось пішло не так", + "vote.anonymous": "Не можна голосувати анонімному користувачу", + "vote.deleted": "Не можна голосувати за видалений коментар", + "vote.guest": "Увійдіть в систему для голосування", + "vote.only-positive": "Дозволені тільки позитивні оцінки", + "vote.only-post-page": "Голосування можливо тільки для статей", + "vote.own-comment": "Ви не можете голосувати за свої коментарі", + "vote.readonly": "Не можна голосувати за коментарі, які в режимі тільки для читання" +} From f281faa0daa94c0964c23b6b715858247a1cec75 Mon Sep 17 00:00:00 2001 From: ivanezko Date: Wed, 4 Nov 2020 11:20:10 +0200 Subject: [PATCH 03/16] add ukranian locale --- frontend/app/utils/loadLocale.ts | 5 +++++ frontend/tasks/supportedLocales.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/app/utils/loadLocale.ts b/frontend/app/utils/loadLocale.ts index 347982ce..da84ffc2 100644 --- a/frontend/app/utils/loadLocale.ts +++ b/frontend/app/utils/loadLocale.ts @@ -38,6 +38,11 @@ export async function loadLocale(locale: string): Promise .then(res => res.default) .catch(() => enMessages); } + if (locale === 'ua') { + return import(/* webpackChunkName: "ua" */ '../locales/ua.json') + .then(res => res.default) + .catch(() => enMessages); + } return enMessages; } diff --git a/frontend/tasks/supportedLocales.json b/frontend/tasks/supportedLocales.json index 045829be..e62bef72 100644 --- a/frontend/tasks/supportedLocales.json +++ b/frontend/tasks/supportedLocales.json @@ -1 +1 @@ -["en", "ru", "de", "fi", "es", "zh", "tr", "bg"] +["en", "ru", "de", "fi", "es", "zh", "tr", "bg", "ua"] From 3396c56f2e91ba98dd102d6637b5da5dded4d8ef Mon Sep 17 00:00:00 2001 From: ivanezko Date: Wed, 4 Nov 2020 11:20:33 +0200 Subject: [PATCH 04/16] add ukranian locale --- frontend/app/locales/ua.json | 330 +++++++++++++++++------------------ 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/frontend/app/locales/ua.json b/frontend/app/locales/ua.json index 4b7eee56..040dec92 100644 --- a/frontend/app/locales/ua.json +++ b/frontend/app/locales/ua.json @@ -1,170 +1,170 @@ { - "anonymousLoginForm.length-limit": "Довжина імені повинна бути більше 3 символів", - "anonymousLoginForm.log-in": "Увійти", - "anonymousLoginForm.symbol-limit": "Ім’я користувача повинно починатися з літери і містити тільки латинські букви,цифри,знаки підкреслення і прогалини", - "anonymousLoginForm.user-name": "Ім’я користувача", - "authPanel.anonymous-provider": "Анонімно", - "authPanel.disable-comments": "Увімкнути коментарі", - "authPanel.disabled-cookies": "Заборонені third-party cookies не дозволяють працювати коментарям", - "authPanel.enable-comments": "Включить комментарии", - "authPanel.enable-cookies": "Дозвольте Cookies", - "authPanel.hide-settings": "Заховати налаштування", - "authPanel.logged-as": "Ви увійшли як", - "authPanel.login": "Вхід:", - "authPanel.logout": "Вийти?", - "authPanel.new-page": "нова сторінка", - "authPanel.or-provider": "або", - "authPanel.other-provider": "Інший", - "authPanel.read-only": "Тільки для читання", - "authPanel.request-to-delete-data": "Запросити видалення моїх даних", - "authPanel.show-settings": "Показати налаштування", - "blockingDuration.day": "На день", - "blockingDuration.month": "На місяць", - "blockingDuration.permanently": "Назавжди", - "blockingDuration.week": "На неділю", - "comment.block": "Блокувати", - "comment.block-user": "Заблокувати користувача {userName} {duration}?", - "comment.blocked-user": "Заблокованний", - "comment.blocking-period": "Період блокування", - "comment.cancel": "Відмінити", - "comment.controversy": "Спірність: {value}", - "comment.copied": "Скопійовано!", - "comment.copy": "Скопіювати", - "comment.delete": "Видалити", - "comment.delete-message": "Видалити коментар?", - "comment.deleted-comment": "Коментар був видалений", - "comment.deleted-user": "Видален", - "comment.edit": "Редагувати", - "comment.expired-time": "Час редагування минув.", - "comment.go-to-parent": "До батьківського коментарю", - "comment.hide": "Заховати", - "comment.hide-user-comment": "Заховати коментар від користувача {userName}?", - "comment.pin": "Закріпити", - "comment.pin-comment": "Закріпити коментар?", - "comment.reply": "Відповісти", - "comment.time": "{day} в {time}", - "comment.toggle-verification": "Змінити статус справжності облікового запису", - "comment.unblock": "Розблокувати", - "comment.unblock-user": "Розблокувати користувача?", - "comment.unpin": "Відкріпити", - "comment.unpin-comment": "Відкріпити коментар?", - "comment.unverified-user": "Не перевірений на справжність обліковий запис", - "comment.unverify-user": " Прибрати статус справжності облікового запису для{userName}?", - "comment.verified-user": "Справжність облікового запису", - "comment.verify-user": "Підтвердити справжність облікового запису для{userName}?", - "comment.vote-error": "Помилка голосування: {voteErrorMessage}", - "commentForm.anonymous-uploading-disabled": "Завантаження зображень анонімними користувачами заборонена.Будь ласка увійдіть як не анонімний користувач.", - "commentForm.exceeded-size": "Розмір файла {fileName} повинен бути менший ніж {maxImageSize}", - "commentForm.input-placeholder": "Написати коментар", - "commentForm.new-comment": "Новий коментар", - "commentForm.notice-about-styling": "Підтримуеться Markdown форматування", - "commentForm.preview": "Предперегляд", - "commentForm.reply": "Відповісти", - "commentForm.save": "Зберегти", - "commentForm.send": "Відправити", - "commentForm.subscribe-by": "Підписатися", - "commentForm.subscribe-or": "або", - "commentForm.unauthorized-uploading-disabled": "Завантаження зображень недоступна для неавторизованих користувачів. Авторизуйтесь як не анонімний користувач для завантаження зображень.", - "commentForm.unexpected-error": "Щось пішло не так, спробуйте ще раз пізніше.", - "commentForm.upload-file-fail": "{fileName} неможливо завантажити через помилку: \"{errorMessage}\"", - "commentForm.uploading": "Завантаження...", - "commentForm.uploading-file": "Завантаження {fileName}...", - "commentSort.sort-by": "Сортувати по", - "commentsSort.best": "Кращі", - "commentsSort.least-controversial": "Найменш спірні", - "commentsSort.least-recently-updated": "Давно оновлені", - "commentsSort.most-controversial": "Найбільш спірні", - "commentsSort.newest": "Нові", - "commentsSort.oldest": "Старі", - "commentsSort.recently-updated": "Нещодавно оновлені", - "commentsSort.worst": "Гірші", - "emailLoginForm.back": "Назад", - "emailLoginForm.confirm": "Підтвердити", - "emailLoginForm.email-address": "Email адрес", - "emailLoginForm.empty-token": "Поле введення токена не повинно бути порожнім", - "emailLoginForm.expired-token": "Час дії токена минув", - "emailLoginForm.invalid-email": "Введений некоректний email адрес", - "emailLoginForm.loading": "Завантаження...", - "emailLoginForm.send-verification": "Відправити перевірку", - "emailLoginForm.token": "Токен", - "emailLoginForm.user-not-found": "Користувач не знайдений", - "errors.0": "Щось пішло не так,спробуйте ще раз пізніше.", - "errors.1": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", - "errors.10": "Час редагування коментаря минув.", - "errors.11": "На ваш коментар вже відповіли, редагування недоступне.", - "errors.12": "Не вдалося проголосувати. Спробуйте ще раз пізніше.", - "errors.13": "Ви не можете голосувати за свій коментар.", - "errors.14": "Ви вже голосували за цей коментар.", - "errors.15": "Занадто багато голосів за коментар .", - "errors.16": "Коментар досяг мінімальної оцінки.", - "errors.17": "Дія відклонена. Спробуйте ще раз пізніше.", - "errors.18": "Запрашиваемый файл не найден.", - "errors.2": "Не вдалося обробити відповідь від сервера.", - "errors.3": "Недостатньо прав на здійснення цієї дії.", - "errors.4": "Неправильно відформатований коментар.", - "errors.5": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", - "errors.6": "Сайт не знайдено. Перезавантажте сторінку і спробуйте ще раз.", - "errors.7": "Користувач був заблокований.", - "errors.8": "Користувач був заблокований.", - "errors.9": "Не вдалося зберегти зміни.Спробуйте ще раз пізніше.", - "errors.failed-fetch": "Немає відповіді с сервера.Перевірте ваше з’єднання з інтернетом або спробуйте пізніше.", - "errors.forbidden": "Заборонено.", - "errors.not-authorized": "Не авторизований.", - "errors.to-many-request": "Занадто багато запитів.", - "errors.unexpected-error": "Щось пішло не так.", - "root.pinned-comments": "Закріпленні коментарі", + "anonymousLoginForm.length-limit": "Username must be at least 3 characters long", + "anonymousLoginForm.log-in": "Log in", + "anonymousLoginForm.symbol-limit": "Username must contain only letters, numbers, underscores or spaces", + "anonymousLoginForm.user-name": "Username", + "authPanel.anonymous-provider": "Anonymous", + "authPanel.disable-comments": "Disable comments", + "authPanel.disabled-cookies": "Disable third-party cookies blocking to login or open comments in", + "authPanel.enable-comments": "Enable comments", + "authPanel.enable-cookies": "Allow cookies to login and comment", + "authPanel.hide-settings": "Hide settings", + "authPanel.logged-as": "You logged in as", + "authPanel.login": "Login:", + "authPanel.logout": "Logout?", + "authPanel.new-page": "new page", + "authPanel.or-provider": "or", + "authPanel.other-provider": "Other", + "authPanel.read-only": "Read-only", + "authPanel.request-to-delete-data": "Request my data removal", + "authPanel.show-settings": "Show settings", + "blockingDuration.day": "For a day", + "blockingDuration.month": "For a month", + "blockingDuration.permanently": "Permanently", + "blockingDuration.week": "For a week", + "comment.block": "Block", + "comment.block-user": "Do you want to block {userName} {duration}?", + "comment.blocked-user": "Blocked", + "comment.blocking-period": "Blocking period", + "comment.cancel": "Cancel", + "comment.controversy": "Controversy: {value}", + "comment.copied": "Copied!", + "comment.copy": "Copy", + "comment.delete": "Delete", + "comment.delete-message": "Do you want to delete this comment?", + "comment.deleted-comment": "This comment was deleted", + "comment.deleted-user": "Deleted", + "comment.edit": "Edit", + "comment.expired-time": "Editing time has expired.", + "comment.go-to-parent": "Go to parent comment", + "comment.hide": "Hide", + "comment.hide-user-comment": "Do you want to hide comments of {userName}?", + "comment.pin": "Pin", + "comment.pin-comment": "Do you want to pin this comment?", + "comment.reply": "Reply", + "comment.time": "{day} at {time}", + "comment.toggle-verification": "Toggle verification", + "comment.unblock": "Unblock", + "comment.unblock-user": "Do you want to unblock this user?", + "comment.unpin": "Unpin", + "comment.unpin-comment": "Do you want to unpin this comment?", + "comment.unverified-user": "Unverified user", + "comment.unverify-user": "Do you want to unverify {userName}?", + "comment.verified-user": "Verified user", + "comment.verify-user": "Do you want to verify {userName}?", + "comment.vote-error": "Voting error: {voteErrorMessage}", + "commentForm.anonymous-uploading-disabled": "Image uploading is disabled for anonymous users. Please log in not as anonymous user to be able to attach images.", + "commentForm.exceeded-size": "{fileName} exceeds size limit of {maxImageSize}", + "commentForm.input-placeholder": "Your comment here", + "commentForm.new-comment": "New comment", + "commentForm.notice-about-styling": "Styling with Markdown is supported", + "commentForm.preview": "Preview", + "commentForm.reply": "Reply", + "commentForm.save": "Save", + "commentForm.send": "Send", + "commentForm.subscribe-by": "Subscribe by", + "commentForm.subscribe-or": "or", + "commentForm.unauthorized-uploading-disabled": "Image uploading is disabled for unauthorized users. You should login before uploading.", + "commentForm.unexpected-error": "Something went wrong. Please try again a bit later.", + "commentForm.upload-file-fail": "{fileName} upload failed with \"{errorMessage}\"", + "commentForm.uploading": "Uploading...", + "commentForm.uploading-file": "uploading {fileName}...", + "commentSort.sort-by": "Sort by", + "commentsSort.best": "Best", + "commentsSort.least-controversial": "Least controversial", + "commentsSort.least-recently-updated": "Least recently updated", + "commentsSort.most-controversial": "Most controversial", + "commentsSort.newest": "Newest", + "commentsSort.oldest": "Oldest", + "commentsSort.recently-updated": "Recently updated", + "commentsSort.worst": "Worst", + "emailLoginForm.back": "Back", + "emailLoginForm.confirm": "Confirm", + "emailLoginForm.email-address": "Email Address", + "emailLoginForm.empty-token": "Token field must not be empty", + "emailLoginForm.expired-token": "Token is expired", + "emailLoginForm.invalid-email": "Address should be valid email address", + "emailLoginForm.loading": "Loading...", + "emailLoginForm.send-verification": "Send Verification", + "emailLoginForm.token": "Token", + "emailLoginForm.user-not-found": "No user was found", + "errors.0": "Something went wrong. Please try again a bit later.", + "errors.1": "Comment cannot be found. Please refresh the page and try again.", + "errors.10": "It is too late to edit the comment.", + "errors.11": "Comment already has reply, editing is not possible.", + "errors.12": "Cannot save voting result. Please try again a bit later.", + "errors.13": "You cannot vote for your own comment.", + "errors.14": "You have already voted for the comment.", + "errors.15": "Too many votes for the comment.", + "errors.16": "Min score reached for the comment.", + "errors.17": "Action rejected. Please try again a bit later.", + "errors.18": "Requested file cannot be found.", + "errors.2": "Failed to unmarshal incoming request.", + "errors.3": "You don't have permission for this operation.", + "errors.4": "Invalid comment data.", + "errors.5": "Comment cannot be found. Please refresh the page and try again.", + "errors.6": "Site cannot be found. Please refresh the page and try again.", + "errors.7": "User has been blocked.", + "errors.8": "User has been blocked.", + "errors.9": "Comment changing failed. Please try again a bit later.", + "errors.failed-fetch": "Failed to fetch. Please check your internet connection or try again a bit later", + "errors.forbidden": "Forbidden.", + "errors.not-authorized": "Not authorized.", + "errors.to-many-request": "You have reached maximum request limit.", + "errors.unexpected-error": "Something went wrong.", + "root.pinned-comments": "Pinned comments", "root.powered-by": "Powered by Remark42", - "root.show-more": "Показати ще", - "settings.block": "блокувати", - "settings.block-time": "до {day} в {time}", - "settings.block-user": "Заблокувати користувача {userName}?", - "settings.blocked-users-header": "Заблоковані користувачі:", - "settings.blocked-users-title": "Заблоковані користувачі", - "settings.hidden-user-header": "Приховані користувачі:", - "settings.hidden-users-title": "Приховані користувачі", - "settings.hide": "Приховати", - "settings.no-blocked-users": "Немає заблокованих користувачів.", - "settings.no-hidden-users": "Немає прихованих користувачів.", - "settings.permanently": "назавжди", - "settings.show": "Показати", - "settings.unblock": "розблокувати", - "settings.unblock-user": "Розблокувати користувача {userName}?", - "settings.unknown": "безіменний", - "subscribeByEmail.back": "Назад", - "subscribeByEmail.close": "Закрити", + "root.show-more": "Show more", + "settings.block": "block", + "settings.block-time": "until {day} at {time}", + "settings.block-user": "Do you want to block {userName}?", + "settings.blocked-users-header": "Blocked users:", + "settings.blocked-users-title": "Blocked users", + "settings.hidden-user-header": "Hidden users:", + "settings.hidden-users-title": "Hidden users", + "settings.hide": "hide", + "settings.no-blocked-users": "There are no blocked users.", + "settings.no-hidden-users": "There are no hidden users.", + "settings.permanently": "permanently", + "settings.show": "show", + "settings.unblock": "unblock", + "settings.unblock-user": "Do you want to unblock {userName}?", + "settings.unknown": "unknown", + "subscribeByEmail.back": "Back", + "subscribeByEmail.close": "Close", "subscribeByEmail.email": "Email", - "subscribeByEmail.expired-token": "Час дії токена минув", - "subscribeByEmail.have-been-subscribed": "Ви були підписані на оновлення по email", - "subscribeByEmail.have-been-unsubscribed": "Ви були відписані від оновлень по email", - "subscribeByEmail.only-registered-users": "Доступно тільки для зареєстрованих користувачів", - "subscribeByEmail.submit": "Відправити", - "subscribeByEmail.subscribe": "Підписатися", - "subscribeByEmail.subscribe-by-email": "Підписатися по Email", - "subscribeByEmail.subscribe-to-replies": "Підписатися на відповіді", - "subscribeByEmail.subscribed": "Ви були підписані на оновлення по email", - "subscribeByEmail.token": "Токен", - "subscribeByEmail.unsubscribe": "Відмовитися від підписки", - "subscribeByRSS.button-title": "Підписатися по RSS", - "subscribeByRSS.replies": "Відповіді", - "subscribeByRSS.site": "Сайт", - "subscribeByRSS.thread": "Ветка", + "subscribeByEmail.expired-token": "Expired token", + "subscribeByEmail.have-been-subscribed": "You have been subscribed on updates by email", + "subscribeByEmail.have-been-unsubscribed": "You have been unsubscribed by email to updates", + "subscribeByEmail.only-registered-users": "Available only for registered users", + "subscribeByEmail.submit": "Submit", + "subscribeByEmail.subscribe": "Subscribe", + "subscribeByEmail.subscribe-by-email": "Subscribe by Email", + "subscribeByEmail.subscribe-to-replies": "Subscribe to replies", + "subscribeByEmail.subscribed": "You are subscribed on updates by email", + "subscribeByEmail.token": "Token", + "subscribeByEmail.unsubscribe": "Unsubscribe", + "subscribeByRSS.button-title": "Subscribe by RSS", + "subscribeByRSS.replies": "Replies", + "subscribeByRSS.site": "Site", + "subscribeByRSS.thread": "Thread", "subscribeByRSS.title": "RSS", - "toolbar.attach-image": "Прикріпити зображення,перетягніть або вставте зображення з буфера обміну", - "toolbar.bold": "Жирний ", - "toolbar.code": "Код", - "toolbar.header": "Заголовок", - "toolbar.italic": "Курсив ", - "toolbar.link": "Посилання ", - "toolbar.ordered-list": "Упорядкованний список", - "toolbar.quote": "Цитата", - "toolbar.unordered-list": "Неупорядкованний список", - "user-info.last-comments": "Останні коментарі {userName}", - "user-info.unexpected-error": "Щось пішло не так", - "vote.anonymous": "Не можна голосувати анонімному користувачу", - "vote.deleted": "Не можна голосувати за видалений коментар", - "vote.guest": "Увійдіть в систему для голосування", - "vote.only-positive": "Дозволені тільки позитивні оцінки", - "vote.only-post-page": "Голосування можливо тільки для статей", - "vote.own-comment": "Ви не можете голосувати за свої коментарі", - "vote.readonly": "Не можна голосувати за коментарі, які в режимі тільки для читання" + "toolbar.attach-image": "Attach the image, drag & drop or paste from clipboard", + "toolbar.bold": "Add bold text ", + "toolbar.code": "Insert a code", + "toolbar.header": "Add header text", + "toolbar.italic": "Add italic text ", + "toolbar.link": "Add a link ", + "toolbar.ordered-list": "Add a numbered list", + "toolbar.quote": "Insert a quote", + "toolbar.unordered-list": "Add a bulleted list", + "user-info.last-comments": "Last comments by {userName}", + "user-info.unexpected-error": "Something went wrong", + "vote.anonymous": "Anonymous users can't vote", + "vote.deleted": "Can't vote for deleted comment", + "vote.guest": "Sign in to vote", + "vote.only-positive": "Only positive score allowed", + "vote.only-post-page": "Voting allowed only on post's page", + "vote.own-comment": "Can't vote for your own comment", + "vote.readonly": "Can't vote on read-only topics" } From a8752bb41c8b80a876b398800c2ad0943bd4824b Mon Sep 17 00:00:00 2001 From: ivanezko Date: Wed, 4 Nov 2020 11:21:44 +0200 Subject: [PATCH 05/16] add ukranian locale --- frontend/app/locales/ua.json | 330 +++++++++++++++++------------------ 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/frontend/app/locales/ua.json b/frontend/app/locales/ua.json index 040dec92..8cf674b4 100644 --- a/frontend/app/locales/ua.json +++ b/frontend/app/locales/ua.json @@ -1,170 +1,170 @@ { - "anonymousLoginForm.length-limit": "Username must be at least 3 characters long", - "anonymousLoginForm.log-in": "Log in", - "anonymousLoginForm.symbol-limit": "Username must contain only letters, numbers, underscores or spaces", - "anonymousLoginForm.user-name": "Username", - "authPanel.anonymous-provider": "Anonymous", - "authPanel.disable-comments": "Disable comments", - "authPanel.disabled-cookies": "Disable third-party cookies blocking to login or open comments in", - "authPanel.enable-comments": "Enable comments", - "authPanel.enable-cookies": "Allow cookies to login and comment", - "authPanel.hide-settings": "Hide settings", - "authPanel.logged-as": "You logged in as", - "authPanel.login": "Login:", - "authPanel.logout": "Logout?", - "authPanel.new-page": "new page", - "authPanel.or-provider": "or", - "authPanel.other-provider": "Other", - "authPanel.read-only": "Read-only", - "authPanel.request-to-delete-data": "Request my data removal", - "authPanel.show-settings": "Show settings", - "blockingDuration.day": "For a day", - "blockingDuration.month": "For a month", - "blockingDuration.permanently": "Permanently", - "blockingDuration.week": "For a week", - "comment.block": "Block", - "comment.block-user": "Do you want to block {userName} {duration}?", - "comment.blocked-user": "Blocked", - "comment.blocking-period": "Blocking period", - "comment.cancel": "Cancel", - "comment.controversy": "Controversy: {value}", - "comment.copied": "Copied!", - "comment.copy": "Copy", - "comment.delete": "Delete", - "comment.delete-message": "Do you want to delete this comment?", - "comment.deleted-comment": "This comment was deleted", - "comment.deleted-user": "Deleted", - "comment.edit": "Edit", - "comment.expired-time": "Editing time has expired.", - "comment.go-to-parent": "Go to parent comment", - "comment.hide": "Hide", - "comment.hide-user-comment": "Do you want to hide comments of {userName}?", - "comment.pin": "Pin", - "comment.pin-comment": "Do you want to pin this comment?", - "comment.reply": "Reply", - "comment.time": "{day} at {time}", - "comment.toggle-verification": "Toggle verification", - "comment.unblock": "Unblock", - "comment.unblock-user": "Do you want to unblock this user?", - "comment.unpin": "Unpin", - "comment.unpin-comment": "Do you want to unpin this comment?", - "comment.unverified-user": "Unverified user", - "comment.unverify-user": "Do you want to unverify {userName}?", - "comment.verified-user": "Verified user", - "comment.verify-user": "Do you want to verify {userName}?", - "comment.vote-error": "Voting error: {voteErrorMessage}", - "commentForm.anonymous-uploading-disabled": "Image uploading is disabled for anonymous users. Please log in not as anonymous user to be able to attach images.", - "commentForm.exceeded-size": "{fileName} exceeds size limit of {maxImageSize}", - "commentForm.input-placeholder": "Your comment here", - "commentForm.new-comment": "New comment", - "commentForm.notice-about-styling": "Styling with Markdown is supported", - "commentForm.preview": "Preview", - "commentForm.reply": "Reply", - "commentForm.save": "Save", - "commentForm.send": "Send", - "commentForm.subscribe-by": "Subscribe by", - "commentForm.subscribe-or": "or", - "commentForm.unauthorized-uploading-disabled": "Image uploading is disabled for unauthorized users. You should login before uploading.", - "commentForm.unexpected-error": "Something went wrong. Please try again a bit later.", - "commentForm.upload-file-fail": "{fileName} upload failed with \"{errorMessage}\"", - "commentForm.uploading": "Uploading...", - "commentForm.uploading-file": "uploading {fileName}...", - "commentSort.sort-by": "Sort by", - "commentsSort.best": "Best", - "commentsSort.least-controversial": "Least controversial", - "commentsSort.least-recently-updated": "Least recently updated", - "commentsSort.most-controversial": "Most controversial", - "commentsSort.newest": "Newest", - "commentsSort.oldest": "Oldest", - "commentsSort.recently-updated": "Recently updated", - "commentsSort.worst": "Worst", - "emailLoginForm.back": "Back", - "emailLoginForm.confirm": "Confirm", - "emailLoginForm.email-address": "Email Address", - "emailLoginForm.empty-token": "Token field must not be empty", - "emailLoginForm.expired-token": "Token is expired", - "emailLoginForm.invalid-email": "Address should be valid email address", - "emailLoginForm.loading": "Loading...", - "emailLoginForm.send-verification": "Send Verification", - "emailLoginForm.token": "Token", - "emailLoginForm.user-not-found": "No user was found", - "errors.0": "Something went wrong. Please try again a bit later.", - "errors.1": "Comment cannot be found. Please refresh the page and try again.", - "errors.10": "It is too late to edit the comment.", - "errors.11": "Comment already has reply, editing is not possible.", - "errors.12": "Cannot save voting result. Please try again a bit later.", - "errors.13": "You cannot vote for your own comment.", - "errors.14": "You have already voted for the comment.", - "errors.15": "Too many votes for the comment.", - "errors.16": "Min score reached for the comment.", - "errors.17": "Action rejected. Please try again a bit later.", - "errors.18": "Requested file cannot be found.", - "errors.2": "Failed to unmarshal incoming request.", - "errors.3": "You don't have permission for this operation.", - "errors.4": "Invalid comment data.", - "errors.5": "Comment cannot be found. Please refresh the page and try again.", - "errors.6": "Site cannot be found. Please refresh the page and try again.", - "errors.7": "User has been blocked.", - "errors.8": "User has been blocked.", - "errors.9": "Comment changing failed. Please try again a bit later.", - "errors.failed-fetch": "Failed to fetch. Please check your internet connection or try again a bit later", - "errors.forbidden": "Forbidden.", - "errors.not-authorized": "Not authorized.", - "errors.to-many-request": "You have reached maximum request limit.", - "errors.unexpected-error": "Something went wrong.", - "root.pinned-comments": "Pinned comments", + "anonymousLoginForm.length-limit": "Довжина імені повинна бути більше 3 символів", + "anonymousLoginForm.log-in": "Увійти", + "anonymousLoginForm.symbol-limit": "Ім’я користувача повинно починатися з літери і містити тільки латинські букви,цифри,знаки підкреслення і прогалини", + "anonymousLoginForm.user-name": "Ім’я користувача", + "authPanel.anonymous-provider": "Анонімно", + "authPanel.disable-comments": "Увімкнути коментарі", + "authPanel.disabled-cookies": "Заборонені third-party cookies не дозволяють працювати коментарям", + "authPanel.enable-comments": "Включить комментарии", + "authPanel.enable-cookies": "Дозвольте Cookies", + "authPanel.hide-settings": "Заховати налаштування", + "authPanel.logged-as": "Ви увійшли як", + "authPanel.login": "Вхід:", + "authPanel.logout": "Вийти?", + "authPanel.new-page": "нова сторінка", + "authPanel.or-provider": "або", + "authPanel.other-provider": "Інший", + "authPanel.read-only": "Тільки для читання", + "authPanel.request-to-delete-data": "Запросити видалення моїх даних", + "authPanel.show-settings": "Показати налаштування", + "blockingDuration.day": "На день", + "blockingDuration.month": "На місяць", + "blockingDuration.permanently": "Назавжди", + "blockingDuration.week": "На неділю", + "comment.block": "Блокувати", + "comment.block-user": "Заблокувати користувача {userName} {duration}?", + "comment.blocked-user": "Заблокованний", + "comment.blocking-period": "Період блокування", + "comment.cancel": "Відмінити", + "comment.controversy": "Спірність: {value}", + "comment.copied": "Скопійовано!", + "comment.copy": "Скопіювати", + "comment.delete": "Видалити", + "comment.delete-message": "Видалити коментар?", + "comment.deleted-comment": "Коментар був видалений", + "comment.deleted-user": "Видален", + "comment.edit": "Редагувати", + "comment.expired-time": "Час редагування минув.", + "comment.go-to-parent": "До батьківського коментарю", + "comment.hide": "Заховати", + "comment.hide-user-comment": "Заховати коментар від користувача {userName}?", + "comment.pin": "Закріпити", + "comment.pin-comment": "Закріпити коментар?", + "comment.reply": "Відповісти", + "comment.time": "{day} в {time}", + "comment.toggle-verification": "Змінити статус справжності облікового запису", + "comment.unblock": "Розблокувати", + "comment.unblock-user": "Розблокувати користувача?", + "comment.unpin": "Відкріпити", + "comment.unpin-comment": "Відкріпити коментар?", + "comment.unverified-user": "Не перевірений на справжність обліковий запис", + "comment.unverify-user": "Прибрати статус справжності облікового запису для{userName}?", + "comment.verified-user": "Справжність облікового запису", + "comment.verify-user": "Підтвердити справжність облікового запису для{userName}?", + "comment.vote-error": "Помилка голосування: {voteErrorMessage}", + "commentForm.anonymous-uploading-disabled": "Завантаження зображень анонімними користувачами заборонена.Будь ласка увійдіть як не анонімний користувач.", + "commentForm.exceeded-size": "Розмір файла {fileName} повинен бути менший ніж {maxImageSize}", + "commentForm.input-placeholder": "Написати коментар", + "commentForm.new-comment": "Новий коментар", + "commentForm.notice-about-styling": "Підтримуеться Markdown форматування", + "commentForm.preview": "Предперегляд", + "commentForm.reply": "Відповісти", + "commentForm.save": "Зберегти", + "commentForm.send": "Відправити", + "commentForm.subscribe-by": "Підписатися", + "commentForm.subscribe-or": "або", + "commentForm.unauthorized-uploading-disabled": "Завантаження зображень недоступна для неавторизованих користувачів. Авторизуйтесь як не анонімний користувач для завантаження зображень.", + "commentForm.unexpected-error": "Щось пішло не так, спробуйте ще раз пізніше.", + "commentForm.upload-file-fail": "{fileName} неможливо завантажити через помилку: \"{errorMessage}\"", + "commentForm.uploading": "Завантаження...", + "commentForm.uploading-file": "Завантаження {fileName}...", + "commentSort.sort-by": "Сортувати по", + "commentsSort.best": "Кращі", + "commentsSort.least-controversial": "Найменш спірні", + "commentsSort.least-recently-updated": "Давно оновлені", + "commentsSort.most-controversial": "Найбільш спірні", + "commentsSort.newest": "Нові", + "commentsSort.oldest": "Старі", + "commentsSort.recently-updated": "Нещодавно оновлені", + "commentsSort.worst": "Гірші", + "emailLoginForm.back": "Назад", + "emailLoginForm.confirm": "Підтвердити", + "emailLoginForm.email-address": "Email адрес", + "emailLoginForm.empty-token": "Поле введення токена не повинно бути порожнім", + "emailLoginForm.expired-token": "Час дії токена минув", + "emailLoginForm.invalid-email": "Введений некоректний email адрес", + "emailLoginForm.loading": "Завантаження...", + "emailLoginForm.send-verification": "Відправити перевірку", + "emailLoginForm.token": "Токен", + "emailLoginForm.user-not-found": "Користувач не знайдений", + "errors.0": "Щось пішло не так,спробуйте ще раз пізніше.", + "errors.1": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", + "errors.10": "Час редагування коментаря минув.", + "errors.11": "На ваш коментар вже відповіли, редагування недоступне.", + "errors.12": "Не вдалося проголосувати. Спробуйте ще раз пізніше.", + "errors.13": "Ви не можете голосувати за свій коментар.", + "errors.14": "Ви вже голосували за цей коментар.", + "errors.15": "Занадто багато голосів за коментар .", + "errors.16": "Коментар досяг мінімальної оцінки.", + "errors.17": "Дія відклонена. Спробуйте ще раз пізніше.", + "errors.18": "Запрашиваемый файл не найден.", + "errors.2": "Не вдалося обробити відповідь від сервера.", + "errors.3": "Недостатньо прав на здійснення цієї дії.", + "errors.4": "Неправильно відформатований коментар.", + "errors.5": "Коментар не знайдений. Перезавантажте сторінку і спробуйте ще раз.", + "errors.6": "Сайт не знайдено. Перезавантажте сторінку і спробуйте ще раз.", + "errors.7": "Користувач був заблокований.", + "errors.8": "Користувач був заблокований.", + "errors.9": "Не вдалося зберегти зміни.Спробуйте ще раз пізніше.", + "errors.failed-fetch": "Немає відповіді с сервера.Перевірте ваше з’єднання з інтернетом або спробуйте пізніше.", + "errors.forbidden": "Заборонено.", + "errors.not-authorized": "Не авторизований.", + "errors.to-many-request": "Занадто багато запитів.", + "errors.unexpected-error": "Щось пішло не так.", + "root.pinned-comments": "Закріпленні коментарі", "root.powered-by": "Powered by Remark42", - "root.show-more": "Show more", - "settings.block": "block", - "settings.block-time": "until {day} at {time}", - "settings.block-user": "Do you want to block {userName}?", - "settings.blocked-users-header": "Blocked users:", - "settings.blocked-users-title": "Blocked users", - "settings.hidden-user-header": "Hidden users:", - "settings.hidden-users-title": "Hidden users", - "settings.hide": "hide", - "settings.no-blocked-users": "There are no blocked users.", - "settings.no-hidden-users": "There are no hidden users.", - "settings.permanently": "permanently", - "settings.show": "show", - "settings.unblock": "unblock", - "settings.unblock-user": "Do you want to unblock {userName}?", - "settings.unknown": "unknown", - "subscribeByEmail.back": "Back", - "subscribeByEmail.close": "Close", + "root.show-more": "Показати ще", + "settings.block": "блокувати", + "settings.block-time": "до {day} в {time}", + "settings.block-user": "Заблокувати користувача {userName}?", + "settings.blocked-users-header": "Заблоковані користувачі:", + "settings.blocked-users-title": "Заблоковані користувачі", + "settings.hidden-user-header": "Приховані користувачі:", + "settings.hidden-users-title": "Приховані користувачі", + "settings.hide": "Приховати", + "settings.no-blocked-users": "Немає заблокованих користувачів.", + "settings.no-hidden-users": "Немає прихованих користувачів.", + "settings.permanently": "назавжди", + "settings.show": "Показати", + "settings.unblock": "розблокувати", + "settings.unblock-user": "Розблокувати користувача {userName}?", + "settings.unknown": "безіменний", + "subscribeByEmail.back": "Назад", + "subscribeByEmail.close": "Закрити", "subscribeByEmail.email": "Email", - "subscribeByEmail.expired-token": "Expired token", - "subscribeByEmail.have-been-subscribed": "You have been subscribed on updates by email", - "subscribeByEmail.have-been-unsubscribed": "You have been unsubscribed by email to updates", - "subscribeByEmail.only-registered-users": "Available only for registered users", - "subscribeByEmail.submit": "Submit", - "subscribeByEmail.subscribe": "Subscribe", - "subscribeByEmail.subscribe-by-email": "Subscribe by Email", - "subscribeByEmail.subscribe-to-replies": "Subscribe to replies", - "subscribeByEmail.subscribed": "You are subscribed on updates by email", - "subscribeByEmail.token": "Token", - "subscribeByEmail.unsubscribe": "Unsubscribe", - "subscribeByRSS.button-title": "Subscribe by RSS", - "subscribeByRSS.replies": "Replies", - "subscribeByRSS.site": "Site", - "subscribeByRSS.thread": "Thread", + "subscribeByEmail.expired-token": "Час дії токена минув", + "subscribeByEmail.have-been-subscribed": "Ви були підписані на оновлення по email", + "subscribeByEmail.have-been-unsubscribed": "Ви були відписані від оновлень по email", + "subscribeByEmail.only-registered-users": "Доступно тільки для зареєстрованих користувачів", + "subscribeByEmail.submit": "Відправити", + "subscribeByEmail.subscribe": "Підписатися", + "subscribeByEmail.subscribe-by-email": "Підписатися по Email", + "subscribeByEmail.subscribe-to-replies": "Підписатися на відповіді", + "subscribeByEmail.subscribed": "Ви були підписані на оновлення по email", + "subscribeByEmail.token": "Токен", + "subscribeByEmail.unsubscribe": "Відмовитися від підписки", + "subscribeByRSS.button-title": "Підписатися по RSS", + "subscribeByRSS.replies": "Відповіді", + "subscribeByRSS.site": "Сайт", + "subscribeByRSS.thread": "Ветка", "subscribeByRSS.title": "RSS", - "toolbar.attach-image": "Attach the image, drag & drop or paste from clipboard", - "toolbar.bold": "Add bold text ", - "toolbar.code": "Insert a code", - "toolbar.header": "Add header text", - "toolbar.italic": "Add italic text ", - "toolbar.link": "Add a link ", - "toolbar.ordered-list": "Add a numbered list", - "toolbar.quote": "Insert a quote", - "toolbar.unordered-list": "Add a bulleted list", - "user-info.last-comments": "Last comments by {userName}", - "user-info.unexpected-error": "Something went wrong", - "vote.anonymous": "Anonymous users can't vote", - "vote.deleted": "Can't vote for deleted comment", - "vote.guest": "Sign in to vote", - "vote.only-positive": "Only positive score allowed", - "vote.only-post-page": "Voting allowed only on post's page", - "vote.own-comment": "Can't vote for your own comment", - "vote.readonly": "Can't vote on read-only topics" + "toolbar.attach-image": "Прикріпити зображення,перетягніть або вставте зображення з буфера обміну", + "toolbar.bold": "Жирний ", + "toolbar.code": "Код", + "toolbar.header": "Заголовок", + "toolbar.italic": "Курсив ", + "toolbar.link": "Посилання ", + "toolbar.ordered-list": "Упорядкованний список", + "toolbar.quote": "Цитата", + "toolbar.unordered-list": "Неупорядкованний список", + "user-info.last-comments": "Останні коментарі {userName}", + "user-info.unexpected-error": "Щось пішло не так", + "vote.anonymous": "Не можна голосувати анонімному користувачу", + "vote.deleted": "Не можна голосувати за видалений коментар", + "vote.guest": "Увійдіть в систему для голосування", + "vote.only-positive": "Дозволені тільки позитивні оцінки", + "vote.only-post-page": "Голосування можливо тільки для статей", + "vote.own-comment": "Ви не можете голосувати за свої коментарі", + "vote.readonly": "Не можна голосувати за коментарі, які в режимі тільки для читання" } From 18ba05cea001f10b8723ee330304985fc7649c6e Mon Sep 17 00:00:00 2001 From: ivanezko Date: Wed, 4 Nov 2020 12:34:42 +0200 Subject: [PATCH 06/16] add ukranian locale --- frontend/app/locales/ua.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/locales/ua.json b/frontend/app/locales/ua.json index 8cf674b4..75382438 100644 --- a/frontend/app/locales/ua.json +++ b/frontend/app/locales/ua.json @@ -4,9 +4,9 @@ "anonymousLoginForm.symbol-limit": "Ім’я користувача повинно починатися з літери і містити тільки латинські букви,цифри,знаки підкреслення і прогалини", "anonymousLoginForm.user-name": "Ім’я користувача", "authPanel.anonymous-provider": "Анонімно", - "authPanel.disable-comments": "Увімкнути коментарі", + "authPanel.disable-comments": "Вімкнути коментарі", "authPanel.disabled-cookies": "Заборонені third-party cookies не дозволяють працювати коментарям", - "authPanel.enable-comments": "Включить комментарии", + "authPanel.enable-comments": "Увімкнути коментари", "authPanel.enable-cookies": "Дозвольте Cookies", "authPanel.hide-settings": "Заховати налаштування", "authPanel.logged-as": "Ви увійшли як", From 4da83d9231d8812db06e5d40ce25ab57ab9d851c Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Tue, 20 Oct 2020 17:45:20 +0300 Subject: [PATCH 07/16] #212: Fix max length counter in Safari --- .../app/components/comment-form/comment-form.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index d5d56a8c..b60e8a72 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -23,6 +23,7 @@ import TextareaAutosize from './textarea-autosize'; import { TextExpander } from './text-expander'; let textareaId = 0; +const MAX_LENGTH = StaticStore.config.max_comment_size; export interface Props { id: string; @@ -51,7 +52,6 @@ export interface State { /** prevents error hiding on input event */ errorLock: boolean; isDisabled: boolean; - maxLength: number; /** main input value */ text: string; /** override main button text */ @@ -127,7 +127,6 @@ export class CommentForm extends Component { errorMessage: null, errorLock: false, isDisabled: false, - maxLength: StaticStore.config.max_comment_size, text, buttonText: null, }; @@ -178,13 +177,14 @@ export class CommentForm extends Component { onInput = (e: Event) => { const { value } = e.target as HTMLInputElement; + const text = value.substr(0, MAX_LENGTH); updateJsonItem(LS_SAVED_COMMENT_VALUE, { [this.props.id]: value }); if (this.state.errorLock) { this.setState({ preview: null, - text: value, + text, }); return; } @@ -193,7 +193,7 @@ export class CommentForm extends Component { isErrorShown: false, errorMessage: null, preview: null, - text: value, + text, }); }; @@ -446,8 +446,9 @@ export class CommentForm extends Component { ); - render(props: Props, { isDisabled, isErrorShown, errorMessage, preview, maxLength, text, buttonText }: State) { - const charactersLeft = maxLength - text.length; + render(props: Props, { isDisabled, isErrorShown, errorMessage, preview, text, buttonText }: State) { + const charactersLeft = MAX_LENGTH - text.length; + errorMessage = props.errorMessage || errorMessage; const Labels = { main: , @@ -491,7 +492,6 @@ export class CommentForm extends Component { className="comment-form__field" placeholder={placeholderMessage} value={text} - maxLength={maxLength} onInput={this.onInput} onKeyDown={this.onKeyDown} disabled={isDisabled} From f4aa7332d517cdf72c9bd7888a1badeda7be3e6a Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Sun, 8 Nov 2020 16:27:22 +0300 Subject: [PATCH 08/16] Add tests and change props/state getting to fix TS error --- .../comment-form/comment-form.test.tsx | 72 ++++++++++++++----- .../components/comment-form/comment-form.tsx | 41 ++++++----- 2 files changed, 75 insertions(+), 38 deletions(-) diff --git a/frontend/app/components/comment-form/comment-form.test.tsx b/frontend/app/components/comment-form/comment-form.test.tsx index adb2d69b..f798bd84 100644 --- a/frontend/app/components/comment-form/comment-form.test.tsx +++ b/frontend/app/components/comment-form/comment-form.test.tsx @@ -7,16 +7,16 @@ import { StaticStore } from '@app/common/static_store'; import { LS_SAVED_COMMENT_VALUE } from '@app/common/constants'; import * as localStorageModule from '@app/common/local-storage'; -import { CommentForm, Props, messages } from './comment-form'; +import { CommentForm, Props, messages, State } from './comment-form'; import { SubscribeByEmail } from './__subscribe-by-email'; import TextareaAutosize from './textarea-autosize'; -function createEvent(type: string, value: T) { +function createEvent(type: string, value: T): E { const event = new Event(type); Object.defineProperty(event, 'target', { value }); - return event; + return event as E; } const DEFAULT_PROPS: Readonly> = { @@ -35,7 +35,7 @@ const intl = { } as any; describe('', () => { - it('should render without control panel, preview button, and rss links in "simple view" mode', () => { + it('should shallow without control panel, preview button, and rss links in "simple view" mode', () => { const props = { ...DEFAULT_PROPS, simpleView: true, intl }; const wrapper = shallow(); @@ -44,7 +44,7 @@ describe('', () => { expect(wrapper.exists('.comment-form__rss')).toEqual(false); }); - it('should be rendered with email subscription button', () => { + it('should be shallowed with email subscription button', () => { StaticStore.config.email_notifications = true; const props = { ...DEFAULT_PROPS, user, intl }; @@ -107,9 +107,8 @@ describe('', () => { }); it('should update value', () => { const props = { ...DEFAULT_PROPS, user, intl }; - const wrapper = shallow(); - // @ts-ignore - const instance: CommentForm = wrapper.instance(); + const wrapper = shallow(); + const instance = wrapper.instance(); instance.onInput(createEvent('input', { value: '1' })); expect(localStorage.getItem(LS_SAVED_COMMENT_VALUE)).toBe('{"1":"1"}'); @@ -122,9 +121,8 @@ describe('', () => { localStorage.setItem(LS_SAVED_COMMENT_VALUE, JSON.stringify({ '1': 'asd' })); const updateJsonItemSpy = jest.spyOn(localStorageModule, 'updateJsonItem'); const props = { ...DEFAULT_PROPS, user, intl }; - const wrapper = shallow(); - // @ts-ignore - const instance: CommentForm = wrapper.instance(); + const wrapper = shallow(); + const instance = wrapper.instance(); await instance.send(createEvent('send', { preventDefault: () => undefined })); expect(updateJsonItemSpy).toHaveBeenCalled(); @@ -134,9 +132,8 @@ describe('', () => { it('should show error message of image upload try by anonymous user', () => { const props = { ...DEFAULT_PROPS, user: anonymousUser, intl }; - const wrapper = shallow(); - // @ts-ignore - const instance: CommentForm = wrapper.instance(); + const wrapper = shallow(); + const instance = wrapper.instance(); instance.onDrop(new Event('drag') as DragEvent); expect(wrapper.exists('.comment-form__error')).toEqual(true); @@ -145,12 +142,53 @@ describe('', () => { it('should show error message of image upload try by unauthorized user', () => { const props = { ...DEFAULT_PROPS, intl }; - const wrapper = shallow(); - // @ts-ignore - const instance: CommentForm = wrapper.instance(); + const wrapper = shallow(); + const instance = wrapper.instance(); instance.onDrop(new Event('drag') as DragEvent); expect(wrapper.exists('.comment-form__error')).toEqual(true); expect(wrapper.find('.comment-form__error').text()).toEqual(messages.unauthorizedUploadingDisabled.defaultMessage); }); + + it('should show rest letters counter', async () => { + expect.assertions(3); + + const originalConfig = { ...StaticStore.config }; + StaticStore.config.max_comment_size = 2000; + const props = { ...DEFAULT_PROPS, intl }; + const wrapper = shallow(); + const instance = wrapper.instance(); + const text = + 'That was Wintermute, manipulating the lock the way it had manipulated the drone micro and the chassis of a gutted game console. It was chambered for .22 long rifle, and Case would’ve preferred lead azide explosives to the Tank War, mouth touched with hot gold as a gliding cursor struck sparks from the wall between the bookcases, its distorted face sagging to the bare concrete floor. Splayed in his elastic g-web, Case watched the other passengers as he made his way down Shiga from the sushi stall he cradled it in his jacket pocket. Images formed and reformed: a flickering montage of the Sprawl’s towers and ragged Fuller domes, dim figures moving toward him in the Japanese night like live wire voodoo and he’d cry for it, cry in his jacket pocket. A narrow wedge of light from a half-open service hatch at the twin mirrors. Still it was a square of faint light. The alarm still oscillated, louder here, the rear wall dulling the roar of the arcade showed him broken lengths of damp chipboard and the robot gardener. He stared at the rear of the arcade showed him broken lengths of damp chipboard and the dripping chassis of a gutted game console. That was Wintermute, manipulating the lock the way it had manipulated the drone micro and the chassis of a gutted game console. It was chambered for .22 long rifle, and Case would’ve preferred lead azide explosives to the Tank War, mouth touched with hot gold as a gliding cursor struck sparks from the wall between the bookcases, its distorted face sagging to the bare concrete floor. Splayed in his elastic g-web, Case watched the other passengers as he made his way down Shiga from the sushi stall he cradled it in his jacket pocket. Images formed and reformed: a flickering montage of the Sprawl’s towers and ragged Fuller domes, dim figures moving toward him in the Japanese night like live wire voodoo and he’d cry for it, cry in his jacket.'; + + instance.setState({ text }); + await wrapper.update(); + + expect(instance.state.text).toBe(text); + expect(wrapper.find('.comment-form__counter').exists()).toBe(true); + expect(wrapper.find('.comment-form__counter').text()).toBe('99'); + + StaticStore.config = originalConfig; + }); + + it('should show zero in rest letters counter', async () => { + expect.assertions(2); + + const originalConfig = { ...StaticStore.config }; + StaticStore.config.max_comment_size = 2000; + const props = { ...DEFAULT_PROPS, intl }; + const wrapper = shallow(); + const instance = wrapper.instance(); + const text = + 'All the speed he took, all the turns he’d taken and the amplified breathing of the Sprawl’s towers and ragged Fuller domes, dim figures moving toward him in the dark. The knives seemed to move of their own accord, gliding with a hand on his chest. Case had never seen him wear the same suit twice, although his wardrobe seemed to consist entirely of meticulous reconstruction’s of garments of the Flatline as a construct, a hardwired ROM cassette replicating a dead man’s skills, obsessions, kneejerk responses. Case had never seen him wear the same suit twice, although his wardrobe seemed to consist entirely of meticulous reconstruction’s of garments of the bright void beyond the chain link. Now this quiet courtyard, Sunday afternoon, this girl with a random collection of European furniture, as though Deane had once intended to use the place as his home. Now this quiet courtyard, Sunday afternoon, this girl with a ritual lack of urgency through the arcs and passes of their dance, point passing point, as the men waited for an opening. They floated in the shade beneath a bridge or overpass. A graphic representation of data abstracted from the banks of every computer in the coffin for Armitage’s call. All the speed he took, all the turns he’d taken and the amplified breathing of the Sprawl’s towers and ragged Fuller domes, dim figures moving toward him in the dark. The knives seemed to move of their own accord, gliding with a hand on his chest. Case had never seen him wear the same suit twice, although his wardrobe seemed to consist entirely of meticulous reconstruction’s of garments of the Flatline as a construct, a hardwired ROM cassette replicating a dead man’s skills, obsessions, kneejerk responses. Case had never seen him wear the same suit twice, although his wardrobe seemed to consist entirely of meticulous reconstruction’s of garments of the bright void beyond the chain link. Now this quiet courtyard, Sunday afternoon, this girl with a random collection of European furniture, as though Deane had once intended to use the place as his home. Now this quiet courtyard, Sunday afternoon, this girl with a ritual lack of urgency through the arcs and passes of their dance, point passing point, as the men waited for an opening. They floated in the shade beneath a bridge or overpass. A graphic representation of data abstracted from the banks of every computer in the coffin for Armitage’s call.'; + + instance.onInput(createEvent('input', { value: text })); + + await wrapper.update(); + + expect(instance.state.text).toBe(text.substr(0, StaticStore.config.max_comment_size)); + expect(wrapper.find('.comment-form__counter').text()).toBe('0'); + + StaticStore.config = originalConfig; + }); }); diff --git a/frontend/app/components/comment-form/comment-form.tsx b/frontend/app/components/comment-form/comment-form.tsx index b60e8a72..55756c9a 100644 --- a/frontend/app/components/comment-form/comment-form.tsx +++ b/frontend/app/components/comment-form/comment-form.tsx @@ -23,7 +23,6 @@ import TextareaAutosize from './textarea-autosize'; import { TextExpander } from './text-expander'; let textareaId = 0; -const MAX_LENGTH = StaticStore.config.max_comment_size; export interface Props { id: string; @@ -177,7 +176,7 @@ export class CommentForm extends Component { onInput = (e: Event) => { const { value } = e.target as HTMLInputElement; - const text = value.substr(0, MAX_LENGTH); + const text = value.substr(0, StaticStore.config.max_comment_size); updateJsonItem(LS_SAVED_COMMENT_VALUE, { [this.props.id]: value }); @@ -446,38 +445,38 @@ export class CommentForm extends Component { ); - render(props: Props, { isDisabled, isErrorShown, errorMessage, preview, text, buttonText }: State) { - const charactersLeft = MAX_LENGTH - text.length; - - errorMessage = props.errorMessage || errorMessage; + render() { + const { theme, mode, simpleView, mix, uploadImage, autofocus, user, intl } = this.props; + const { isDisabled, isErrorShown, preview, text, buttonText } = this.state; + const charactersLeft = StaticStore.config.max_comment_size - text.length; + const errorMessage = this.props.errorMessage || this.state.errorMessage; const Labels = { main: , edit: , reply: , }; - const label = buttonText || Labels[props.mode || 'main']; - const intl = this.props.intl; + const label = buttonText || Labels[mode || 'main']; const placeholderMessage = intl.formatMessage(messages.placeholder); return (
- {!props.simpleView && ( + {!simpleView && (
@@ -495,7 +494,7 @@ export class CommentForm extends Component { onInput={this.onInput} onKeyDown={this.onKeyDown} disabled={isDisabled} - autofocus={!!props.autofocus} + autofocus={!!autofocus} spellcheck={true} /> @@ -510,13 +509,13 @@ export class CommentForm extends Component { ))}
- {this.props.user ? ( + {user ? (
- {!props.simpleView && ( + {!simpleView && (
- {!props.simpleView && props.mode === 'main' && ( + {!simpleView && mode === 'main' && (
{this.renderMarkdownTip()} {' '} - + {StaticStore.config.email_notifications && StaticStore.query.show_email_subscription && ( {' '} @@ -559,7 +558,7 @@ export class CommentForm extends Component {
From e6aa4736ea3f4e20a91b7454b328d645f34ffe47 Mon Sep 17 00:00:00 2001 From: Ksinia Date: Mon, 9 Nov 2020 00:33:12 +0100 Subject: [PATCH 09/16] Fix RSS links --- .../__subscribe-by-rss/comment-form__subscribe-by-rss.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.tsx b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.tsx index dc9e98cd..9ef68401 100644 --- a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.tsx +++ b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.tsx @@ -39,9 +39,9 @@ export const SubscribeByRSS: FunctionComponent<{ userId: string | null }> = ({ u const intl = useIntl(); const items: Array<[string, string]> = useMemo( () => [ - [createSubscribeUrl('post'), intl.formatMessage(messages.thread)], - [createSubscribeUrl('site', `&user=${userId}`), intl.formatMessage(messages.site)], - [createSubscribeUrl('reply', `&url=${url}`), intl.formatMessage(messages.replies)], + [createSubscribeUrl('post', `&url=${url}`), intl.formatMessage(messages.thread)], + [createSubscribeUrl('site'), intl.formatMessage(messages.site)], + [createSubscribeUrl('reply', `&user=${userId}`), intl.formatMessage(messages.replies)], ], [userId] ); From d87135a80ae3ec7a8ac54fc9c9c199bd4f2ba3a2 Mon Sep 17 00:00:00 2001 From: Ksinia Date: Mon, 9 Nov 2020 01:26:53 +0100 Subject: [PATCH 10/16] Fix test for Replies link --- .../comment-form__subscribe-by-rss.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx index 1e639cc7..f1658e74 100644 --- a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx +++ b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx @@ -31,9 +31,9 @@ describe('', () => { expect(wrapper.find('.comment-form__rss-dropdown__link')).toHaveLength(3); }); - it('should have userId in site link', () => { - expect(wrapper.find('.comment-form__rss-dropdown__link').at(1).prop('href')).toEqual( - createSubscribeUrl('site', '&user=user-1') + it('should have userId in Replies link', () => { + expect(wrapper.find('.comment-form__rss-dropdown__link').at(2).prop('href')).toEqual( + createSubscribeUrl('reply', '&user=user-1') ); }); }); From aa048a0db9b637f1d81a9065bfa0ea435aee16aa Mon Sep 17 00:00:00 2001 From: Ksinia Date: Mon, 9 Nov 2020 12:21:08 +0100 Subject: [PATCH 11/16] Apply suggestions from code review Co-authored-by: Pavel Mineev --- .../comment-form__subscribe-by-rss.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx index f1658e74..c23c852e 100644 --- a/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx +++ b/frontend/app/components/comment-form/__subscribe-by-rss/comment-form__subscribe-by-rss.test.tsx @@ -31,8 +31,8 @@ describe('', () => { expect(wrapper.find('.comment-form__rss-dropdown__link')).toHaveLength(3); }); - it('should have userId in Replies link', () => { - expect(wrapper.find('.comment-form__rss-dropdown__link').at(2).prop('href')).toEqual( + it('should have userId in replies link', () => { + expect(wrapper.find('.comment-form__rss-dropdown__link').at(2).prop('href')).toBe( createSubscribeUrl('reply', '&user=user-1') ); }); From 2a48cc96826e08fe29cef0df44f1a3bbd0653f9e Mon Sep 17 00:00:00 2001 From: sattellite Date: Mon, 2 Nov 2020 08:57:00 +0300 Subject: [PATCH 12/16] use REMARK_URL in frontend templates --- frontend/comments.ejs | 2 +- frontend/counter.ejs | 2 +- frontend/index.ejs | 2 +- frontend/last-comments.ejs | 2 +- frontend/webpack.config.js | 12 ++++++++++++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/comments.ejs b/frontend/comments.ejs index caba10fc..fc713cd4 100644 --- a/frontend/comments.ejs +++ b/frontend/comments.ejs @@ -68,7 +68,7 @@ var remark_config = { site_id: query.site_id, - host: window.location.origin, + host: '<%= REMARK_URL %>' || window.location.origin, url: query.url }; diff --git a/frontend/counter.ejs b/frontend/counter.ejs index b0f63920..8e51ca10 100644 --- a/frontend/counter.ejs +++ b/frontend/counter.ejs @@ -39,7 +39,7 @@