diff --git a/accounts/admin.py b/accounts/admin.py index 6f27f23..32e483c 100644 --- a/accounts/admin.py +++ b/accounts/admin.py @@ -1,6 +1,5 @@ from django import forms from django.contrib.auth.admin import UserAdmin -from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.contrib.auth.forms import UserChangeForm from django.contrib.auth.forms import UsernameField from django.utils.translation import gettext_lazy as _ @@ -36,16 +35,6 @@ class BlogUserCreationForm(forms.ModelForm): class BlogUserChangeForm(UserChangeForm): - password = ReadOnlyPasswordHashField( - label=_("Password"), - help_text=_( - "Raw passwords are not stored, so there is no way to see this " - "user's password, but you can change the password using " - "this form." - ), - ) - email = forms.EmailField(label="Email", widget=forms.EmailInput) - class Meta: model = BlogUser fields = '__all__' diff --git a/accounts/utils.py b/accounts/utils.py index b3348ee..4b94bdf 100644 --- a/accounts/utils.py +++ b/accounts/utils.py @@ -2,8 +2,8 @@ import typing from datetime import timedelta from django.core.cache import cache -from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext +from django.utils.translation import gettext_lazy as _ from djangoblog.utils import send_email @@ -18,7 +18,8 @@ def send_verify_email(to_mail: str, code: str, subject: str = _("Verify Email")) code: 验证码 """ html_content = _( - f"You are resetting the password, the verification code is:{code}, valid within 5 minutes, please keep it properly") + "You are resetting the password, the verification code is:%(code)s, valid within 5 minutes, please keep it " + "properly") % {'code': code} send_email([to_mail], subject, html_content) diff --git a/blog/models.py b/blog/models.py index 8432ca7..17f2fb8 100644 --- a/blog/models.py +++ b/blog/models.py @@ -349,7 +349,7 @@ class BlogSettings(models.Model): '评论是否需要审核', default=False, null=False) class Meta: - verbose_name = '网站配置' + verbose_name = _('Website configuration') verbose_name_plural = verbose_name def __str__(self): @@ -357,7 +357,7 @@ class BlogSettings(models.Model): def clean(self): if BlogSettings.objects.exclude(id=self.id).count(): - raise ValidationError(_('只能有一个配置')) + raise ValidationError(_('There can only be one configuration')) def save(self, *args, **kwargs): super().save(*args, **kwargs) diff --git a/blog/urls.py b/blog/urls.py index baec47e..adf2703 100644 --- a/blog/urls.py +++ b/blog/urls.py @@ -55,4 +55,8 @@ urlpatterns = [ r'upload', views.fileupload, name='upload'), + path( + r'clean', + views.clean_cache_view, + name='clean'), ] diff --git a/blog/views.py b/blog/views.py index 1128d2c..4af9242 100644 --- a/blog/views.py +++ b/blog/views.py @@ -94,11 +94,6 @@ class IndexView(ArticleListView): # 友情链接类型 link_type = LinkShowType.I - def dispatch(self, request, *args, **kwargs): - from django.utils.translation import get_language - print(get_language()) - return super(IndexView, self).dispatch(request, *args, **kwargs) - def get_queryset_data(self): article_list = Article.objects.filter(type='a', status='p') return article_list @@ -373,3 +368,8 @@ def permission_denied_view( request, template_name, { 'message': _('Sorry, you do not have permission to access this page?'), 'statuscode': '403'}, status=403) + + +def clean_cache_view(request): + cache.clear() + return HttpResponse('ok') diff --git a/comments/utils.py b/comments/utils.py index 1a12ddf..f01dba7 100644 --- a/comments/utils.py +++ b/comments/utils.py @@ -12,26 +12,26 @@ def send_comment_email(comment): site = get_current_site().domain subject = _('Thanks for your comment') article_url = f"https://{site}{comment.article.get_absolute_url()}" - html_content = _(f""" -

Thank you very much for your comments on this site

