diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo index 0be0327c2e..d16c8b456f 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 4c6a212bee..42f12c3b7a 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-04 13:28+0800\n" +"POT-Creation-Date: 2012-11-05 11:53+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -140,20 +140,44 @@ msgstr "" msgid "简体中文" msgstr "" -#: views.py:1158 +#: views.py:1126 +msgid "Operation successful" +msgstr "操作成功" + +#: views.py:1128 +msgid "Operation failed" +msgstr "操作失败" + +#: views.py:1159 msgid "Failed to delete file." msgstr "删除文件出错。" -#: views.py:1165 +#: views.py:1166 #, python-format msgid "%s successfully deleted." msgstr "%s 删除成功。" -#: views.py:1167 +#: views.py:1168 #, python-format msgid "Internal error. Failed to delete %s." msgstr "内部错误。删除 %s 失败。" +#: views.py:1751 views.py:1761 +msgid "Remove share failed" +msgstr "取消共享失败" + +#: views.py:1757 +msgid "group id is not valid" +msgstr "group id 无效" + +#: views.py:1770 +msgid "Remove share successful" +msgstr "取消共享成功" + +#: views.py:2561 views.py:2569 +msgid "Remove successful" +msgstr "删除成功" + #: templates/404.html:6 msgid "Sorry, but the requested page could not be found." msgstr "对不起,你访问的页面不存在。" @@ -165,7 +189,7 @@ msgstr "添加新用户" #: templates/add_user_form.html:9 templates/sys_useradmin.html:15 #: templates/registration/login.html:8 #: templates/registration/registration_form.html:11 -#: templates/snippets/user_profile_html.html:27 +#: templates/snippets/user_profile_html.html:28 msgid "Email" msgstr "邮箱" @@ -195,7 +219,7 @@ msgstr "确认密码" #: templates/snippets/group_recommend_form.html:23 #: templates/snippets/repo_create_form.html:23 #: templates/snippets/repo_share_form.html:18 -#: templates/snippets/user_profile_html.html:33 +#: templates/snippets/user_profile_html.html:34 msgid "Submit" msgstr "提交" @@ -308,7 +332,7 @@ msgstr "海文互知" msgid "Contact Us" msgstr "联系我们" -#: templates/base.html:143 +#: templates/base.html:143 templates/snippets/myhome_extra_script.html:31 msgid "Really want to delete?" msgstr "确定要删除?" @@ -510,8 +534,8 @@ msgid "Creator: " msgstr "创建者:" #: templates/pubinfo.html:34 -msgid "Create Time: " -msgstr "创建时间:" +msgid "Time: " +msgstr "时间:" #: templates/pubinfo.html:40 msgid "" @@ -524,7 +548,8 @@ msgid "Tips" msgstr "小提示" #: templates/public_home.html:10 -msgid "Libraries mark as read-only can only be viewing, can not be downloaded." +msgid "" +"Libraries marked as read-only can only be viewing, can not be downloaded." msgstr "标记为只读的资料库只能查看,无法整个下载。" #: templates/public_home.html:15 @@ -580,10 +605,17 @@ msgstr "可读写" msgid "Read-Only" msgstr "只读" -#: templates/public_home.html:53 +#: templates/public_home.html:54 +msgid "No public library" +msgstr "当前没有公共资料" + +#: templates/public_home.html:55 msgid "" -"You can create a public library, others can view and download this library." -msgstr "你可以新建一个公开的资料库,网站内的其他人都可以查看下载这个资料库。" +"You can create a public library by clicking \"New Library\" button, others " +"can view and download this library." +msgstr "" +"你可以点击“新建资料库”按钮创建一个公开的资料库,网站内的其他人都可以查看下载" +"这个资料库。" #: templates/repo.html:11 msgid "" @@ -1378,8 +1410,8 @@ msgid "Shared By" msgstr "共享来源" #: templates/snippets/my_owned_repos.html:84 -msgid "Remove Share" -msgstr "取消共享" +msgid "Leave Share" +msgstr "退出共享" #: templates/snippets/my_owned_repos.html:91 msgid "No library is shared to you" @@ -1414,8 +1446,8 @@ msgid "Input cannot be empty" msgstr "输入不能为空" #: templates/snippets/myhome_extra_script.html:33 -msgid "Really remove this shared library?" -msgstr "确定要还原这个资料库?" +msgid "Really want to leave share?" +msgstr "确定要退出共享?" #: templates/snippets/repo_create_form.html:9 msgid "Share Permission" @@ -1450,18 +1482,24 @@ msgstr "Tip:必须是团体内成员或群组,输入 all 共享到公共资 msgid "Tip: type all to share to public library." msgstr "Tip:输入 all 共享到公共资料" -#: templates/snippets/user_profile_html.html:8 -msgid "Add as contact" +#: templates/snippets/user_profile_html.html:21 +msgid "Add to contacts" msgstr "加为联系人" -#: templates/snippets/user_profile_html.html:29 +#: templates/snippets/user_profile_html.html:30 msgid "Name(optional)" msgstr "名字(可选)" -#: templates/snippets/user_profile_html.html:31 +#: templates/snippets/user_profile_html.html:32 msgid "Note(optional)" msgstr "备注(可选)" +#~ msgid "Create Time: " +#~ msgstr "创建时间:" + +#~ msgid "Really remove this shared library?" +#~ msgstr "确定要取消共享这个资料库?" + #~ msgid "Personal Account" #~ msgstr "个人帐号" diff --git a/share/locale/zh_CN/LC_MESSAGES/django.mo b/share/locale/zh_CN/LC_MESSAGES/django.mo index 76bfbcc13d..a7b44a4c66 100644 Binary files a/share/locale/zh_CN/LC_MESSAGES/django.mo and b/share/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/share/locale/zh_CN/LC_MESSAGES/django.po b/share/locale/zh_CN/LC_MESSAGES/django.po index c77e99db17..f53cc0cb36 100644 --- a/share/locale/zh_CN/LC_MESSAGES/django.po +++ b/share/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-02 17:37+0800\n" +"POT-Creation-Date: 2012-11-05 11:43+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -147,7 +147,7 @@ msgstr "编辑" #: templates/repo/share_admin.html:56 templates/repo/share_admin.html.py:59 #: templates/repo/share_admin.html:63 templates/repo/share_admin.html.py:65 -msgid "Revoke" +msgid "Unshare" msgstr "取消共享" #: templates/repo/share_admin.html:74 @@ -158,8 +158,7 @@ msgstr "你还没有共享任何资料库" msgid "" "Share library to your friends and colleagues by clicking the \"Share\" icon " "near the library." -msgstr "" -"点击资料库旁的“共享”图标将你的资料库共享给你的朋友和同事。" +msgstr "点击资料库旁的“共享”图标将你的资料库共享给你的朋友和同事。" #: templates/repo/share_admin.html:79 msgid "Links" @@ -207,3 +206,5 @@ msgstr "权限修改失败" msgid "edit failed" msgstr "权限修改失败" +#~ msgid "Revoke" +#~ msgstr "取消共享" diff --git a/share/templates/repo/share_admin.html b/share/templates/repo/share_admin.html index 24fb6b7d68..acb40c939c 100644 --- a/share/templates/repo/share_admin.html +++ b/share/templates/repo/share_admin.html @@ -53,16 +53,16 @@ {{ repo.props.repo_desc }} {% if repo.props.share_type == 'group' %} - + {% endif %} {% if repo.props.share_type == 'personal' %} - + {% endif %} {% if repo.props.share_type == 'public' %} {% if not org %} - + {% else %} - + {% endif %} {% endif %} diff --git a/templates/pubinfo.html b/templates/pubinfo.html index abc77325ca..c487574b83 100644 --- a/templates/pubinfo.html +++ b/templates/pubinfo.html @@ -31,7 +31,7 @@

