diff --git a/forms.py b/forms.py index 6939434d3a..86fb713d42 100644 --- a/forms.py +++ b/forms.py @@ -46,8 +46,8 @@ class FileLinkShareForm(forms.Form): """ email = forms.CharField(max_length=512, error_messages={ - 'required': '输入不能为空', - 'max_length': '邮箱太长,不超过512个字符' + 'required': _("Email is required"), + 'max_length': _("Email is not longer than 512 characters"), }) file_shared_link = forms.CharField() @@ -65,22 +65,22 @@ class RepoCreateForm(forms.Form): """ repo_name = forms.CharField(max_length=50, error_messages={ 'required': _(u'Name can\'t be empty'), - 'max_length': _(u'Name should be less than 50 characters') + 'max_length': _(u'Name is too long (maximum is 50 characters)') }) repo_desc = forms.CharField(max_length=100, error_messages={ 'required': _(u'Description can\'t be empty'), - 'max_length': _(u'Description should be less than 100 characters') + 'max_length': _(u'Description is too long (maximum is 100 characters)') }) encryption = forms.CharField(max_length=1) passwd = forms.CharField(min_length=3, max_length=15, required=False, error_messages={ - 'min_length': _(u'Password should be at least 3 characters'), - 'max_length': _(u'Password should be less than 15 characters'), + 'min_length': _(u'Password is too short (minimum is 3 characters)'), + 'max_length': _(u'Password is too long (maximum is 15 characters)'), }) passwd_again = forms.CharField(min_length=3, max_length=15, required=False, error_messages={ - 'min_length': _(u'Password should be at least 3 characters'), - 'max_length': _(u'Password should be less than 15 characters'), + 'min_length': _(u'Password is too short (minimum is 3 characters)'), + 'max_length': _(u'Password is too long (maximum is 15 characters)'), }) def clean_repo_name(self): @@ -121,19 +121,19 @@ class RepoNewFileForm(forms.Form): """ Form for create a new empty file. """ - repo_id = forms.CharField(error_messages={'required': '参数错误'}) - parent_dir = forms.CharField(error_messages={'required': '参数错误'}) + repo_id = forms.CharField(error_messages={'required': _('Repo id is required')}) + parent_dir = forms.CharField(error_messages={'required': _('Parent dir is required')}) new_file_name = forms.CharField(max_length=settings.MAX_UPLOAD_FILE_NAME_LEN, error_messages={ - 'max_length': '新文件名太长', - 'required': '新文件名不能为空', + 'max_length': _('File name is too long'), + 'required': _('File name can\'t be empty'), }) def clean_new_file_name(self): new_file_name = self.cleaned_data['new_file_name'] try: if not is_valid_filename(new_file_name): - error_msg = u"您输入的文件名 %s 包含非法字符" % new_file_name + error_msg = _(u'File name "%s" is not valid') % new_file_name raise forms.ValidationError(error_msg) else: return new_file_name @@ -144,20 +144,20 @@ class RepoRenameFileForm(forms.Form): """ Form for rename a file. """ - repo_id = forms.CharField(error_messages={'required': '参数错误'}) - parent_dir = forms.CharField(error_messages={'required': '参数错误'}) - oldname = forms.CharField(error_messages={'required': '参数错误'}) + repo_id = forms.CharField(error_messages={'required': _("Repo id is required")}) + parent_dir = forms.CharField(error_messages={'required': _("Parent dir is required")}) + oldname = forms.CharField(error_messages={'required': _("Oldname is required")}) newname = forms.CharField(max_length=settings.MAX_UPLOAD_FILE_NAME_LEN, error_messages={ - 'max_length': '新文件名太长', - 'required': '新文件名不能为空', + 'max_length': _('File name is too long'), + 'required': _('File name can\'t be empty'), }) def clean_newname(self): newname = self.cleaned_data['newname'] try: if not is_valid_filename(newname): - error_msg = u"您输入的文件名 %s 包含非法字符" % newname + error_msg = _(u'File name "%s" is not valid') % newname raise forms.ValidationError(error_msg) else: return newname @@ -168,19 +168,19 @@ class RepoNewDirForm(forms.Form): """ Form for create a new empty dir. """ - repo_id = forms.CharField(error_messages={'required': '参数错误'}) - parent_dir = forms.CharField(error_messages={'required': '参数错误'}) + repo_id = forms.CharField(error_messages={'required': _("Repo id is required")}) + parent_dir = forms.CharField(error_messages={'required': _("Parent dir is required")}) new_dir_name = forms.CharField(max_length=settings.MAX_UPLOAD_FILE_NAME_LEN, error_messages={ - 'max_length': '新目录名太长', - 'required': '新目录名不能为空', + 'max_length': _('Directory name is too long'), + 'required': _('Directory name can\'t be empty'), }) def clean_new_dir_name(self): new_dir_name = self.cleaned_data['new_dir_name'] try: if not is_valid_filename(new_dir_name): - error_msg = u"您输入的目录名 %s 包含非法字符" % new_dir_name + error_msg = _(u'Directory name "%s" is not valid') % new_dir_name raise forms.ValidationError(error_msg) else: return new_dir_name @@ -191,9 +191,9 @@ class RepoPassowrdForm(forms.Form): """ Form for user to decrypt a repo in repo page. """ - repo_id = forms.CharField(error_messages={'required': '参数错误'}) - username = forms.CharField(error_messages={'required': '参数错误'}) - password = forms.CharField(error_messages={'required': '密码不能为空'}) + repo_id = forms.CharField(error_messages={'required': _('Repo id is required')}) + username = forms.CharField(error_messages={'required': _('Username is required')}) + password = forms.CharField(error_messages={'required': _('Password can\'t be empty')}) def clean(self): if 'password' in self.cleaned_data: @@ -204,22 +204,22 @@ class RepoPassowrdForm(forms.Form): seafserv_threaded_rpc.set_passwd(repo_id, username, password) except SearpcError, e: if e.msg == 'Bad arguments': - raise forms.ValidationError(u'url 格式不正确') + raise forms.ValidationError(_(u'Bad url format')) # elif e.msg == 'Repo is not encrypted': # return HttpResponseRedirect(reverse('repo', # args=[self.repo_id])) elif e.msg == 'Incorrect password': - raise forms.ValidationError(u'密码不正确,请重新输入') + raise forms.ValidationError(_(u'Wrong password')) elif e.msg == 'Internal server error': - raise forms.ValidationError(u'服务器内部故障') + raise forms.ValidationError(_(u'Inernal server error')) else: - raise forms.ValidationError(u'未知错误') + raise forms.ValidationError(_(u'Decrypt library error')) class SetUserQuotaForm(forms.Form): """ Form for setting user quota. """ - email = forms.CharField(error_messages={'required': '参数错误'}) + email = forms.CharField(error_messages={'required': _('Email is required')}) quota = forms.IntegerField(min_value=0, - error_messages={'required': '容量不能为空', - 'min_value': '容量不能小于0'}) + error_messages={'required': _('Quota can\'t be empty'), + 'min_value': _('Quota is too low (minimum value is 0)')}) diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo index 9b252cf61a..b8192bc929 100644 Binary files a/locale/zh_CN/LC_MESSAGES/django.mo and b/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po index 9abdb17f84..ffe1364efd 100644 --- a/locale/zh_CN/LC_MESSAGES/django.po +++ b/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-10-29 23:01+0800\n" +"POT-Creation-Date: 2012-10-30 11:46+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,35 +25,113 @@ msgstr "该邮箱已被注册" msgid "The two password fields didn't match." msgstr "两次输入的密码不一致" +#: forms.py:49 forms.py:222 +msgid "Email is required" +msgstr "" + +#: forms.py:50 +msgid "Email is not longer than 512 characters" +msgstr "邮箱太长,不超过512个字符" + #: forms.py:67 msgid "Name can't be empty" msgstr "名称不能为空" #: forms.py:68 -msgid "Name should be less than 50 characters" -msgstr "名称太长,不超过50个字符" +msgid "Name is too long (maximum is 50 characters)" +msgstr "名称太长(不超过50个字符)" #: forms.py:71 msgid "Description can't be empty" msgstr "描述不能为空" #: forms.py:72 -msgid "Description should be less than 100 characters" -msgstr "描述太长,不超过100个字符" +msgid "Description is too long (maximum is 100 characters)" +msgstr "描述太长(不超过100个字符)" #: forms.py:77 forms.py:82 -msgid "Password should be at least 3 characters" -msgstr "密码太短" +msgid "Password is too short (minimum is 3 characters)" +msgstr "密码太短(不少于3个字符)" #: forms.py:78 forms.py:83 -msgid "Password should be less than 15 characters" -msgstr "密码太长" +msgid "Password is too long (maximum is 15 characters)" +msgstr "密码太长(不超过15个字符)" #: forms.py:89 #, python-format msgid "Name %s is not valid" msgstr "名称 %s 含有无效字符" +#: forms.py:124 forms.py:147 forms.py:171 forms.py:194 +msgid "Repo id is required" +msgstr "需要 repo id" + +#: forms.py:125 forms.py:148 forms.py:172 +msgid "Parent dir is required" +msgstr "需要 parent dir" + +#: forms.py:128 forms.py:152 +msgid "File name is too long" +msgstr "文件名过长" + +#: forms.py:129 forms.py:153 +msgid "File name can't be empty" +msgstr "文件名不能为空" + +#: forms.py:136 forms.py:160 +#, python-format +msgid "File name \"%s\" is not valid" +msgstr "文件名 %s 含有无效字符" + +#: forms.py:149 +msgid "Oldname is required" +msgstr "需要 oldname" + +#: forms.py:175 +msgid "Directory name is too long" +msgstr "目录名过长" + +#: forms.py:176 +msgid "Directory name can't be empty" +msgstr "描述不能为空" + +#: forms.py:183 +#, python-format +msgid "Directory name \"%s\" is not valid" +msgstr "目录名 %s 含有无效字符" + +#: forms.py:195 +msgid "Username is required" +msgstr "需要 username" + +#: forms.py:196 +msgid "Password can't be empty" +msgstr "密码不能为空" + +#: forms.py:207 +msgid "Bad url format" +msgstr "错误的 url 格式" + +#: forms.py:212 +msgid "Wrong password" +msgstr "密码错误" + +#: forms.py:214 +msgid "Inernal server error" +msgstr "服务器内部错误" + +#: forms.py:216 +msgid "Decrypt library error" +msgstr "解密资料库出错" + +#: forms.py:224 +msgid "Quota can't be empty" +msgstr "容量不能为空" + +#: forms.py:225 +msgid "Quota is too low (minimum value is 0)" +msgstr "容量太小(最小为0)" + #: settings.py:94 msgid "English" msgstr "" @@ -151,6 +229,29 @@ msgstr "确定" msgid "No" msgstr "取消" +#: templates/decrypt_repo_form.html:9 +msgid "" +"This library is encrypt, please input password. The password will live on " +"server for 1 hour." +msgstr "该资料库已加密。如需在线查看里面的内容,请输入解密密码。密码只会在服务器上暂存1小时。" + +#: templates/decrypt_repo_form.html:11 +msgid "Password: " +msgstr "密码:" + +#: templates/decrypt_repo_form.html:15 templates/repo.html:168 +#: templates/repo.html.py:178 templates/repo.html:198 +#: templates/repo.html.py:209 templates/repo_update_file.html:21 +#: templates/repo_upload_file.html:17 templates/repo_view_file.html:141 +#: templates/repo_view_file.html.py:167 templates/registration/login.html:13 +#: templates/registration/registration_form.html:18 +#: templates/snippets/events.html:72 +#: templates/snippets/group_recommend_form.html:23 +#: templates/snippets/repo_create_form.html:23 +#: templates/snippets/repo_share_form.html:18 +msgid "Submit" +msgstr "提交" + #: templates/myhome.html:15 msgid "No Nickname" msgstr "暂无昵称" @@ -209,15 +310,15 @@ msgstr "通讯录" msgid "Public Info" msgstr "公共信息" -#: templates/org_admin_base.html:7 +#: templates/org_admin_base.html:8 msgid "Org Info" msgstr "团体概况" -#: templates/org_admin_base.html:10 +#: templates/org_admin_base.html:11 msgid "Library Management" msgstr "资料库管理" -#: templates/org_admin_base.html:13 +#: templates/org_admin_base.html:14 msgid "Group Management" msgstr "群组管理" @@ -422,18 +523,6 @@ msgstr "更多操作" msgid "Directory Name" msgstr "目录名" -#: templates/repo.html:168 templates/repo.html.py:178 templates/repo.html:198 -#: templates/repo.html.py:209 templates/repo_update_file.html:21 -#: templates/repo_upload_file.html:17 templates/repo_view_file.html:141 -#: templates/repo_view_file.html.py:167 templates/registration/login.html:13 -#: templates/registration/registration_form.html:18 -#: templates/snippets/events.html:72 -#: templates/snippets/group_recommend_form.html:23 -#: templates/snippets/repo_create_form.html:23 -#: templates/snippets/repo_share_form.html:18 -msgid "Submit" -msgstr "提交" - #: templates/repo.html:169 templates/repo.html.py:179 templates/repo.html:199 #: templates/repo.html.py:210 templates/repo_update_file.html:27 #: templates/repo_upload_file.html:23 templates/snippets/events.html:73 @@ -981,9 +1070,6 @@ msgstr "Tip:输入 all 共享到公共资料" #~ msgid "Get sharing link" #~ msgstr "获取分享地址" -#~ msgid "File is loading..." -#~ msgstr "文件内容读取中..." - #~ msgid "Under processing, please wait..." #~ msgstr "处理中,请稍侯..." diff --git a/templates/decrypt_repo_form.html b/templates/decrypt_repo_form.html index 91dbb149b8..a3874f6cdc 100644 --- a/templates/decrypt_repo_form.html +++ b/templates/decrypt_repo_form.html @@ -1,18 +1,18 @@ {% extends base_template %} - +{% load i18n %} {% load url from future %} {% block main_panel %}
-

该资料库已加密。如需在线查看里面的内容,请输入解密密码。密码只会在服务器上暂存1小时。

+

{% trans "This library is encrypt, please input password. The password will live on server for 1 hour." %}

- + - + {% for error in form.errors.values %}

{{ error|escape }}

{% endfor %}