diff --git a/contacts/locale/zh_CN/LC_MESSAGES/django.po b/contacts/locale/zh_CN/LC_MESSAGES/django.po index d2b89b1d52..6100135f32 100644 --- a/contacts/locale/zh_CN/LC_MESSAGES/django.po +++ b/contacts/locale/zh_CN/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-09 21:31+0800\n" +"POT-Creation-Date: 2013-01-05 19:46+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,22 +17,37 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0\n" -#: views.py:68 views.py:93 -#, python-format -msgid "Successfully adding %s to contacts." -msgstr "你已成功添加 %s 为联系人" +#: models.py:25 templates/contacts/contact_list.html:133 +msgid "Email is required." +msgstr "邮箱为必填项。" + +#: models.py:30 templates/contacts/contact_list.html:137 +msgid "You can't add yourself." +msgstr "不能添加自己。" + +#: models.py:33 +msgid "It is already your contact." +msgstr "该邮箱已在列表中。" + +#: views.py:68 +msgid "Successfully added %s to contacts." +msgstr "你已成功添加 %s 为联系人。" + +#: views.py:93 +msgid "Successfully added %s." +msgstr "你已成功添加 %s 为联系人。" #: views.py:95 msgid "Failed to add an contact." -msgstr "添加联系人失败" +msgstr "添加失败" #: views.py:120 -msgid "Editting Successfully" -msgstr "编辑成功" +msgid "Successfully edited %s." +msgstr "编辑 %s 成功。" #: views.py:133 -msgid "Deleting Successfully" -msgstr "删除成功" +msgid "Successfully Deleted" +msgstr "成功删除 %s 。" #: templates/contacts/contact_list.html:8 msgid "Tips" @@ -88,42 +103,52 @@ msgid "" "link." msgstr "联系人用来在共享资料库和发送文件外链时的快速补全。" -#: templates/contacts/contact_list.html:49 -#: templates/contacts/contact_list.html:59 +#: templates/contacts/contact_list.html:48 +#: templates/contacts/contact_list.html:57 msgid "Email" msgstr "邮箱" -#: templates/contacts/contact_list.html:51 -#: templates/contacts/contact_list.html:61 +#: templates/contacts/contact_list.html:50 +#: templates/contacts/contact_list.html:59 msgid "Name(optional)" msgstr "名字(可选)" -#: templates/contacts/contact_list.html:52 -#: templates/contacts/contact_list.html:62 +#: templates/contacts/contact_list.html:51 +#: templates/contacts/contact_list.html:60 msgid "Note(optional)" msgstr "备注(可选)" #: templates/contacts/contact_list.html:53 -msgid "Please input email address" -msgstr "请输入邮箱地址。" - -#: templates/contacts/contact_list.html:54 -#: templates/contacts/contact_list.html:64 +#: templates/contacts/contact_list.html:62 msgid "Submit" msgstr "提交" -#: templates/contacts/contact_list.html:57 +#: templates/contacts/contact_list.html:56 msgid "Edit Contact" msgstr "编辑联系人" -#: templates/contacts/contact_list.html:114 +#: templates/contacts/contact_list.html:107 +#: templates/contacts/contact_list.html:168 +msgid "Failed." +msgstr "提交失败。" + +#: templates/contacts/contact_list.html:115 msgid "Delete Contact" msgstr "删除联系人" -#: templates/contacts/contact_list.html:114 +#: templates/contacts/contact_list.html:115 msgid "Are you sure you want to delete" msgstr "确定要删除" +#~ msgid "Editting Successfully" +#~ msgstr "编辑成功" + +#~ msgid "Deleting Successfully" +#~ msgstr "删除成功" + +#~ msgid "Please input email address" +#~ msgstr "请输入邮箱地址。" + #~ msgid "Tip" #~ msgstr "小提示" diff --git a/contacts/models.py b/contacts/models.py index e9cb6a711d..5604d52241 100644 --- a/contacts/models.py +++ b/contacts/models.py @@ -2,6 +2,7 @@ from django import forms from django.db import models from django.forms import ModelForm +from django.utils.translation import ugettext as _ class Contact(models.Model): """Record user's contacts.""" @@ -21,15 +22,15 @@ class ContactAddForm(ModelForm): def clean(self): if not 'contact_email' in self.cleaned_data: - raise forms.ValidationError('请输入邮箱地址。') + raise forms.ValidationError(_('Email is required.')) user_email = self.cleaned_data['user_email'] contact_email = self.cleaned_data['contact_email'] if user_email == contact_email: - raise forms.ValidationError('不能添加自己为联系人') + raise forms.ValidationError(_("You can't add yourself.")) elif Contact.objects.filter(user_email=user_email, contact_email=contact_email).count() > 0: - raise forms.ValidationError('联系人列表中已有该用户') + raise forms.ValidationError(_("It is already your contact.")) else: return self.cleaned_data diff --git a/contacts/templates/contacts/contact_list.html b/contacts/templates/contacts/contact_list.html index c57ec1923d..7857da304f 100644 --- a/contacts/templates/contacts/contact_list.html +++ b/contacts/templates/contacts/contact_list.html @@ -29,7 +29,7 @@ {{ contact.contact_email }} {{ contact.contact_name }} {{ contact.note }} - + {% trans "Edit"%} {% trans "Delete"%} @@ -43,24 +43,22 @@ {% endif %} -
+

{% trans "Add Contacts"%}

- {{ form.user_email.as_hidden }}
{{ form.contact_email }}

{{ form.contact_name }}

{{ form.note }}
-

{% trans "Please input email address"%}

+

-
+

{% trans "Edit Contact"%}

- {{ edit_form.user_email.as_hidden }}
{{ edit_form.contact_email }}

{{ edit_form.contact_name }}

{{ edit_form.note }}
-

+

@@ -69,42 +67,45 @@ {% block extra_script %}