- You can visit - {comment.article.title} + html_content = _("""

Thank you very much for your comments on this site

+ You can visit %(article_title)s to review your comments, Thank you again!
If the link above cannot be opened, please copy this link to your browser. - {article_url} - """) + %(article_url)s""") % {'article_url': article_url, 'article_title': comment.article.title} tomail = comment.author.email send_email([tomail], subject, html_content) try: if comment.parent_comment: - html_content = _(f""" - Your comment on {comment.article.title}
{comment.parent_comment.body}
has received a reply. go check it out + html_content = _("""Your comment on %(article_title)s
has + received a reply.
%(comment_body)s +
+ go check it out!
If the link above cannot be opened, please copy this link to your browser. - {article_url} - """) + %(article_url)s + """) % {'article_url': article_url, 'article_title': comment.article.title, + 'comment_body': comment.parent_comment.body} tomail = comment.parent_comment.author.email send_email([tomail], subject, html_content) except Exception as e: diff --git a/djangoblog/logentryadmin.py b/djangoblog/logentryadmin.py index 9623324..2f6a535 100644 --- a/djangoblog/logentryadmin.py +++ b/djangoblog/logentryadmin.py @@ -1,45 +1,14 @@ from django.contrib import admin -from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION +from django.contrib.admin.models import DELETION from django.contrib.contenttypes.models import ContentType from django.urls import reverse, NoReverseMatch from django.utils.encoding import force_str from django.utils.html import escape from django.utils.safestring import mark_safe -from django.utils.translation import pgettext_lazy, gettext_lazy as _ - -action_names = { - ADDITION: pgettext_lazy('logentry_admin:action_type', 'Addition'), - DELETION: pgettext_lazy('logentry_admin:action_type', 'Deletion'), - CHANGE: pgettext_lazy('logentry_admin:action_type', 'Change'), -} +from django.utils.translation import gettext_lazy as _ class LogEntryAdmin(admin.ModelAdmin): - date_hierarchy = 'action_time' - - readonly_fields = ([f.name for f in LogEntry._meta.fields] + - ['object_link', 'action_description', 'user_link', - 'get_change_message']) - - fieldsets = ( - (_('Metadata'), { - 'fields': ( - 'action_time', - 'user_link', - 'action_description', - 'object_link', - ) - }), - (_('Details'), { - 'fields': ( - 'get_change_message', - 'content_type', - 'object_id', - 'object_repr', - ) - }), - ) - list_filter = [ 'content_type' ] @@ -58,7 +27,6 @@ class LogEntryAdmin(admin.ModelAdmin): 'user_link', 'content_type', 'object_link', - 'action_description', 'get_change_message', ] @@ -67,9 +35,9 @@ class LogEntryAdmin(admin.ModelAdmin): def has_change_permission(self, request, obj=None): return ( - request.user.is_superuser or - request.user.has_perm('admin.change_logentry') - ) and request.method != 'POST' + request.user.is_superuser or + request.user.has_perm('admin.change_logentry') + ) and request.method != 'POST' def has_delete_permission(self, request, obj=None): return False @@ -121,13 +89,3 @@ class LogEntryAdmin(admin.ModelAdmin): if 'delete_selected' in actions: del actions['delete_selected'] return actions - - def action_description(self, obj): - return action_names[obj.action_flag] - - action_description.short_description = _('action') - - def get_change_message(self, obj): - return obj.get_change_message() - - get_change_message.short_description = _('change message') diff --git a/djangoblog/settings.py b/djangoblog/settings.py index be71040..54b00be 100644 --- a/djangoblog/settings.py +++ b/djangoblog/settings.py @@ -192,13 +192,13 @@ PAGINATE_BY = 10 # http cache timeout CACHE_CONTROL_MAX_AGE = 2592000 # cache setting -# CACHES = { -# 'default': { -# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', -# 'TIMEOUT': 10800, -# 'LOCATION': 'unique-snowflake', -# } -# } +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'TIMEOUT': 10800, + 'LOCATION': 'unique-snowflake', + } +} # 使用redis作为缓存 if os.environ.get("DJANGO_REDIS_URL"): CACHES = { diff --git a/djangoblog/urls.py b/djangoblog/urls.py index fc4a6ce..4aae58a 100644 --- a/djangoblog/urls.py +++ b/djangoblog/urls.py @@ -58,7 +58,7 @@ urlpatterns += i18n_patterns( name='search'), re_path(r'', include('servermanager.urls', namespace='servermanager')), re_path(r'', include('owntracks.urls', namespace='owntracks')) - , prefix_default_language=True) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + , prefix_default_language=False) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index fb302b8..c80b30a 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-07 23:54+0800\n" +"POT-Creation-Date: 2023-09-13 16:02+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,45 +18,29 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: .\accounts\admin.py:13 +#: .\accounts\admin.py:12 msgid "password" msgstr "password" -#: .\accounts\admin.py:14 +#: .\accounts\admin.py:13 msgid "Enter password again" msgstr "Enter password again" -#: .\accounts\admin.py:25 .\accounts\forms.py:89 +#: .\accounts\admin.py:24 .\accounts\forms.py:89 msgid "passwords do not match" msgstr "passwords do not match" -#: .\accounts\admin.py:40 -msgid "Password" -msgstr "Password" - -#: .\accounts\admin.py:42 -msgid "" -"Raw passwords are not stored, so there is no way to see this user's " -"password, but you can change the password using this form." -msgstr "" -"Raw passwords are not stored, so there is no way to see this user's " -"password, but you can change the password using this form." - #: .\accounts\forms.py:36 msgid "email already exists" msgstr "email already exists" #: .\accounts\forms.py:46 .\accounts\forms.py:50 -#, fuzzy -#| msgid "forget the password" msgid "New password" msgstr "New password" #: .\accounts\forms.py:60 -#, fuzzy -#| msgid "forget the password" msgid "Confirm password" -msgstr "Confirm the password" +msgstr "Confirm password" #: .\accounts\forms.py:70 .\accounts\forms.py:116 msgid "Email" @@ -70,7 +54,7 @@ msgstr "Code" msgid "email does not exist" msgstr "email does not exist" -#: .\accounts\models.py:12 +#: .\accounts\models.py:12 .\oauth\models.py:17 msgid "nick name" msgstr "nick name" @@ -89,31 +73,29 @@ msgstr "last modify time" msgid "create source" msgstr "create source" -#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:113 +#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:81 msgid "user" msgstr "user" -#: .\accounts\tests.py:216 .\accounts\utils.py:38 -#, fuzzy -#| msgid "get verification code" +#: .\accounts\tests.py:216 .\accounts\utils.py:39 msgid "Verification code error" -msgstr "get verification code" +msgstr "Verification code error" #: .\accounts\utils.py:13 msgid "Verify Email" msgstr "Verify Email" #: .\accounts\utils.py:21 -#, python-brace-format +#, python-format msgid "" -"You are resetting the password, the verification code is:{code}, valid " +"You are resetting the password, the verification code is:%(code)s, valid " "within 5 minutes, please keep it properly" msgstr "" -"You are resetting the password, the verification code is:{code}, valid " +"You are resetting the password, the verification code is:%(code)s, valid " "within 5 minutes, please keep it properly" #: .\blog\admin.py:13 .\blog\models.py:92 .\comments\models.py:17 -#: .\oauth\models.py:12 .\templates\blog\tags\article_meta_info.html:33 +#: .\oauth\models.py:12 msgid "author" msgstr "author" @@ -134,12 +116,11 @@ msgid "Open article comments" msgstr "Open article comments" #: .\blog\admin.py:89 .\blog\models.py:101 .\blog\models.py:183 -#: .\templates\blog\tags\article_meta_info.html:17 #: .\templates\blog\tags\sidebar.html:40 msgid "category" msgstr "category" -#: .\blog\models.py:20 .\blog\models.py:179 +#: .\blog\models.py:20 .\blog\models.py:179 .\templates\share_layout\nav.html:8 msgid "index" msgstr "index" @@ -224,7 +205,6 @@ msgid "show toc" msgstr "show toc" #: .\blog\models.py:105 .\blog\models.py:249 -#: .\templates\blog\tags\article_meta_info.html:22 msgid "tag" msgstr "tag" @@ -278,253 +258,270 @@ msgstr "site name" #: .\blog\models.py:305 msgid "site description" -msgstr "" +msgstr "site description" #: .\blog\models.py:311 msgid "site seo description" -msgstr "" +msgstr "site seo description" #: .\blog\models.py:313 msgid "site keywords" -msgstr "" +msgstr "site keywords" #: .\blog\models.py:318 msgid "article sub length" -msgstr "" +msgstr "article sub length" #: .\blog\models.py:319 msgid "sidebar article count" -msgstr "" +msgstr "sidebar article count" #: .\blog\models.py:320 msgid "sidebar comment count" -msgstr "" +msgstr "sidebar comment count" #: .\blog\models.py:321 msgid "article comment count" -msgstr "" +msgstr "article comment count" #: .\blog\models.py:322 msgid "show adsense" -msgstr "" +msgstr "show adsense" #: .\blog\models.py:324 msgid "adsense code" -msgstr "" +msgstr "adsense code" #: .\blog\models.py:325 msgid "open site comment" -msgstr "" +msgstr "open site comment" + +#: .\blog\models.py:352 +msgid "Website configuration" +msgstr "Website configuration" #: .\blog\models.py:360 -msgid "只能有一个配置" -msgstr "" +msgid "There can only be one configuration" +msgstr "There can only be one configuration" -#: .\blog\views.py:349 +#: .\blog\views.py:348 msgid "" "Sorry, the page you requested is not found, please click the home page to " "see other?" msgstr "" +"Sorry, the page you requested is not found, please click the home page to " +"see other?" -#: .\blog\views.py:357 +#: .\blog\views.py:356 msgid "Sorry, the server is busy, please click the home page to see other?" -msgstr "" +msgstr "Sorry, the server is busy, please click the home page to see other?" -#: .\blog\views.py:370 +#: .\blog\views.py:369 msgid "Sorry, you do not have permission to access this page?" -msgstr "" +msgstr "Sorry, you do not have permission to access this page?" #: .\comments\admin.py:15 msgid "Disable comments" -msgstr "" +msgstr "Disable comments" #: .\comments\admin.py:16 msgid "Enable comments" -msgstr "" +msgstr "Enable comments" #: .\comments\admin.py:46 msgid "User" -msgstr "" +msgstr "User" #: .\comments\models.py:25 msgid "parent comment" -msgstr "" +msgstr "parent comment" #: .\comments\models.py:29 msgid "enable" -msgstr "" +msgstr "enable" #: .\comments\models.py:34 .\templates\blog\tags\article_info.html:30 msgid "comment" -msgstr "" +msgstr "comment" #: .\comments\utils.py:13 msgid "Thanks for your comment" -msgstr "" +msgstr "Thanks for your comment" #: .\comments\utils.py:15 -#, python-brace-format +#, python-format msgid "" -"\n" -"

Thank you very much for your comments on this site\n" -" You can visit\n" -" {comment." -"article.title}\n" +"

Thank you very much for your comments on this site

\n" +" You can visit %(article_title)s\n" " to review your comments,\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" -" " +" %(article_url)s" msgstr "" +"

Thank you very much for your comments on this site

\n" +" You can visit %(article_title)s\n" +" to review your comments,\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this " +"link to your browser.\n" +" %(article_url)s" -#: .\comments\utils.py:29 -#, python-brace-format +#: .\comments\utils.py:26 +#, python-format msgid "" -"\n" -" Your comment on {comment.article.title}
{comment.parent_comment.body}
has " -"received a reply. go check it out\n" +"Your comment on " +"%(article_title)s
has \n" +" received a reply.
%(comment_body)s\n" +"
\n" +" go check it out!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" +" %(article_url)s\n" " " msgstr "" +"Your comment on " +"%(article_title)s
has \n" +" received a reply.
%(comment_body)s\n" +"
\n" +" go check it out!\n" +"
\n" +" If the link above cannot be opened, please copy this " +"link to your browser.\n" +" %(article_url)s\n" +" " -#: .\djangoblog\logentryadmin.py:11 -msgctxt "logentry_admin:action_type" -msgid "Addition" -msgstr "" - -#: .\djangoblog\logentryadmin.py:12 -msgctxt "logentry_admin:action_type" -msgid "Deletion" -msgstr "" - -#: .\djangoblog\logentryadmin.py:13 -msgctxt "logentry_admin:action_type" -msgid "Change" -msgstr "" - -#: .\djangoblog\logentryadmin.py:25 -msgid "Metadata" -msgstr "" - -#: .\djangoblog\logentryadmin.py:33 -msgid "Details" -msgstr "" - -#: .\djangoblog\logentryadmin.py:95 +#: .\djangoblog\logentryadmin.py:63 msgid "object" -msgstr "" - -#: .\djangoblog\logentryadmin.py:128 -msgid "action" -msgstr "" - -#: .\djangoblog\logentryadmin.py:133 -msgid "change message" -msgstr "" +msgstr "object" #: .\djangoblog\settings.py:140 msgid "English" -msgstr "" +msgstr "English" #: .\djangoblog\settings.py:141 msgid "Simplified Chinese" -msgstr "" +msgstr "Simplified Chinese" #: .\djangoblog\settings.py:142 msgid "Traditional Chinese" -msgstr "" - -#: .\oauth\models.py:17 -msgid "nickname" -msgstr "" +msgstr "Traditional Chinese" #: .\oauth\models.py:30 msgid "oauth user" -msgstr "" +msgstr "oauth user" #: .\oauth\models.py:37 msgid "weibo" -msgstr "" +msgstr "weibo" #: .\oauth\models.py:38 msgid "google" -msgstr "" +msgstr "google" #: .\oauth\models.py:48 msgid "callback url" -msgstr "" +msgstr "callback url" #: .\oauth\models.py:59 msgid "already exists" -msgstr "" +msgstr "already exists" #: .\oauth\views.py:154 +#, python-format msgid "" "\n" "

Congratulations, you have successfully bound your email address. You " -"can use {oauthuser.type} to directly log in to this website without a " -"password. You are welcome to continue to follow this site, the address is\n" -"\n" -" {'http://' " -"+ site}\n" -"\n" -" Thank you again!\n" -"
\n" -" If the link above cannot be opened, please copy this link " -"to your browser.\n" -" {site}\n" +"can use\n" +" %(oauthuser_type)s to directly log in to this website without a " +"password.

\n" +" You are welcome to continue to follow this site, the address is\n" +" %(site)s\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this link to your " +"browser.\n" +" %(site)s\n" " " msgstr "" +"\n" +"

Congratulations, you have successfully bound your email address. You " +"can use\n" +" %(oauthuser_type)s to directly log in to this website without a " +"password.

\n" +" You are welcome to continue to follow this site, the address is\n" +" %(site)s\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this link to your " +"browser.\n" +" %(site)s\n" +" " #: .\oauth\views.py:165 msgid "Congratulations on your successful binding!" -msgstr "" +msgstr "Congratulations on your successful binding!" #: .\oauth\views.py:217 -#, python-brace-format +#, python-format msgid "" "\n" "

Please click the link below to bind your email

\n" "\n" -" {url}\n" +" %(url)s\n" "\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this link " "to your browser.\n" -" {url}\n" +"
\n" +" %(url)s\n" " " msgstr "" +"\n" +"

Please click the link below to bind your email

\n" +"\n" +" %(url)s\n" +"\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this link " +"to your browser.\n" +"
\n" +" %(url)s\n" +" " -#: .\oauth\views.py:227 .\oauth\views.py:239 +#: .\oauth\views.py:228 .\oauth\views.py:240 msgid "Bind your email" -msgstr "" +msgstr "Bind your email" -#: .\oauth\views.py:241 +#: .\oauth\views.py:242 msgid "" "Congratulations, the binding is just one step away. Please log in to your " "email to check the email to complete the binding. Thank you." msgstr "" +"Congratulations, the binding is just one step away. Please log in to your " +"email to check the email to complete the binding. Thank you." -#: .\oauth\views.py:243 +#: .\oauth\views.py:245 msgid "Binding successful" -msgstr "" +msgstr "Binding successful" -#: .\oauth\views.py:245 -#, python-brace-format +#: .\oauth\views.py:247 +#, python-format msgid "" "Congratulations, you have successfully bound your email address. You can use " -"{oauthuser.type} to directly log in to this website without a password. You " -"are welcome to continue to follow this site." +"%(oauthuser_type)s to directly log in to this website without a password. " +"You are welcome to continue to follow this site." msgstr "" +"Congratulations, you have successfully bound your email address. You can use " +"%(oauthuser_type)s to directly log in to this website without a password. " +"You are welcome to continue to follow this site." #: .\templates\account\forget_password.html:7 msgid "forget the password" @@ -538,46 +535,62 @@ msgstr "get verification code" msgid "submit" msgstr "submit" +#: .\templates\account\login.html:36 +msgid "Create Account" +msgstr "Create Account" + +#: .\templates\account\login.html:42 +#, fuzzy +#| msgid "forget the password" +msgid "Forget Password" +msgstr "forget the password" + #: .\templates\account\result.html:18 .\templates\blog\tags\sidebar.html:126 msgid "login" -msgstr "" +msgstr "login" #: .\templates\account\result.html:22 msgid "back to the homepage" -msgstr "" +msgstr "back to the homepage" #: .\templates\blog\article_archives.html:7 #: .\templates\blog\article_archives.html:24 msgid "article archive" -msgstr "" +msgstr "article archive" #: .\templates\blog\article_archives.html:32 msgid "year" -msgstr "" +msgstr "year" #: .\templates\blog\article_archives.html:36 msgid "month" -msgstr "" +msgstr "month" #: .\templates\blog\tags\article_info.html:12 msgid "pin to top" -msgstr "" +msgstr "pin to top" #: .\templates\blog\tags\article_info.html:28 msgid "comments" -msgstr "" +msgstr "comments" #: .\templates\blog\tags\article_info.html:58 msgid "toc" -msgstr "" +msgstr "toc" -#: .\templates\blog\tags\article_meta_info.html:7 -#, fuzzy -#| msgid "Published" -msgid "Published on" -msgstr "Published" +#: .\templates\blog\tags\article_meta_info.html:6 +msgid "posted in" +msgstr "posted in" + +#: .\templates\blog\tags\article_meta_info.html:14 +msgid "and tagged" +msgstr "and tagged" -#: .\templates\blog\tags\article_meta_info.html:36 +#: .\templates\blog\tags\article_meta_info.html:25 +msgid "by " +msgstr "by" + +#: .\templates\blog\tags\article_meta_info.html:29 #, python-format msgid "" "\n" @@ -589,21 +602,26 @@ msgstr "" " title=\"View all articles published by " "%(article.author.username)s\"\n" " " -#: .\templates\blog\tags\article_meta_info.html:50 + +#: .\templates\blog\tags\article_meta_info.html:44 +msgid "on" +msgstr "on" + +#: .\templates\blog\tags\article_meta_info.html:54 msgid "edit" msgstr "edit" #: .\templates\blog\tags\article_pagination.html:4 msgid "article navigation" -msgstr "" +msgstr "article navigation" #: .\templates\blog\tags\article_pagination.html:9 msgid "earlier articles" -msgstr "" +msgstr "earlier articles" #: .\templates\blog\tags\article_pagination.html:12 msgid "newer articles" -msgstr "" +msgstr "newer articles" #: .\templates\blog\tags\article_tag_list.html:5 msgid "tags" @@ -611,57 +629,57 @@ msgstr "tags" #: .\templates\blog\tags\sidebar.html:7 msgid "search" -msgstr "" +msgstr "search" #: .\templates\blog\tags\sidebar.html:50 msgid "recent comments" -msgstr "" +msgstr "recent comments" #: .\templates\blog\tags\sidebar.html:57 -msgid "published in" -msgstr "" +msgid "published on" +msgstr "published on" #: .\templates\blog\tags\sidebar.html:65 msgid "recent articles" -msgstr "" +msgstr "recent articles" #: .\templates\blog\tags\sidebar.html:77 msgid "bookmark" -msgstr "" +msgstr "bookmark" #: .\templates\blog\tags\sidebar.html:96 msgid "Tag Cloud" -msgstr "" +msgstr "Tag Cloud" #: .\templates\blog\tags\sidebar.html:107 msgid "Welcome to star or fork the source code of this site" -msgstr "" +msgstr "Welcome to star or fork the source code of this site" #: .\templates\blog\tags\sidebar.html:118 msgid "Function" -msgstr "" +msgstr "Function" #: .\templates\blog\tags\sidebar.html:120 msgid "management site" -msgstr "" +msgstr "management site" #: .\templates\blog\tags\sidebar.html:122 msgid "logout" -msgstr "" +msgstr "logout" #: .\templates\blog\tags\sidebar.html:129 msgid "Track record" -msgstr "" +msgstr "Track record" #: .\templates\blog\tags\sidebar.html:135 msgid "Click me to return to the top" -msgstr "" - -#~ msgid "This entry was published on" -#~ msgstr "This entry was published on" +msgstr "Click me to return to the top" -#~ msgid "belongs" -#~ msgstr "belongs" +#: .\templates\oauth\oauth_applications.html:5 +#| msgid "login" +msgid "quick login" +msgstr "quick login" -#~ msgid "been" -#~ msgstr "been" +#: .\templates\share_layout\nav.html:26 +msgid "Article archive" +msgstr "Article archive" diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po index b1a531d..003d5b9 100644 --- a/locale/zh_Hans/LC_MESSAGES/django.po +++ b/locale/zh_Hans/LC_MESSAGES/django.po @@ -3,12 +3,11 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-07 23:54+0800\n" +"POT-Creation-Date: 2023-09-13 16:02+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,43 +17,27 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: .\accounts\admin.py:13 +#: .\accounts\admin.py:12 msgid "password" msgstr "密码" -#: .\accounts\admin.py:14 +#: .\accounts\admin.py:13 msgid "Enter password again" msgstr "再次输入密码" -#: .\accounts\admin.py:25 .\accounts\forms.py:89 +#: .\accounts\admin.py:24 .\accounts\forms.py:89 msgid "passwords do not match" msgstr "密码不匹配" -#: .\accounts\admin.py:40 -msgid "Password" -msgstr "密码" - -#: .\accounts\admin.py:42 -msgid "" -"Raw passwords are not stored, so there is no way to see this user's " -"password, but you can change the password using this form." -msgstr "" -"未存储原始密码,因此无法看到此用户的密码,但您可以使用”更改密码此表单。" - #: .\accounts\forms.py:36 msgid "email already exists" msgstr "邮箱已存在" #: .\accounts\forms.py:46 .\accounts\forms.py:50 -#, fuzzy -#| msgid "forget the password" msgid "New password" msgstr "新密码" #: .\accounts\forms.py:60 -#, fuzzy -#| msgid "forget the password" msgid "Confirm password" msgstr "确认密码" @@ -70,7 +53,7 @@ msgstr "验证码" msgid "email does not exist" msgstr "邮箱不存在" -#: .\accounts\models.py:12 +#: .\accounts\models.py:12 .\oauth\models.py:17 msgid "nick name" msgstr "昵称" @@ -89,13 +72,11 @@ msgstr "最后修改时间" msgid "create source" msgstr "来源" -#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:113 +#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:81 msgid "user" msgstr "用户" -#: .\accounts\tests.py:216 .\accounts\utils.py:38 -#, fuzzy -#| msgid "get verification code" +#: .\accounts\tests.py:216 .\accounts\utils.py:39 msgid "Verification code error" msgstr "验证码错误" @@ -104,14 +85,14 @@ msgid "Verify Email" msgstr "验证邮箱" #: .\accounts\utils.py:21 -#, python-brace-format +#, python-format msgid "" -"You are resetting the password, the verification code is:{code}, valid " +"You are resetting the password, the verification code is:%(code)s, valid " "within 5 minutes, please keep it properly" -msgstr "您正在重置密码,验证码为:{code},5分钟内有效 请妥善保管" +msgstr "您正在重置密码,验证码为:%(code)s,5分钟内有效 请妥善保管." #: .\blog\admin.py:13 .\blog\models.py:92 .\comments\models.py:17 -#: .\oauth\models.py:12 .\templates\blog\tags\article_meta_info.html:33 +#: .\oauth\models.py:12 msgid "author" msgstr "作者" @@ -132,12 +113,11 @@ msgid "Open article comments" msgstr "打开文章评论" #: .\blog\admin.py:89 .\blog\models.py:101 .\blog\models.py:183 -#: .\templates\blog\tags\article_meta_info.html:17 #: .\templates\blog\tags\sidebar.html:40 msgid "category" msgstr "分类目录" -#: .\blog\models.py:20 .\blog\models.py:179 +#: .\blog\models.py:20 .\blog\models.py:179 .\templates\share_layout\nav.html:8 msgid "index" msgstr "首页" @@ -222,7 +202,6 @@ msgid "show toc" msgstr "显示目录" #: .\blog\models.py:105 .\blog\models.py:249 -#: .\templates\blog\tags\article_meta_info.html:22 msgid "tag" msgstr "标签" @@ -314,215 +293,219 @@ msgstr "广告内容" msgid "open site comment" msgstr "公共头部" +#: .\blog\models.py:352 +msgid "Website configuration" +msgstr "网站配置" + #: .\blog\models.py:360 -msgid "只能有一个配置" -msgstr "" +msgid "There can only be one configuration" +msgstr "只能有一个配置" -#: .\blog\views.py:349 +#: .\blog\views.py:348 msgid "" "Sorry, the page you requested is not found, please click the home page to " "see other?" -msgstr "" +msgstr "抱歉,你所访问的页面找不到,请点击首页看看别的?" -#: .\blog\views.py:357 +#: .\blog\views.py:356 msgid "Sorry, the server is busy, please click the home page to see other?" -msgstr "" +msgstr "抱歉,服务出错了,请点击首页看看别的?" -#: .\blog\views.py:370 +#: .\blog\views.py:369 msgid "Sorry, you do not have permission to access this page?" -msgstr "" +msgstr "抱歉,你没用权限访问此页面。" #: .\comments\admin.py:15 msgid "Disable comments" -msgstr "" +msgstr "禁用评论" #: .\comments\admin.py:16 msgid "Enable comments" -msgstr "" +msgstr "启用评论" #: .\comments\admin.py:46 msgid "User" -msgstr "" +msgstr "用户" #: .\comments\models.py:25 msgid "parent comment" -msgstr "" +msgstr "上级评论" #: .\comments\models.py:29 msgid "enable" -msgstr "" +msgstr "启用" #: .\comments\models.py:34 .\templates\blog\tags\article_info.html:30 msgid "comment" -msgstr "" +msgstr "评论" #: .\comments\utils.py:13 msgid "Thanks for your comment" -msgstr "" +msgstr "感谢你的评论" #: .\comments\utils.py:15 -#, python-brace-format +#, python-format msgid "" -"\n" -"

Thank you very much for your comments on this site\n" -" You can visit\n" -" {comment." -"article.title}\n" +"

Thank you very much for your comments on this site

\n" +" You can visit %(article_title)s\n" " to review your comments,\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" -" " +" %(article_url)s" msgstr "" +"

非常感谢您对此网站的评论

\n" +" 您可以访问%(article_title)s\n" +"查看您的评论,\n" +"再次感谢您!\n" +"
\n" +" 如果上面的链接打不开,请复制此链接链接到您的浏览器。\n" +"%(article_url)s" -#: .\comments\utils.py:29 -#, python-brace-format +#: .\comments\utils.py:26 +#, python-format msgid "" -"\n" -" Your comment on {comment.article.title}
{comment.parent_comment.body}
has " -"received a reply. go check it out\n" +"Your comment on " +"%(article_title)s
has \n" +" received a reply.
%(comment_body)s\n" +"
\n" +" go check it out!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" +" %(article_url)s\n" " " msgstr "" - -#: .\djangoblog\logentryadmin.py:11 -msgctxt "logentry_admin:action_type" -msgid "Addition" -msgstr "" - -#: .\djangoblog\logentryadmin.py:12 -msgctxt "logentry_admin:action_type" -msgid "Deletion" -msgstr "" - -#: .\djangoblog\logentryadmin.py:13 -msgctxt "logentry_admin:action_type" -msgid "Change" -msgstr "" - -#: .\djangoblog\logentryadmin.py:25 -msgid "Metadata" -msgstr "" - -#: .\djangoblog\logentryadmin.py:33 -msgid "Details" -msgstr "" - -#: .\djangoblog\logentryadmin.py:95 +"您对 %(article_title)s
" +"的评论有\n" +" 收到回复。
%(comment_body)s\n" +"
\n" +"快去看看吧!\n" +"
\n" +" 如果上面的链接打不开,请复制此链接链接到您的浏览器。\n" +" %(article_url)s\n" +" " + +#: .\djangoblog\logentryadmin.py:63 msgid "object" -msgstr "" - -#: .\djangoblog\logentryadmin.py:128 -msgid "action" -msgstr "" - -#: .\djangoblog\logentryadmin.py:133 -msgid "change message" -msgstr "" +msgstr "对象" #: .\djangoblog\settings.py:140 msgid "English" -msgstr "" +msgstr "英文" #: .\djangoblog\settings.py:141 msgid "Simplified Chinese" -msgstr "" +msgstr "简体中文" #: .\djangoblog\settings.py:142 msgid "Traditional Chinese" -msgstr "" - -#: .\oauth\models.py:17 -msgid "nickname" -msgstr "" +msgstr "繁体中文" #: .\oauth\models.py:30 msgid "oauth user" -msgstr "" +msgstr "第三方用户" #: .\oauth\models.py:37 msgid "weibo" -msgstr "" +msgstr "微博" #: .\oauth\models.py:38 msgid "google" -msgstr "" +msgstr "谷歌" #: .\oauth\models.py:48 msgid "callback url" -msgstr "" +msgstr "回调地址" #: .\oauth\models.py:59 msgid "already exists" -msgstr "" +msgstr "已经存在" #: .\oauth\views.py:154 +#, python-format msgid "" "\n" "

Congratulations, you have successfully bound your email address. You " -"can use {oauthuser.type} to directly log in to this website without a " -"password. You are welcome to continue to follow this site, the address is\n" -"\n" -" {'http://' " -"+ site}\n" -"\n" -" Thank you again!\n" -"
\n" -" If the link above cannot be opened, please copy this link " -"to your browser.\n" -" {site}\n" +"can use\n" +" %(oauthuser_type)s to directly log in to this website without a " +"password.

\n" +" You are welcome to continue to follow this site, the address is\n" +" %(site)s\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this link to your " +"browser.\n" +" %(site)s\n" " " msgstr "" +"\n" +"

恭喜你已经绑定成功 你可以使用\n" +" %(oauthuser_type)s 来免密登录本站

\n" +" 欢迎继续关注本站, 地址是\n" +" %(site)s\n" +" 再次感谢你\n" +"
\n" +" 如果上面链接无法打开,请复制此链接到你的浏览器 \n" +" %(site)s\n" +" " #: .\oauth\views.py:165 msgid "Congratulations on your successful binding!" -msgstr "" +msgstr "恭喜你绑定成功" #: .\oauth\views.py:217 -#, python-brace-format +#, python-format msgid "" "\n" "

Please click the link below to bind your email

\n" "\n" -" {url}\n" +" %(url)s\n" "\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this link " "to your browser.\n" -" {url}\n" +"
\n" +" %(url)s\n" " " msgstr "" +"\n" +"

请点击下面的链接绑定您的邮箱

\n" +"\n" +" %(url)s\n" +"\n" +"再次感谢您!\n" +"
\n" +"如果上面的链接打不开,请复制此链接到您的浏览器。\n" +"%(url)s\n" +" " -#: .\oauth\views.py:227 .\oauth\views.py:239 +#: .\oauth\views.py:228 .\oauth\views.py:240 msgid "Bind your email" -msgstr "" +msgstr "绑定邮箱" -#: .\oauth\views.py:241 +#: .\oauth\views.py:242 msgid "" "Congratulations, the binding is just one step away. Please log in to your " "email to check the email to complete the binding. Thank you." -msgstr "" +msgstr "恭喜您,还差一步就绑定成功了,请登录您的邮箱查看邮件完成绑定,谢谢。" -#: .\oauth\views.py:243 +#: .\oauth\views.py:245 msgid "Binding successful" -msgstr "" +msgstr "绑定成功" -#: .\oauth\views.py:245 -#, python-brace-format +#: .\oauth\views.py:247 +#, python-format msgid "" "Congratulations, you have successfully bound your email address. You can use " -"{oauthuser.type} to directly log in to this website without a password. You " -"are welcome to continue to follow this site." +"%(oauthuser_type)s to directly log in to this website without a password. " +"You are welcome to continue to follow this site." msgstr "" +"恭喜您绑定成功,您以后可以使用%(oauthuser_type)s来直接免密码登录本站啦,感谢" +"您对本站对关注。" #: .\templates\account\forget_password.html:7 msgid "forget the password" @@ -536,46 +519,61 @@ msgstr "获取验证码" msgid "submit" msgstr "提交" +#: .\templates\account\login.html:36 +msgid "Create Account" +msgstr "创建账号" + +#: .\templates\account\login.html:42 +#| msgid "forget the password" +msgid "Forget Password" +msgstr "忘记密码" + #: .\templates\account\result.html:18 .\templates\blog\tags\sidebar.html:126 msgid "login" -msgstr "" +msgstr "登录" #: .\templates\account\result.html:22 msgid "back to the homepage" -msgstr "" +msgstr "返回首页吧" #: .\templates\blog\article_archives.html:7 #: .\templates\blog\article_archives.html:24 msgid "article archive" -msgstr "" +msgstr "文章归档" #: .\templates\blog\article_archives.html:32 msgid "year" -msgstr "" +msgstr "年" #: .\templates\blog\article_archives.html:36 msgid "month" -msgstr "" +msgstr "月" #: .\templates\blog\tags\article_info.html:12 msgid "pin to top" -msgstr "" +msgstr "置顶" #: .\templates\blog\tags\article_info.html:28 msgid "comments" -msgstr "" +msgstr "评论" #: .\templates\blog\tags\article_info.html:58 msgid "toc" -msgstr "" +msgstr "目录" -#: .\templates\blog\tags\article_meta_info.html:7 -#, fuzzy -#| msgid "Published" -msgid "Published on" -msgstr "发表于" +#: .\templates\blog\tags\article_meta_info.html:6 +msgid "posted in" +msgstr "发布于" + +#: .\templates\blog\tags\article_meta_info.html:14 +msgid "and tagged" +msgstr "标签" -#: .\templates\blog\tags\article_meta_info.html:36 +#: .\templates\blog\tags\article_meta_info.html:25 +msgid "by " +msgstr "由" + +#: .\templates\blog\tags\article_meta_info.html:29 #, python-format msgid "" "\n" @@ -584,24 +582,28 @@ msgid "" " " msgstr "" "\n" -" title=\"查看所有由 " -"%(article.author.username)s\"发布的文章\n" +" title=\"查看所有由 %(article.author.username)s\"发布的文章\n" " " -#: .\templates\blog\tags\article_meta_info.html:50 + +#: .\templates\blog\tags\article_meta_info.html:44 +msgid "on" +msgstr "在" + +#: .\templates\blog\tags\article_meta_info.html:54 msgid "edit" msgstr "编辑" #: .\templates\blog\tags\article_pagination.html:4 msgid "article navigation" -msgstr "" +msgstr "文章导航" #: .\templates\blog\tags\article_pagination.html:9 msgid "earlier articles" -msgstr "" +msgstr "早期文章" #: .\templates\blog\tags\article_pagination.html:12 msgid "newer articles" -msgstr "" +msgstr "较新文章" #: .\templates\blog\tags\article_tag_list.html:5 msgid "tags" @@ -609,57 +611,57 @@ msgstr "标签" #: .\templates\blog\tags\sidebar.html:7 msgid "search" -msgstr "" +msgstr "搜索" #: .\templates\blog\tags\sidebar.html:50 msgid "recent comments" -msgstr "" +msgstr "近期评论" #: .\templates\blog\tags\sidebar.html:57 -msgid "published in" -msgstr "" +msgid "published on" +msgstr "发表于" #: .\templates\blog\tags\sidebar.html:65 msgid "recent articles" -msgstr "" +msgstr "近期文章" #: .\templates\blog\tags\sidebar.html:77 msgid "bookmark" -msgstr "" +msgstr "书签" #: .\templates\blog\tags\sidebar.html:96 msgid "Tag Cloud" -msgstr "" +msgstr "标签云" #: .\templates\blog\tags\sidebar.html:107 msgid "Welcome to star or fork the source code of this site" -msgstr "" +msgstr "欢迎您STAR或者FORK本站源代码" #: .\templates\blog\tags\sidebar.html:118 msgid "Function" -msgstr "" +msgstr "功能" #: .\templates\blog\tags\sidebar.html:120 msgid "management site" -msgstr "" +msgstr "管理站点" #: .\templates\blog\tags\sidebar.html:122 msgid "logout" -msgstr "" +msgstr "登出" #: .\templates\blog\tags\sidebar.html:129 msgid "Track record" -msgstr "" +msgstr "运动轨迹记录" #: .\templates\blog\tags\sidebar.html:135 msgid "Click me to return to the top" -msgstr "" - -#~ msgid "This entry was published on" -#~ msgstr "这篇文章发布在 " +msgstr "点我返回顶部" -#~ msgid "belongs" -#~ msgstr "属于" +#: .\templates\oauth\oauth_applications.html:5 +#| msgid "login" +msgid "quick login" +msgstr "快捷登录" -#~ msgid "been" -#~ msgstr "贴了" +#: .\templates\share_layout\nav.html:26 +msgid "Article archive" +msgstr "文章归档" diff --git a/locale/zh_Hant/LC_MESSAGES/django.po b/locale/zh_Hant/LC_MESSAGES/django.po index 8f8250e..a01b8aa 100644 --- a/locale/zh_Hant/LC_MESSAGES/django.po +++ b/locale/zh_Hant/LC_MESSAGES/django.po @@ -3,12 +3,11 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-07 23:54+0800\n" +"POT-Creation-Date: 2023-09-13 16:02+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,554 +17,564 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: .\accounts\admin.py:13 +#: .\accounts\admin.py:12 msgid "password" -msgstr "" +msgstr "密碼" -#: .\accounts\admin.py:14 +#: .\accounts\admin.py:13 msgid "Enter password again" -msgstr "" +msgstr "再次輸入密碼" -#: .\accounts\admin.py:25 .\accounts\forms.py:89 +#: .\accounts\admin.py:24 .\accounts\forms.py:89 msgid "passwords do not match" -msgstr "" - -#: .\accounts\admin.py:40 -msgid "Password" -msgstr "" - -#: .\accounts\admin.py:42 -msgid "" -"Raw passwords are not stored, so there is no way to see this user's " -"password, but you can change the password using this form." -msgstr "" +msgstr "密碼不匹配" #: .\accounts\forms.py:36 msgid "email already exists" -msgstr "" +msgstr "郵箱已存在" #: .\accounts\forms.py:46 .\accounts\forms.py:50 msgid "New password" -msgstr "" +msgstr "新密碼" #: .\accounts\forms.py:60 msgid "Confirm password" -msgstr "" +msgstr "確認密碼" #: .\accounts\forms.py:70 .\accounts\forms.py:116 msgid "Email" -msgstr "" +msgstr "郵箱" #: .\accounts\forms.py:76 .\accounts\forms.py:80 msgid "Code" -msgstr "" +msgstr "驗證碼" #: .\accounts\forms.py:100 .\accounts\tests.py:194 msgid "email does not exist" -msgstr "" +msgstr "郵箱不存在" -#: .\accounts\models.py:12 +#: .\accounts\models.py:12 .\oauth\models.py:17 msgid "nick name" -msgstr "" +msgstr "昵稱" #: .\accounts\models.py:13 .\blog\models.py:29 .\blog\models.py:266 #: .\blog\models.py:284 .\comments\models.py:13 .\oauth\models.py:23 #: .\oauth\models.py:53 msgid "creation time" -msgstr "" +msgstr "創建時間" #: .\accounts\models.py:14 .\comments\models.py:14 .\oauth\models.py:24 #: .\oauth\models.py:54 msgid "last modify time" -msgstr "" +msgstr "最後修改時間" #: .\accounts\models.py:15 msgid "create source" -msgstr "" +msgstr "來源" -#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:113 +#: .\accounts\models.py:33 .\djangoblog\logentryadmin.py:81 msgid "user" -msgstr "" +msgstr "用戶" -#: .\accounts\tests.py:216 .\accounts\utils.py:38 +#: .\accounts\tests.py:216 .\accounts\utils.py:39 msgid "Verification code error" -msgstr "" +msgstr "驗證碼錯誤" #: .\accounts\utils.py:13 msgid "Verify Email" -msgstr "" +msgstr "驗證郵箱" #: .\accounts\utils.py:21 -#, python-brace-format +#, python-format msgid "" -"You are resetting the password, the verification code is:{code}, valid " +"You are resetting the password, the verification code is:%(code)s, valid " "within 5 minutes, please keep it properly" -msgstr "" +msgstr "您正在重置密碼,驗證碼為:%(code)s,5分鐘內有效 請妥善保管." #: .\blog\admin.py:13 .\blog\models.py:92 .\comments\models.py:17 -#: .\oauth\models.py:12 .\templates\blog\tags\article_meta_info.html:33 +#: .\oauth\models.py:12 msgid "author" -msgstr "" +msgstr "作者" #: .\blog\admin.py:53 msgid "Publish selected articles" -msgstr "" +msgstr "發布選中的文章" #: .\blog\admin.py:54 msgid "Draft selected articles" -msgstr "" +msgstr "選中文章設為草稿" #: .\blog\admin.py:55 msgid "Close article comments" -msgstr "" +msgstr "關閉文章評論" #: .\blog\admin.py:56 msgid "Open article comments" -msgstr "" +msgstr "打開文章評論" #: .\blog\admin.py:89 .\blog\models.py:101 .\blog\models.py:183 -#: .\templates\blog\tags\article_meta_info.html:17 #: .\templates\blog\tags\sidebar.html:40 msgid "category" -msgstr "" +msgstr "分類目錄" -#: .\blog\models.py:20 .\blog\models.py:179 +#: .\blog\models.py:20 .\blog\models.py:179 .\templates\share_layout\nav.html:8 msgid "index" -msgstr "" +msgstr "首頁" #: .\blog\models.py:21 msgid "list" -msgstr "" +msgstr "列表" #: .\blog\models.py:22 msgid "post" -msgstr "" +msgstr "文章" #: .\blog\models.py:23 msgid "all" -msgstr "" +msgstr "所有" #: .\blog\models.py:24 msgid "slide" -msgstr "" +msgstr "側邊欄" #: .\blog\models.py:30 .\blog\models.py:267 .\blog\models.py:285 msgid "modify time" -msgstr "" +msgstr "修改時間" #: .\blog\models.py:63 msgid "Draft" -msgstr "" +msgstr "草稿" #: .\blog\models.py:64 msgid "Published" -msgstr "" +msgstr "發布" #: .\blog\models.py:67 msgid "Open" -msgstr "" +msgstr "打開" #: .\blog\models.py:68 msgid "Close" -msgstr "" +msgstr "關閉" #: .\blog\models.py:71 .\comments\admin.py:47 msgid "Article" -msgstr "" +msgstr "文章" #: .\blog\models.py:72 msgid "Page" -msgstr "" +msgstr "頁面" #: .\blog\models.py:74 .\blog\models.py:280 msgid "title" -msgstr "" +msgstr "標題" #: .\blog\models.py:75 msgid "body" -msgstr "" +msgstr "內容" #: .\blog\models.py:77 msgid "publish time" -msgstr "" +msgstr "發布時間" #: .\blog\models.py:79 msgid "status" -msgstr "" +msgstr "狀態" #: .\blog\models.py:84 msgid "comment status" -msgstr "" +msgstr "評論狀態" #: .\blog\models.py:88 .\oauth\models.py:43 msgid "type" -msgstr "" +msgstr "類型" #: .\blog\models.py:89 msgid "views" -msgstr "" +msgstr "閱讀量" #: .\blog\models.py:97 .\blog\models.py:258 .\blog\models.py:282 msgid "order" -msgstr "" +msgstr "排序" #: .\blog\models.py:98 msgid "show toc" -msgstr "" +msgstr "顯示目錄" #: .\blog\models.py:105 .\blog\models.py:249 -#: .\templates\blog\tags\article_meta_info.html:22 msgid "tag" -msgstr "" +msgstr "標簽" #: .\blog\models.py:115 .\comments\models.py:21 msgid "article" -msgstr "" +msgstr "文章" #: .\blog\models.py:171 msgid "category name" -msgstr "" +msgstr "分類名" #: .\blog\models.py:174 msgid "parent category" -msgstr "" +msgstr "上級分類" #: .\blog\models.py:234 msgid "tag name" -msgstr "" +msgstr "標簽名" #: .\blog\models.py:256 msgid "link name" -msgstr "" +msgstr "鏈接名" #: .\blog\models.py:257 .\blog\models.py:271 msgid "link" -msgstr "" +msgstr "鏈接" #: .\blog\models.py:260 msgid "is show" -msgstr "" +msgstr "是否顯示" #: .\blog\models.py:262 msgid "show type" -msgstr "" +msgstr "顯示類型" #: .\blog\models.py:281 msgid "content" -msgstr "" +msgstr "內容" #: .\blog\models.py:283 .\oauth\models.py:52 msgid "is enable" -msgstr "" +msgstr "是否啟用" #: .\blog\models.py:289 msgid "sidebar" -msgstr "" +msgstr "側邊欄" #: .\blog\models.py:299 msgid "site name" -msgstr "" +msgstr "站點名稱" #: .\blog\models.py:305 msgid "site description" -msgstr "" +msgstr "站點描述" #: .\blog\models.py:311 msgid "site seo description" -msgstr "" +msgstr "站點SEO描述" #: .\blog\models.py:313 msgid "site keywords" -msgstr "" +msgstr "關鍵字" #: .\blog\models.py:318 msgid "article sub length" -msgstr "" +msgstr "文章摘要長度" #: .\blog\models.py:319 msgid "sidebar article count" -msgstr "" +msgstr "側邊欄文章數目" #: .\blog\models.py:320 msgid "sidebar comment count" -msgstr "" +msgstr "側邊欄評論數目" #: .\blog\models.py:321 msgid "article comment count" -msgstr "" +msgstr "文章頁面默認顯示評論數目" #: .\blog\models.py:322 msgid "show adsense" -msgstr "" +msgstr "是否顯示廣告" #: .\blog\models.py:324 msgid "adsense code" -msgstr "" +msgstr "廣告內容" #: .\blog\models.py:325 msgid "open site comment" -msgstr "" +msgstr "公共頭部" + +#: .\blog\models.py:352 +msgid "Website configuration" +msgstr "網站配置" #: .\blog\models.py:360 -msgid "只能有一个配置" -msgstr "" +msgid "There can only be one configuration" +msgstr "只能有一個配置" -#: .\blog\views.py:349 +#: .\blog\views.py:348 msgid "" "Sorry, the page you requested is not found, please click the home page to " "see other?" -msgstr "" +msgstr "抱歉,你所訪問的頁面找不到,請點擊首頁看看別的?" -#: .\blog\views.py:357 +#: .\blog\views.py:356 msgid "Sorry, the server is busy, please click the home page to see other?" -msgstr "" +msgstr "抱歉,服務出錯了,請點擊首頁看看別的?" -#: .\blog\views.py:370 +#: .\blog\views.py:369 msgid "Sorry, you do not have permission to access this page?" -msgstr "" +msgstr "抱歉,你沒用權限訪問此頁面。" #: .\comments\admin.py:15 msgid "Disable comments" -msgstr "" +msgstr "禁用評論" #: .\comments\admin.py:16 msgid "Enable comments" -msgstr "" +msgstr "啟用評論" #: .\comments\admin.py:46 msgid "User" -msgstr "" +msgstr "用戶" #: .\comments\models.py:25 msgid "parent comment" -msgstr "" +msgstr "上級評論" #: .\comments\models.py:29 msgid "enable" -msgstr "" +msgstr "啟用" #: .\comments\models.py:34 .\templates\blog\tags\article_info.html:30 msgid "comment" -msgstr "" +msgstr "評論" #: .\comments\utils.py:13 msgid "Thanks for your comment" -msgstr "" +msgstr "感謝你的評論" #: .\comments\utils.py:15 -#, python-brace-format +#, python-format msgid "" -"\n" -"

Thank you very much for your comments on this site\n" -" You can visit\n" -" {comment." -"article.title}\n" +"

Thank you very much for your comments on this site

\n" +" You can visit %(article_title)s\n" " to review your comments,\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" -" " +" %(article_url)s" msgstr "" +"

非常感謝您對此網站的評論

\n" +" 您可以訪問%(article_title)s\n" +"查看您的評論,\n" +"再次感謝您!\n" +"
\n" +" 如果上面的鏈接打不開,請復製此鏈接鏈接到您的瀏覽器。\n" +"%(article_url)s" -#: .\comments\utils.py:29 -#, python-brace-format +#: .\comments\utils.py:26 +#, python-format msgid "" -"\n" -" Your comment on {comment.article.title}
{comment.parent_comment.body}
has " -"received a reply. go check it out\n" +"Your comment on " +"%(article_title)s
has \n" +" received a reply.
%(comment_body)s\n" +"
\n" +" go check it out!\n" "
\n" " If the link above cannot be opened, please copy this " "link to your browser.\n" -" {article_url}\n" +" %(article_url)s\n" " " msgstr "" - -#: .\djangoblog\logentryadmin.py:11 -msgctxt "logentry_admin:action_type" -msgid "Addition" -msgstr "" - -#: .\djangoblog\logentryadmin.py:12 -msgctxt "logentry_admin:action_type" -msgid "Deletion" -msgstr "" - -#: .\djangoblog\logentryadmin.py:13 -msgctxt "logentry_admin:action_type" -msgid "Change" -msgstr "" - -#: .\djangoblog\logentryadmin.py:25 -msgid "Metadata" -msgstr "" - -#: .\djangoblog\logentryadmin.py:33 -msgid "Details" -msgstr "" - -#: .\djangoblog\logentryadmin.py:95 +"您對 %(article_title)s
" +"的評論有\n" +" 收到回復。
%(comment_body)s\n" +"
\n" +"快去看看吧!\n" +"
\n" +" 如果上面的鏈接打不開,請復製此鏈接鏈接到您的瀏覽器。\n" +" %(article_url)s\n" +" " + +#: .\djangoblog\logentryadmin.py:63 msgid "object" -msgstr "" - -#: .\djangoblog\logentryadmin.py:128 -msgid "action" -msgstr "" - -#: .\djangoblog\logentryadmin.py:133 -msgid "change message" -msgstr "" +msgstr "對象" #: .\djangoblog\settings.py:140 msgid "English" -msgstr "" +msgstr "英文" #: .\djangoblog\settings.py:141 msgid "Simplified Chinese" -msgstr "" +msgstr "簡體中文" #: .\djangoblog\settings.py:142 msgid "Traditional Chinese" -msgstr "" - -#: .\oauth\models.py:17 -msgid "nickname" -msgstr "" +msgstr "繁體中文" #: .\oauth\models.py:30 msgid "oauth user" -msgstr "" +msgstr "第三方用戶" #: .\oauth\models.py:37 msgid "weibo" -msgstr "" +msgstr "微博" #: .\oauth\models.py:38 msgid "google" -msgstr "" +msgstr "谷歌" #: .\oauth\models.py:48 msgid "callback url" -msgstr "" +msgstr "回調地址" #: .\oauth\models.py:59 msgid "already exists" -msgstr "" +msgstr "已經存在" #: .\oauth\views.py:154 +#, python-format msgid "" "\n" "

Congratulations, you have successfully bound your email address. You " -"can use {oauthuser.type} to directly log in to this website without a " -"password. You are welcome to continue to follow this site, the address is\n" -"\n" -" {'http://' " -"+ site}\n" -"\n" -" Thank you again!\n" -"
\n" -" If the link above cannot be opened, please copy this link " -"to your browser.\n" -" {site}\n" +"can use\n" +" %(oauthuser_type)s to directly log in to this website without a " +"password.

\n" +" You are welcome to continue to follow this site, the address is\n" +" %(site)s\n" +" Thank you again!\n" +"
\n" +" If the link above cannot be opened, please copy this link to your " +"browser.\n" +" %(site)s\n" " " msgstr "" +"\n" +"

恭喜你已經綁定成功 你可以使用\n" +" %(oauthuser_type)s 來免密登錄本站

\n" +" 歡迎繼續關註本站, 地址是\n" +" %(site)s\n" +" 再次感謝你\n" +"
\n" +" 如果上面鏈接無法打開,請復製此鏈接到你的瀏覽器 \n" +" %(site)s\n" +" " #: .\oauth\views.py:165 msgid "Congratulations on your successful binding!" -msgstr "" +msgstr "恭喜你綁定成功" #: .\oauth\views.py:217 -#, python-brace-format +#, python-format msgid "" "\n" "

Please click the link below to bind your email

\n" "\n" -" {url}\n" +" %(url)s\n" "\n" " Thank you again!\n" "
\n" " If the link above cannot be opened, please copy this link " "to your browser.\n" -" {url}\n" +"
\n" +" %(url)s\n" " " msgstr "" +"\n" +"

請點擊下面的鏈接綁定您的郵箱

\n" +"\n" +" %(url)s\n" +"\n" +"再次感謝您!\n" +"
\n" +"如果上面的鏈接打不開,請復製此鏈接到您的瀏覽器。\n" +"%(url)s\n" +" " -#: .\oauth\views.py:227 .\oauth\views.py:239 +#: .\oauth\views.py:228 .\oauth\views.py:240 msgid "Bind your email" -msgstr "" +msgstr "綁定郵箱" -#: .\oauth\views.py:241 +#: .\oauth\views.py:242 msgid "" "Congratulations, the binding is just one step away. Please log in to your " "email to check the email to complete the binding. Thank you." -msgstr "" +msgstr "恭喜您,還差一步就綁定成功了,請登錄您的郵箱查看郵件完成綁定,謝謝。" -#: .\oauth\views.py:243 +#: .\oauth\views.py:245 msgid "Binding successful" -msgstr "" +msgstr "綁定成功" -#: .\oauth\views.py:245 -#, python-brace-format +#: .\oauth\views.py:247 +#, python-format msgid "" "Congratulations, you have successfully bound your email address. You can use " -"{oauthuser.type} to directly log in to this website without a password. You " -"are welcome to continue to follow this site." +"%(oauthuser_type)s to directly log in to this website without a password. " +"You are welcome to continue to follow this site." msgstr "" +"恭喜您綁定成功,您以後可以使用%(oauthuser_type)s來直接免密碼登錄本站啦,感謝" +"您對本站對關註。" #: .\templates\account\forget_password.html:7 msgid "forget the password" -msgstr "" +msgstr "忘記密碼" #: .\templates\account\forget_password.html:18 msgid "get verification code" -msgstr "" +msgstr "獲取驗證碼" #: .\templates\account\forget_password.html:19 msgid "submit" -msgstr "" +msgstr "提交" + +#: .\templates\account\login.html:36 +msgid "Create Account" +msgstr "創建賬號" + +#: .\templates\account\login.html:42 +#, fuzzy +#| msgid "forget the password" +msgid "Forget Password" +msgstr "忘記密碼" #: .\templates\account\result.html:18 .\templates\blog\tags\sidebar.html:126 msgid "login" -msgstr "" +msgstr "登錄" #: .\templates\account\result.html:22 msgid "back to the homepage" -msgstr "" +msgstr "返回首頁吧" #: .\templates\blog\article_archives.html:7 #: .\templates\blog\article_archives.html:24 msgid "article archive" -msgstr "" +msgstr "文章歸檔" #: .\templates\blog\article_archives.html:32 msgid "year" -msgstr "" +msgstr "年" #: .\templates\blog\article_archives.html:36 msgid "month" -msgstr "" +msgstr "月" #: .\templates\blog\tags\article_info.html:12 msgid "pin to top" -msgstr "" +msgstr "置頂" #: .\templates\blog\tags\article_info.html:28 msgid "comments" -msgstr "" +msgstr "評論" #: .\templates\blog\tags\article_info.html:58 msgid "toc" -msgstr "" +msgstr "目錄" + +#: .\templates\blog\tags\article_meta_info.html:6 +msgid "posted in" +msgstr "發布於" + +#: .\templates\blog\tags\article_meta_info.html:14 +msgid "and tagged" +msgstr "標簽" -#: .\templates\blog\tags\article_meta_info.html:7 -msgid "Published on" -msgstr "发表于" +#: .\templates\blog\tags\article_meta_info.html:25 +msgid "by " +msgstr "由" -#: .\templates\blog\tags\article_meta_info.html:36 +#: .\templates\blog\tags\article_meta_info.html:29 #, python-format msgid "" "\n" @@ -573,71 +582,87 @@ msgid "" "%(article.author.username)s\"\n" " " msgstr "" +"\n" +" title=\"查看所有由 %(article.author.username)s\"發布的文章\n" +" " + +#: .\templates\blog\tags\article_meta_info.html:44 +msgid "on" +msgstr "在" -#: .\templates\blog\tags\article_meta_info.html:50 +#: .\templates\blog\tags\article_meta_info.html:54 msgid "edit" -msgstr "" +msgstr "編輯" #: .\templates\blog\tags\article_pagination.html:4 msgid "article navigation" -msgstr "" +msgstr "文章導航" #: .\templates\blog\tags\article_pagination.html:9 msgid "earlier articles" -msgstr "" +msgstr "早期文章" #: .\templates\blog\tags\article_pagination.html:12 msgid "newer articles" -msgstr "" +msgstr "較新文章" #: .\templates\blog\tags\article_tag_list.html:5 msgid "tags" -msgstr "" +msgstr "標簽" #: .\templates\blog\tags\sidebar.html:7 msgid "search" -msgstr "" +msgstr "搜索" #: .\templates\blog\tags\sidebar.html:50 msgid "recent comments" -msgstr "" +msgstr "近期評論" #: .\templates\blog\tags\sidebar.html:57 -msgid "published in" -msgstr "" +msgid "published on" +msgstr "發表於" #: .\templates\blog\tags\sidebar.html:65 msgid "recent articles" -msgstr "" +msgstr "近期文章" #: .\templates\blog\tags\sidebar.html:77 msgid "bookmark" -msgstr "" +msgstr "書簽" #: .\templates\blog\tags\sidebar.html:96 msgid "Tag Cloud" -msgstr "" +msgstr "標簽雲" #: .\templates\blog\tags\sidebar.html:107 msgid "Welcome to star or fork the source code of this site" -msgstr "" +msgstr "歡迎您STAR或者FORK本站源代碼" #: .\templates\blog\tags\sidebar.html:118 msgid "Function" -msgstr "" +msgstr "功能" #: .\templates\blog\tags\sidebar.html:120 msgid "management site" -msgstr "" +msgstr "管理站點" #: .\templates\blog\tags\sidebar.html:122 msgid "logout" -msgstr "" +msgstr "登出" #: .\templates\blog\tags\sidebar.html:129 msgid "Track record" -msgstr "" +msgstr "運動軌跡記錄" #: .\templates\blog\tags\sidebar.html:135 msgid "Click me to return to the top" -msgstr "" +msgstr "點我返回頂部" + +#: .\templates\oauth\oauth_applications.html:5 +#| msgid "login" +msgid "quick login" +msgstr "快捷登錄" + +#: .\templates\share_layout\nav.html:26 +msgid "Article archive" +msgstr "文章歸檔" diff --git a/oauth/models.py b/oauth/models.py index 5f76f23..be838ed 100644 --- a/oauth/models.py +++ b/oauth/models.py @@ -14,7 +14,7 @@ class OAuthUser(models.Model): null=True, on_delete=models.CASCADE) openid = models.CharField(max_length=50) - nickname = models.CharField(max_length=50, verbose_name=_('nickname')) + nickname = models.CharField(max_length=50, verbose_name=_('nick name')) token = models.CharField(max_length=150, null=True, blank=True) picture = models.CharField(max_length=350, blank=True, null=True) type = models.CharField(blank=False, null=False, max_length=50) diff --git a/oauth/views.py b/oauth/views.py index 83524fd..12e3a6e 100644 --- a/oauth/views.py +++ b/oauth/views.py @@ -151,16 +151,16 @@ def emailconfirm(request, id, sign): login(request, author) site = 'http://' + get_current_site().domain - content = _(f''' -

Congratulations, you have successfully bound your email address. You can use {oauthuser.type} to directly log in to this website without a password. You are welcome to continue to follow this site, the address is

- - {'http://' + site} - - Thank you again! -
- If the link above cannot be opened, please copy this link to your browser. - {site} - ''') + content = _(''' +

Congratulations, you have successfully bound your email address. You can use + %(oauthuser_type)s to directly log in to this website without a password.

+ You are welcome to continue to follow this site, the address is + %(site)s + Thank you again! +
+ If the link above cannot be opened, please copy this link to your browser. + %(site)s + ''') % {'oauthuser_type': oauthuser.type, 'site': site} send_email(emailto=[oauthuser.email, ], title=_('Congratulations on your successful binding!'), content=content) url = reverse('oauth:bindsuccess', kwargs={ @@ -214,16 +214,17 @@ class RequireEmailView(FormView): }) url = "http://{site}{path}".format(site=site, path=path) - content = _(f""" + content = _("""

Please click the link below to bind your email

- {url} + %(url)s Thank you again!
If the link above cannot be opened, please copy this link to your browser. - {url} - """) +
+ %(url)s + """) % {'url': url} send_email(emailto=[email, ], title=_('Bind your email'), content=content) url = reverse('oauth:bindsuccess', kwargs={ 'oauthid': oauthid @@ -238,11 +239,14 @@ def bindsuccess(request, oauthid): if type == 'email': title = _('Bind your email') content = _( - 'Congratulations, the binding is just one step away. Please log in to your email to check the email to complete the binding. Thank you.') + 'Congratulations, the binding is just one step away. ' + 'Please log in to your email to check the email to complete the binding. Thank you.') else: title = _('Binding successful') content = _( - f"Congratulations, you have successfully bound your email address. You can use {oauthuser.type} to directly log in to this website without a password. You are welcome to continue to follow this site.") + "Congratulations, you have successfully bound your email address. You can use %(oauthuser_type)s" + " to directly log in to this website without a password. You are welcome to continue to follow this site." % { + 'oauthuser_type': oauthuser.type}) return render(request, 'oauth/bindsuccess.html', { 'title': title, 'content': content diff --git a/owntracks/views.py b/owntracks/views.py index 859022c..2bb6e8a 100644 --- a/owntracks/views.py +++ b/owntracks/views.py @@ -5,12 +5,14 @@ import json import logging from itertools import groupby +import django.utils.timezone import requests from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import JsonResponse from django.shortcuts import render from django.utils import timezone +from django.utils.timezone import utc from django.views.decorators.csrf import csrf_exempt from .models import OwnTrackLog @@ -95,9 +97,6 @@ def convert_to_amap(locations): @login_required def get_datas(request): - import django.utils.timezone - from django.utils.timezone import utc - now = django.utils.timezone.now().replace(tzinfo=utc) querydate = django.utils.timezone.datetime( now.year, now.month, now.day, 0, 0, 0) @@ -118,7 +117,7 @@ def get_datas(request): d["name"] = tid paths = list() locations = convert_to_amap( - sorted(item, key=lambda x: x.created_time)) + sorted(item, key=lambda x: x.creation_time)) for i in locations.split(';'): paths.append(i.split(',')) d["path"] = paths diff --git a/templates/account/login.html b/templates/account/login.html index 1773896..cff8d33 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -1,5 +1,6 @@ {% extends 'share_layout/base_account.html' %} {% load static %} +{% load i18n %} {% block content %}
@@ -9,10 +10,6 @@

- Create Account + + {% trans 'Create Account' %} + | Home Page | - 忘记密码 + + {% trans 'Forget Password' %} +

diff --git a/templates/blog/tags/article_meta_info.html b/templates/blog/tags/article_meta_info.html index b6b2b05..cb6111c 100644 --- a/templates/blog/tags/article_meta_info.html +++ b/templates/blog/tags/article_meta_info.html @@ -1,36 +1,29 @@ -{% load blog_tags %} -{% load cache %} {% load i18n %} -{% with article.id|add:user.is_authenticated as cachekey %} - {% cache 36000 metainfo cachekey %} - + - {% endcache %} -{% endwith %} diff --git a/templates/oauth/oauth_applications.html b/templates/oauth/oauth_applications.html index ba6bc40..a841ad2 100644 --- a/templates/oauth/oauth_applications.html +++ b/templates/oauth/oauth_applications.html @@ -1,7 +1,8 @@ +{% load i18n %}