From 0de11d26a60a18f600a056c04c50807067aec9f7 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 30 Jan 2024 22:20:55 -0600 Subject: [PATCH] Add trans --- judge/authentication.py | 1 + judge/custom_translations.py | 21 +++++++++++++++++ locale/vi/LC_MESSAGES/django.po | 42 +++++++++++++++++++++++++++------ resources/comments.scss | 13 ++++++++++ 4 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 judge/custom_translations.py diff --git a/judge/authentication.py b/judge/authentication.py index 59ac89b..c7ae7d6 100644 --- a/judge/authentication.py +++ b/judge/authentication.py @@ -3,6 +3,7 @@ from django.contrib.auth.models import User from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.views import PasswordChangeView from django.urls import reverse_lazy +from django.utils.translation import gettext_lazy as _ class CustomModelBackend(ModelBackend): diff --git a/judge/custom_translations.py b/judge/custom_translations.py new file mode 100644 index 0000000..f4bd381 --- /dev/null +++ b/judge/custom_translations.py @@ -0,0 +1,21 @@ +from django.utils.translation import gettext_lazy as _, ngettext + + +def custom_trans(): + return [ + # Password reset + ngettext( + "This password is too short. It must contain at least %(min_length)d character.", + "This password is too short. It must contain at least %(min_length)d characters.", + 0, + ), + ngettext( + "Your password must contain at least %(min_length)d character.", + "Your password must contain at least %(min_length)d characters.", + 0, + ), + _("The two password fields didn’t match."), + _("Your password can’t be entirely numeric."), + # Navbar + _("Bug Report"), + ] diff --git a/locale/vi/LC_MESSAGES/django.po b/locale/vi/LC_MESSAGES/django.po index b938cc8..66127cf 100644 --- a/locale/vi/LC_MESSAGES/django.po +++ b/locale/vi/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: lqdoj2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-31 08:04+0700\n" +"POT-Creation-Date: 2024-01-31 11:20+0700\n" "PO-Revision-Date: 2021-07-20 03:44\n" "Last-Translator: Icyene\n" "Language-Team: Vietnamese\n" @@ -67,27 +67,27 @@ msgstr "Tiếng Việt" msgid "English" msgstr "" -#: dmoj/urls.py:105 +#: dmoj/urls.py:106 msgid "Activation key invalid" msgstr "Mã kích hoạt không hợp lệ" -#: dmoj/urls.py:110 +#: dmoj/urls.py:111 msgid "Register" msgstr "Đăng ký" -#: dmoj/urls.py:117 +#: dmoj/urls.py:118 msgid "Registration Completed" msgstr "Đăng ký hoàn thành" -#: dmoj/urls.py:125 +#: dmoj/urls.py:126 msgid "Registration not allowed" msgstr "Đăng ký không thành công" -#: dmoj/urls.py:133 +#: dmoj/urls.py:134 msgid "Login" msgstr "Đăng nhập" -#: dmoj/urls.py:221 templates/base.html:114 +#: dmoj/urls.py:220 templates/base.html:114 #: templates/organization/org-left-sidebar.html:2 msgid "Home" msgstr "Trang chủ" @@ -510,6 +510,34 @@ msgstr "IOI mới" msgid "Ultimate" msgstr "" +#: judge/custom_translations.py:7 +#, python-format +msgid "" +"This password is too short. It must contain at least %(min_length)d " +"character." +msgid_plural "" +"This password is too short. It must contain at least %(min_length)d " +"characters." +msgstr[0] "Mật khẩu phải chứa ít nhất %(min_length)d ký tự." + +#: judge/custom_translations.py:12 +#, python-format +msgid "Your password must contain at least %(min_length)d character." +msgid_plural "Your password must contain at least %(min_length)d characters." +msgstr[0] "Mật khẩu phải chứa ít nhất %(min_length)d ký tự." + +#: judge/custom_translations.py:16 +msgid "The two password fields didn’t match." +msgstr "Mật khẩu xác nhận không khớp." + +#: judge/custom_translations.py:17 +msgid "Your password can’t be entirely numeric." +msgstr "Mật khẩu không được toàn chữ số." + +#: judge/custom_translations.py:19 +msgid "Bug Report" +msgstr "Báo cáo lỗi" + #: judge/forms.py:113 msgid "File size exceeds the maximum allowed limit of 5MB." msgstr "File tải lên không được quá 5MB." diff --git a/resources/comments.scss b/resources/comments.scss index dd2fe50..446f132 100644 --- a/resources/comments.scss +++ b/resources/comments.scss @@ -312,6 +312,19 @@ a { margin-left: -20px; } +.pagedown-image-upload { + .submit-input { + display: flex; + min-width: inherit; + float: right; + } + .deletelink-box { + position: absolute; + top: 2px; + right: 1em; + } +} + @media (max-width: 799px) { .hide_texts_on_mobile .actionbar-text { display: none;