diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po index 35c6b62cd5..5dca0ac41f 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-11-06 13:38+0800\n" +"POT-Creation-Date: 2012-11-06 17:07+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -136,6 +136,10 @@ msgstr "" msgid "简体中文" msgstr "" +#: views.py:419 +msgid "Unable to view recycle page" +msgstr "无法查看文件回收站" + #: views.py:442 views.py:478 msgid "Can not access library" msgstr "无法访问该资料库" @@ -156,7 +160,7 @@ msgstr "上传的文件名包含非法字符" msgid "Duplicated filename" msgstr "已存在同名的文件" -#: views.py:505 views.py:2417 +#: views.py:505 views.py:1211 views.py:1560 views.py:2423 msgid "File not exists" msgstr "文件不存在" @@ -188,12 +192,12 @@ msgstr "你没有权限进行还原操作" msgid "Please specify history ID" msgstr "请指定历史记录ID" -#: views.py:725 views.py:1490 views.py:1494 views.py:2292 views.py:2327 -#: views.py:2648 +#: views.py:725 views.py:1495 views.py:1499 views.py:2298 views.py:2333 +#: views.py:2654 msgid "Invalid arguments" msgstr "非法参数" -#: views.py:727 views.py:822 views.py:2240 +#: views.py:727 views.py:822 views.py:2246 msgid "Library not exists" msgstr "资料库不存在" @@ -210,140 +214,152 @@ msgid "" "Failed to remove library. Only staff or owner can perform this operation." msgstr "删除资料库失败, 只有团体管理员或资料库创建者有权删除资料库。" -#: views.py:1108 +#: views.py:1113 msgid "Failed to create repo" msgstr "创建失败" -#: views.py:1126 +#: views.py:1131 msgid "Operation successful" msgstr "操作成功" -#: views.py:1128 +#: views.py:1133 msgid "Operation failed" msgstr "操作失败" -#: views.py:1159 +#: views.py:1164 msgid "Failed to delete file." msgstr "删除文件出错。" -#: views.py:1166 +#: views.py:1171 #, python-format msgid "%s successfully deleted." msgstr "%s 删除成功。" -#: views.py:1168 +#: views.py:1173 #, python-format msgid "Internal error. Failed to delete %s." msgstr "内部错误。删除 %s 失败。" -#: views.py:1426 +#: views.py:1231 views.py:1566 +msgid "Unable to view file" +msgstr "无法查看该文件" + +#: views.py:1431 msgid "File size surpasses 10M, can not be previewed online." msgstr "文件超过10M,无法在线查看。" -#: views.py:1431 +#: views.py:1436 msgid "HTTPError: failed to open file online" msgstr "HTTPError: 无法在线打开该文件" -#: views.py:1434 +#: views.py:1439 msgid "URLError: failed to open file online" msgstr "URLError: 无法在线打开该文件" -#: views.py:1446 +#: views.py:1451 msgid "Unknown file encoding" msgstr "文件编码无法识别" -#: views.py:1475 +#: views.py:1480 msgid "Internal Error" msgstr "内部错误" -#: views.py:1644 +#: views.py:1541 +msgid "Unable to edit file" +msgstr "无法编辑该文件" + +#: views.py:1629 +msgid "Unable to access file" +msgstr "无法访问文件" + +#: views.py:1649 msgid "Failed to download library, unable to find servre" msgstr "下载失败:找不到服务器" -#: views.py:1656 +#: views.py:1661 msgid "Invalid server setting" msgstr "服务器设置错误" -#: views.py:1692 +#: views.py:1697 #, python-format msgid "Can not %(op)s directory %(src)s to its subdirectory %(des)s" msgstr "不能把目录 %(src)s %(op)s到它的子目录 %(des)s中" -#: views.py:1693 +#: views.py:1698 msgid "copy" msgstr "复制" -#: views.py:1693 +#: views.py:1698 msgid "move" msgstr "移动" -#: views.py:1709 +#: views.py:1714 #, python-format msgid "Successfully copying %(name)s:view" msgstr "复制 %(name)s 成功:查看" -#: views.py:1715 +#: views.py:1720 #, python-format msgid "Successfully moving %(name)s view" msgstr "移动 %(name)s 成功:查看" -#: views.py:1828 +#: views.py:1833 msgid "Failed to set quota: internal error" msgstr "内部错误,设置失败" -#: views.py:1901 templates/sys_useradmin.html:31 +#: views.py:1907 templates/sys_useradmin.html:31 #: templates/registration/password_reset_confirm.html:4 #: templates/registration/password_reset_form.html:4 #: templates/registration/password_reset_form.html:7 msgid "Password Reset" msgstr "密码重置" -#: views.py:1903 views.py:1944 +#: views.py:1909 views.py:1950 msgid "Successfully sending mail" msgstr "邮件发送成功" -#: views.py:1905 views.py:1946 +#: views.py:1911 views.py:1952 msgid "Failed to send mail" msgstr "邮件发送失败" -#: views.py:1916 +#: views.py:1922 msgid "Successfully resetting password" msgstr "密码重置成功" -#: views.py:1921 +#: views.py:1927 msgid "Failed to reset password: user does not exist" msgstr "密码重置失败:用户不存在" -#: views.py:1942 +#: views.py:1948 msgid "Seafile Registration Information" msgstr "Seafile注册信息" -#: views.py:2158 +#: views.py:2164 #, python-format msgid "Successfully rename %(old)s to %(new)s。" msgstr "%(old)s 已重命名为 %(new)s" -#: views.py:2214 +#: views.py:2220 msgid "Failed to create library" msgstr "创建资料库失败" -#: views.py:2313 +#: views.py:2319 #, python-format msgid "" "Successfully revert %(path)s to root directory." msgstr "成功还原 %(path)s 到根目录。" -#: views.py:2317 views.py:2343 +#: views.py:2323 views.py:2349 #, python-format msgid "Successfully revert %(path)s" msgstr "成功还原 %(path)s" -#: views.py:2339 +#: views.py:2345 #, python-format msgid "Successfully revert %(path)s to root directory." msgstr "成功还原 %(path)s 到根目录。" -#: views.py:2477 +#: views.py:2483 msgid "Internal error" msgstr "内部错误" @@ -1213,6 +1229,30 @@ msgstr "你的 Seafile 客户端版本太旧,请升级到最新版本。" msgid "Click to download." msgstr "点此下载" +#: templates/shared_link_email.html:2 +#, python-format +msgid "" +"You're receiving this e-mail because %(email)s is sharing a file to you on " +"%(site_name)s." +msgstr "你收到这封邮件是因为 %(email)s 在 %(site_name)s 上共享了一个文件给你。" + +#: templates/shared_link_email.html:4 +msgid "Please go to the following page and view the file:" +msgstr "请点击以下链接查看:" + +#: templates/shared_link_email.html:7 templates/user_add_email.html:14 +#: templates/user_reset_email.html:6 +#: templates/registration/password_reset_email.html:10 +msgid "Thanks for using our site!" +msgstr "感谢使用!" + +#: templates/shared_link_email.html:9 templates/user_add_email.html:16 +#: templates/user_reset_email.html:8 +#: templates/registration/password_reset_email.html:12 +#, python-format +msgid "The %(site_name)s team" +msgstr "%(site_name)s 团队" + #: templates/sys_group_admin.html:7 msgid "All Groups" msgstr "所有群组" @@ -1305,6 +1345,51 @@ msgstr "上传文件" msgid "to" msgstr "到" +#: templates/user_add_email.html:3 +#, python-format +msgid "" +"You're receiving this e-mail because %(user)s added you to organization " +"\"%(org.org_name)s\" on %(site_name)s." +msgstr "你收到这封邮件是因为 %(user)s 在 %(site_name)s 上将你加入到“%(org.org_name)s”团体。" + +#: templates/user_add_email.html:5 +#, python-format +msgid "" +"You're receiving this e-mail because %(user)s added you to %(site_name)s." +msgstr "你收到这封邮件是因为 %(user)s 将你加入到 %(site_name)s。" + +#: templates/user_add_email.html:7 +msgid "Following is your account information:" +msgstr "以下是您的登录信息:" + +#: templates/user_add_email.html:8 +#, python-format +msgid "Email: %(email)s" +msgstr "邮箱:%(email)s" + +#: templates/user_add_email.html:9 +#, python-format +msgid "Password: %(password)s" +msgstr "密码:%(password)s" + +#: templates/user_add_email.html:11 +msgid "Please go to the following page and log in:" +msgstr "请点击以下链接登录:" + +#: templates/user_reset_email.html:2 +#, python-format +msgid "" +"You're receiving this e-mail because staff has reset your password at " +"%(site_name)s. " +msgstr "你收到这封邮件是因为你在 %(site_name)s 的账号密码已经被管理员重置。" + +#: templates/user_reset_email.html:4 +#, python-format +msgid "" +"Your new password is %(password)s, please modify your password as soon as " +"possible." +msgstr "你的新密码是 %(password)s, 请尽快修改。" + #: templates/userinfo.html:13 msgid "Profile" msgstr "设置" @@ -1415,15 +1500,6 @@ msgstr "请点击以下链接更新密码:" msgid "Your username, in case you've forgotten:" msgstr "你的用户名:" -#: templates/registration/password_reset_email.html:10 -msgid "Thanks for using our site!" -msgstr "感谢使用!" - -#: templates/registration/password_reset_email.html:12 -#, python-format -msgid "The %(site_name)s team" -msgstr "%(site_name)s 团队" - #: templates/registration/password_reset_form.html:9 msgid "Your email used in login: " msgstr "你注册的邮箱账号:" diff --git a/organizations/locale/zh_CN/LC_MESSAGES/django.po b/organizations/locale/zh_CN/LC_MESSAGES/django.po index d09acc7333..c0993069e0 100644 --- a/organizations/locale/zh_CN/LC_MESSAGES/django.po +++ b/organizations/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-31 16:17+0800\n" +"POT-Creation-Date: 2012-11-06 17:20+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -335,19 +335,19 @@ msgstr "" msgid "" "\n" "and reset your password later.\n" -"Thank you!\n" +"Thanks for using our site!\n" "\n" "The %(site_name)s team\n" msgstr "" "\n" "随后请重置你的密码。\n" -"谢谢!\n" +"感谢使用!\n" "\n" "%(site_name)s 团队\n" #: templates/organizations/personal.html:14 -msgid "Profile" -msgstr "个人基本信息" +msgid "Account" +msgstr "我的基本信息" #: templates/organizations/personal.html:20 msgid "No Nickname" @@ -357,6 +357,9 @@ msgstr "暂无昵称" msgid "Edit" msgstr "编辑" +#~ msgid "Profile" +#~ msgstr "个人基本信息" + #~ msgid "Total Org Space Used" #~ msgstr "团体已用总空间" @@ -372,9 +375,6 @@ msgstr "编辑" #~ msgid "Last Update" #~ msgstr "更新时间" -#~ msgid "Account" -#~ msgstr "我的基本信息" - #~ msgid "Nickname is empty" #~ msgstr "暂无昵称" diff --git a/organizations/templates/organizations/org_user_add_email.html b/organizations/templates/organizations/org_user_add_email.html index 0aa95aa4a5..b715d5883c 100644 --- a/organizations/templates/organizations/org_user_add_email.html +++ b/organizations/templates/organizations/org_user_add_email.html @@ -10,7 +10,7 @@ Please click the link to log in: {{ protocol }}://{{ domain }}{% url auth_login %} {% blocktrans %} and reset your password later. -Thank you! +Thanks for using our site! The {{ site_name }} team {% endblocktrans%} diff --git a/share/views.py b/share/views.py index 8a617750b5..febda25b9f 100644 --- a/share/views.py +++ b/share/views.py @@ -443,6 +443,8 @@ def send_shared_link(request): result = {} content_type = 'application/json; charset=utf-8' + from seahub.settings import SITE_NAME + form = FileLinkShareForm(request.POST) if form.is_valid(): email = form.cleaned_data['email'] @@ -459,6 +461,7 @@ def send_shared_link(request): 'email': request.user.username, 'to_email': to_email, 'file_shared_link': file_shared_link, + 'site_name': SITE_NAME, } try: diff --git a/templates/shared_link_email.html b/templates/shared_link_email.html index f3fc756460..4584245cf6 100644 --- a/templates/shared_link_email.html +++ b/templates/shared_link_email.html @@ -1,12 +1,11 @@ -{% autoescape off %} -亲爱的 {{ to_email }}: - -{{ email }} 在SeaCloud上共享了一个文件给你,请点击以下链接查看: +{% load i18n %}{% autoescape off %} +{% blocktrans %}You're receiving this e-mail because {{ email }} is sharing a file to you on {{ site_name }}.{% endblocktrans%} +{% trans "Please go to the following page and view the file:" %} {{ file_shared_link }} -感谢使用我们的网站! +{% trans "Thanks for using our site!" %} -Seafile团队 +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} {% endautoescape %} diff --git a/templates/user_add_email.html b/templates/user_add_email.html index 879209a530..d546cb1804 100644 --- a/templates/user_add_email.html +++ b/templates/user_add_email.html @@ -1,19 +1,18 @@ -{% autoescape off %} -亲爱的 {{ email }}: +{% load i18n %}{% autoescape off %} {% if org %} -{{ user }} 在 SeaCloud 云存储上将您加入到企业 {{ org.org_name }}! +{% blocktrans %}You're receiving this e-mail because {{ user }} added you to organization "{{ org.org_name }}" on {{ site_name }}.{% endblocktrans%} {% else %} -{{ user }} 将您加入 SeaCloud 云存储! +{% blocktrans %}You're receiving this e-mail because {{ user }} added you to {{ site_name }}.{% endblocktrans%} {% endif %} -以下是您的登录信息: -用户名: {{ email }} -密码: {{ password }} +{% trans "Following is your account information:" %} +{% blocktrans %}Email: {{ email }}{% endblocktrans %} +{% blocktrans %}Password: {{ password }}{% endblocktrans %} -请点击以下链接登录: +{% trans "Please go to the following page and log in:" %} {{ protocol }}://{{ domain }}{% url auth_login %} -感谢使用我们的网站! +{% trans "Thanks for using our site!" %} -Seafile团队 +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} {% endautoescape %} diff --git a/templates/user_reset_email.html b/templates/user_reset_email.html index cab9167818..e8582e4539 100644 --- a/templates/user_reset_email.html +++ b/templates/user_reset_email.html @@ -1,9 +1,10 @@ -{% autoescape off %} -亲爱的 {{ email }}: -管理员已经将您的密码重置为{{ password }},登录后,请尽快修改您的密码! +{% load i18n %}{% autoescape off %} +{% blocktrans %}You're receiving this e-mail because staff has reset your password at {{ site_name }}. {% endblocktrans %} -感谢使用我们的网站! +{% blocktrans %}Your new password is {{ password }}, please modify your password as soon as possible.{% endblocktrans %} -Seafile团队 +{% trans "Thanks for using our site!" %} + +{% blocktrans %}The {{ site_name }} team{% endblocktrans %} {% endautoescape %} diff --git a/views.py b/views.py index 9785925401..f8fc6f3e01 100644 --- a/views.py +++ b/views.py @@ -416,7 +416,7 @@ def render_recycle_dir(request, repo_id, commit_id): @ctx_switch_required def repo_recycle_view(request, repo_id): if get_user_permission(request, repo_id) != 'rw': - return render_permission_error(request, '无法查看文件回收站') + return render_permission_error(request, _(u'Unable to view recycle page')) commit_id = request.GET.get('commit_id', '') if not commit_id: @@ -915,6 +915,11 @@ def myhome(request): if is_registered_user(c.contact_email) ] else: allow_public_share = True + + # Clear org messages just in case. Should never happen in production + # environment. + orgmsg_list = [] + # List all personal groups and all registered users for autocompletion. autocomp_groups = get_personal_groups(-1, -1) contacts = [] @@ -1203,7 +1208,7 @@ def repo_view_file(request, repo_id): obj_id = None if not obj_id: - return render_error(request, '文件不存在') + return render_error(request, _(u'File not exists')) repo = get_repo(repo_id) if not repo: @@ -1223,7 +1228,7 @@ def repo_view_file(request, repo_id): 'view', request.user.username) else: - return render_permission_error(request, '无法查看该文件') + return render_permission_error(request, _(u'Unable to view file')) read_only = True if permission == 'r' else False @@ -1533,7 +1538,7 @@ def repo_file_edit(request, repo_id): return update_file_after_edit(request, repo_id) if get_user_permission(request, repo_id) != 'rw': - return render_permission_error(request, '无法编辑该文件') + return render_permission_error(request, _(u'Unable to edit file')) path = request.GET.get('p', '/') if path[-1] == '/': @@ -1552,13 +1557,13 @@ def repo_file_edit(request, repo_id): except: obj_id = None if not obj_id: - return render_error(request, '文件不存在') + return render_error(request, _(u'File not exists')) if access_to_repo(request, repo_id, ''): token = seafserv_rpc.web_get_access_token(repo_id, obj_id, 'view', request.user.username) else: - return render_permission_error(request, '无法查看该文件') + return render_permission_error(request, _(u'Unable to view file')) # generate path and link zipped = gen_path_link(path, repo.name) @@ -1621,7 +1626,7 @@ def repo_access_file(request, repo_id, obj_id): token = seafserv_rpc.web_get_access_token(repo_id, obj_id, op, request.user.username) else: - return render_permission_error(request, '无法访问文件') + return render_permission_error(request, _(u'Unable to access file')) redirect_url = gen_file_get_url(token, file_name) return HttpResponseRedirect(redirect_url) @@ -1896,6 +1901,7 @@ def send_user_reset_email(request, email, password): c = { 'email': email, 'password': password, + 'site_name': settings.SITE_NAME, } try: send_mail(_(u'Password Reset'), t.render(Context(c)), @@ -1937,6 +1943,7 @@ def send_user_add_mail(request, email, password): 'password': password, 'domain': domain, 'protocol': use_https and 'https' or 'http', + 'site_name': settings.SITE_NAME, } try: send_mail(_(u'Seafile Registration Information'), t.render(Context(c)),