{{ group.props.group_name }}

{% trans "Creator: "%}{{ group.props.creator_name }}

-

{% trans "Create Time: "%}{{ group.props.timestamp|tsstr_sec }}

+

{% trans "Time: "%}{{ group.props.timestamp|tsstr_sec }}

{% endfor %} diff --git a/templates/public_home.html b/templates/public_home.html index d2807b7ed1..68c4287c5e 100644 --- a/templates/public_home.html +++ b/templates/public_home.html @@ -7,7 +7,7 @@ {% block left_panel %}

{% trans "Tips"%}

-

{% trans "Libraries mark as read-only can only be viewing, can not be downloaded."%}

+

{% trans "Libraries marked as read-only can only be viewing, can not be downloaded."%}

{% endblock %} @@ -19,10 +19,10 @@ {% trans "Name"%} - {% trans "Description"%} + {% trans "Description"%} {% trans "Last Update"%} {% trans "Share From"%} - {% trans "Operations"%} + {% trans "Operations"%} {% for repo in public_repos %} @@ -50,7 +50,10 @@ {% endfor %} {% else %} -

{% trans "You can create a public library, others can view and download this library."%}

+
+

{% trans "No public library" %}

+

{% blocktrans %}You can create a public library by clicking "New Library" button, others can view and download this library.{% endblocktrans %}

