From 1d79e970c49dd885384f06ae0cdc8063d3e9566d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 6 Aug 2020 01:47:01 +0800 Subject: [PATCH] Revised the error messages and their translations both in Python and for the JavaScript. --- accounting/forms.py | 5 ++-- .../locale/zh_Hant/LC_MESSAGES/django.po | 25 +++++++++------- .../locale/zh_Hant/LC_MESSAGES/djangojs.po | 29 +++++++++---------- .../static/accounting/js/transaction-form.js | 2 +- mia_core/locale/zh_Hant/LC_MESSAGES/django.po | 12 ++++---- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/accounting/forms.py b/accounting/forms.py index b9308df..acc768a 100644 --- a/accounting/forms.py +++ b/accounting/forms.py @@ -49,7 +49,7 @@ class RecordForm(forms.Form): required=False, max_length=128, error_messages={ - "max_length": _("This summary is too long."), + "max_length": _("This summary is too long (max. 128 characters)."), }) amount = forms.IntegerField( min_value=1, @@ -181,13 +181,14 @@ class TransactionForm(forms.Form): date = forms.DateField( required=True, error_messages={ + "required": _("Please fill in the date."), "invalid": _("This date is not valid.") }) notes = forms.CharField( required=False, max_length=128, error_messages={ - "max_length": _("This notes is too long.") + "max_length": _("These notes are too long (max. 128 characters).") }) def __init__(self, *args, **kwargs): diff --git a/accounting/locale/zh_Hant/LC_MESSAGES/django.po b/accounting/locale/zh_Hant/LC_MESSAGES/django.po index 2647f3d..32c0cdb 100644 --- a/accounting/locale/zh_Hant/LC_MESSAGES/django.po +++ b/accounting/locale/zh_Hant/LC_MESSAGES/django.po @@ -5,16 +5,17 @@ # msgid "" msgstr "" -"Project-Id-Version: mia 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-06 00:48+0800\n" -"PO-Revision-Date: 2020-08-06 00:40+0800\n" +"Project-Id-Version: mia-js 1.0\n" +"Report-Msgid-Bugs-To: imacat \n" +"POT-Creation-Date: 2020-08-06 01:42+0800\n" +"PO-Revision-Date: 2020-08-06 01:46+0800\n" "Last-Translator: imacat \n" "Language-Team: Traditional Chinese \n" "Language: Traditional Chinese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" #: accounting/converters.py:127 accounting/utils.py:261 msgid "current assets and liabilities" @@ -29,8 +30,8 @@ msgid "Please select the account." msgstr "請選擇會計科目。" #: accounting/forms.py:52 -msgid "This summary is too long." -msgstr "摘要太長了。" +msgid "This summary is too long (max. 128 characters)." +msgstr "摘要太長了(最長128個字)。" #: accounting/forms.py:57 msgid "Please fill in the amount." @@ -65,14 +66,18 @@ msgid "This record is not a debit record." msgstr "這不是借方的會計記錄。" #: accounting/forms.py:184 +msgid "Please fill in the date." +msgstr "請填寫日期。" + +#: accounting/forms.py:185 msgid "This date is not valid." msgstr "請依正確日期格式填寫日期。" -#: accounting/forms.py:190 -msgid "This notes is too long." -msgstr "註記太長了。" +#: accounting/forms.py:191 +msgid "These notes are too long (max. 128 characters)." +msgstr "註記太長了(最長128個字)。" -#: accounting/forms.py:220 +#: accounting/forms.py:221 msgid "The total amount of debit and credit records are inconsistent." msgstr "借方和貸方合計不符。" diff --git a/accounting/locale/zh_Hant/LC_MESSAGES/djangojs.po b/accounting/locale/zh_Hant/LC_MESSAGES/djangojs.po index cfac216..8f3ae77 100644 --- a/accounting/locale/zh_Hant/LC_MESSAGES/djangojs.po +++ b/accounting/locale/zh_Hant/LC_MESSAGES/djangojs.po @@ -1,18 +1,17 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Traditional Chinese PO file for the JavaScript on the Mia Website +# Copyright (C) 2020 imacat +# This file is distributed under the same license as the Mia package. +# imacat , 2020. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-06 01:34+0800\n" -"PO-Revision-Date: 2020-08-06 01:38+0800\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Project-Id-Version: mia 1.0\n" +"Report-Msgid-Bugs-To: imacat \n" +"POT-Creation-Date: 2020-08-06 01:42+0800\n" +"PO-Revision-Date: 2020-08-06 01:46+0800\n" +"Last-Translator: imacat \n" +"Language-Team: Traditional Chinese \n" +"Language: Traditional Chinese\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -20,7 +19,7 @@ msgstr "" #: accounting/static/accounting/js/transaction-form.js:369 msgid "Please fill in the date." -msgstr "請填上日期。" +msgstr "請填寫日期。" #: accounting/static/accounting/js/transaction-form.js:389 msgid "Please select the account." @@ -32,12 +31,12 @@ msgstr "摘要太長了(最長128個字)。" #: accounting/static/accounting/js/transaction-form.js:431 msgid "Please fill in the amount." -msgstr "請填上金額。" +msgstr "請填寫金額。" #: accounting/static/accounting/js/transaction-form.js:463 msgid "The total amount of debit and credit records are inconsistent." msgstr "借方和貸方合計不符。" #: accounting/static/accounting/js/transaction-form.js:484 -msgid "This note is too long (max. 128 characters)." +msgid "These notes are too long (max. 128 characters)." msgstr "註記太長了(最長128個字)。" diff --git a/accounting/static/accounting/js/transaction-form.js b/accounting/static/accounting/js/transaction-form.js index bc24248..41d860f 100644 --- a/accounting/static/accounting/js/transaction-form.js +++ b/accounting/static/accounting/js/transaction-form.js @@ -481,7 +481,7 @@ function validateNote() { note.value = note.value.trim(); if (note.value.length > 128) { note.classList.add("is-invalid"); - errorMessage.text(gettext("This note is too long (max. 128 characters).")); + errorMessage.text(gettext("These notes are too long (max. 128 characters).")); return false; } note.classList.remove("is-invalid"); diff --git a/mia_core/locale/zh_Hant/LC_MESSAGES/django.po b/mia_core/locale/zh_Hant/LC_MESSAGES/django.po index a588f22..1e9cdc5 100644 --- a/mia_core/locale/zh_Hant/LC_MESSAGES/django.po +++ b/mia_core/locale/zh_Hant/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: mia 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-08-06 00:48+0800\n" -"PO-Revision-Date: 2020-08-06 00:40+0800\n" +"POT-Creation-Date: 2020-08-06 01:42+0800\n" +"PO-Revision-Date: 2020-08-06 01:46+0800\n" "Last-Translator: imacat \n" "Language-Team: Traditional Chinese \n" "Language: Traditional Chinese\n" @@ -37,11 +37,11 @@ msgid "All Time" msgstr "全部" #: mia_core/period.py:583 mia_core/period.py:616 -#: mia_core/templatetags/mia_core.py:212 +#: mia_core/templatetags/mia_core.py:213 msgid "This Month" msgstr "這個月" -#: mia_core/period.py:624 mia_core/templatetags/mia_core.py:219 +#: mia_core/period.py:624 mia_core/templatetags/mia_core.py:220 msgid "Last Month" msgstr "上個月" @@ -53,11 +53,11 @@ msgstr "今年" msgid "Last Year" msgstr "去年" -#: mia_core/period.py:656 mia_core/templatetags/mia_core.py:192 +#: mia_core/period.py:656 mia_core/templatetags/mia_core.py:193 msgid "Today" msgstr "今天" -#: mia_core/period.py:658 mia_core/templatetags/mia_core.py:194 +#: mia_core/period.py:658 mia_core/templatetags/mia_core.py:195 msgid "Yesterday" msgstr "昨天"