+
{% endif %} {% include "snippets/repo_create_form.html" %} diff --git a/templates/snippets/my_owned_repos.html b/templates/snippets/my_owned_repos.html index 87cf3499c1..481d41c235 100644 --- a/templates/snippets/my_owned_repos.html +++ b/templates/snippets/my_owned_repos.html @@ -81,7 +81,7 @@ {% if repo.user_perm == 'rw' %} {% trans {% endif %} - {% trans + {% trans {% endfor %} diff --git a/templates/snippets/myhome_extra_script.html b/templates/snippets/myhome_extra_script.html index da535fe67a..65d0c53d97 100644 --- a/templates/snippets/myhome_extra_script.html +++ b/templates/snippets/myhome_extra_script.html @@ -28,9 +28,9 @@ $(function() { } }); - addConfirmTo($('.repo-delete-btn')); + addConfirmTo($('.repo-delete-btn'), '{% trans "Really want to delete?" %}'); - addConfirmTo($('.unshare-btn'), '{% trans "Really remove this shared library?" %}'); + addConfirmTo($('.unshare-btn'), '{% trans "Really want to leave share?" %}'); $(".download-btn").click(function() { window.open('{{ SITE_ROOT }}seafile_access_check/?repo_id=' + $(this).attr('data')); diff --git a/templates/snippets/user_profile_html.html b/templates/snippets/user_profile_html.html index b24989e8c8..e09b1f6f41 100644 --- a/templates/snippets/user_profile_html.html +++ b/templates/snippets/user_profile_html.html @@ -4,9 +4,6 @@ {#if !$T.err_msg}
{$T.email} - {#if $T.new_user} - - {#/if}
@@ -19,6 +16,10 @@ {#if $T.user_intro}

{$T.user_intro}

{#/if} + + {#if $T.new_user} + + {#/if}
{#if $T.new_user} diff --git a/views.py b/views.py index b363f11e41..5c10913521 100644 --- a/views.py +++ b/views.py @@ -22,6 +22,7 @@ from django.shortcuts import render_to_response, redirect from django.template import Context, loader, RequestContext from django.template.loader import render_to_string from django.utils.hashcompat import md5_constructor +from django.utils.translation import ugettext as _ from django.views.decorators.csrf import csrf_protect from django.views.generic.base import TemplateView, TemplateResponseMixin from django.views.generic.edit import BaseFormView, FormMixin @@ -1122,10 +1123,9 @@ def public_repo_create(request): def unset_inner_pub_repo(request, repo_id): try: seafserv_threaded_rpc.unset_inner_pub_repo(repo_id) + messages.success(request, _('Operation successful')) except SearpcError: - pass - - messages.add_message(request, messages.INFO, '操作成功') + messages.error(request, _('Operation failed')) return HttpResponseRedirect(reverse('share_admin')) @@ -1748,17 +1748,17 @@ def repo_remove_share(request): to_email = request.GET.get('to', '') if request.user.username != from_email and \ request.user.username != to_email: - return render_permission_error(request, u'取消共享失败') + return render_permission_error(request, _(u'Remove share failed')) seafserv_threaded_rpc.remove_share(repo_id, from_email, to_email) else: try: group_id_int = int(group_id) except: - return render_error(request, u'group id 不是有效参数') + return render_error(request, _(u'group id is not valid')) if not check_group_staff(group_id_int, request.user) \ and request.user.username != from_email: - return render_permission_error(request, u'取消共享失败') + return render_permission_error(request, _(u'Remove share failed')) if is_org_group(group_id_int): org_id = get_org_id_by_group(group_id_int) @@ -1767,7 +1767,7 @@ def repo_remove_share(request): from group.views import group_unshare_repo group_unshare_repo(request, repo_id, group_id_int, from_email) - messages.add_message(request, messages.INFO, '操作成功') + messages.success(request, _('Remove share successful')) next = request.META.get('HTTP_REFERER', None) if not next: @@ -2558,7 +2558,7 @@ def remove_shared_link(request): if not next: next = reverse('share_admin') - messages.add_message(request, messages.INFO, u'删除成功') + messages.success(request, _(u'Remove successful')) return HttpResponseRedirect(next) @@ -2566,7 +2566,7 @@ def remove_shared_link(request): FileShare.objects.filter(token=token).delete() - msg = '删除成功' + msg = _('Remove successful') data = json.dumps([{'msg': msg}]) return HttpResponse(data, status=200, content_type=content_type)