diff --git a/group/forms.py b/group/forms.py index d9ac8bc167..aa8c58b367 100644 --- a/group/forms.py +++ b/group/forms.py @@ -3,6 +3,7 @@ import os from django import forms +from django.utils.translation import ugettext_lazy as _ from seahub.utils import validate_group_name class MessageForm(forms.Form): @@ -24,13 +25,13 @@ class GroupAddForm(forms.Form): A form used to add a new group. """ group_name = forms.CharField(max_length=255, error_messages={ - 'required': u'群组名称不能为空', - 'max_length': u'群组名称太长,不超过255个字符', + 'required': _(u'Group name can\'t be empty'), + 'max_length': _(u'Group name is too long (maximum is 255 characters)'), }) def clean_group_name(self): group_name = self.cleaned_data['group_name'] if not validate_group_name(group_name): - error_msg = u'群组名称只能包含中英文字符,数字及下划线。' + error_msg = _(u'Group name can only contain letters, numbers or underline') raise forms.ValidationError(error_msg) else: return group_name @@ -40,7 +41,7 @@ class GroupJoinMsgForm(forms.Form): A form used to send group join request message. """ group_join_msg = forms.CharField(max_length=255, error_messages={ - 'required': u'验证信息不能为空', - 'max_length': u'验证信息太长,不超过255个字符', + 'required': _(u'Verification message can\'t be empty'), + 'max_length': _(u'Verification message is too long (maximun is 255 characters)'), }) diff --git a/group/locale/zh_CN/LC_MESSAGES/django.mo b/group/locale/zh_CN/LC_MESSAGES/django.mo index b83a461090..c8bf746dc5 100644 Binary files a/group/locale/zh_CN/LC_MESSAGES/django.mo and b/group/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/group/locale/zh_CN/LC_MESSAGES/django.po b/group/locale/zh_CN/LC_MESSAGES/django.po index e101c5d11f..6ab83cdd6e 100644 --- a/group/locale/zh_CN/LC_MESSAGES/django.po +++ b/group/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-03 11:50+0800\n" +"POT-Creation-Date: 2012-11-05 16:43+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -57,6 +57,26 @@ msgstr "只有群组管理员可以删除成员。" msgid "Can not remove myself" msgstr "无法删除自己" +#: forms.py:28 +msgid "Group name can't be empty" +msgstr "群组名称不能为空" + +#: forms.py:29 +msgid "Group name is too long (maximum is 255 characters)" +msgstr "群组名称太长,不超过255个字符" + +#: forms.py:34 +msgid "Group name can only contain letters, numbers or underline" +msgstr "群组名称只能包含中英文字符,数字及下划线。" + +#: forms.py:44 +msgid "Verification message can't be empty" +msgstr "验证信息不能为空" + +#: forms.py:45 +msgid "Verification message is too long (maximun is 255 characters)" +msgstr "验证信息太长,不超过255个字符" + #: views.py:94 msgid "There is already a group with that name." msgstr "已有同名群组" @@ -288,7 +308,7 @@ msgstr "取消共享" msgid "Messages" msgstr "信息栏" -#: templates/group/group_info.html:120 +#: templates/group/group_info.html:120 templates/group/group_pubinfo.html:24 #: templates/group/groups_right_panel.html:33 #: templates/group/grpmember_add_form.html:12 #: templates/group/grpmember_add_form.html:19 @@ -416,6 +436,31 @@ msgstr "添加管理员" msgid "Really want to dismiss this group?" msgstr "确定要解散该群组?" +#: templates/group/group_pubinfo.html:9 +msgid "Join Group" +msgstr "申请加入" + +#: templates/group/group_pubinfo.html:13 +msgid "Name: " +msgstr "名字:" + +#: templates/group/group_pubinfo.html:14 +#: templates/group/groups_right_panel.html:17 +msgid "Creator: " +msgstr "创建者:" + +#: templates/group/group_pubinfo.html:15 +msgid "Create at: " +msgstr "创建于:" + +#: templates/group/group_pubinfo.html:16 +msgid "Members: " +msgstr "成员数:" + +#: templates/group/group_pubinfo.html:21 +msgid "Verification Message" +msgstr "验证消息" + #: templates/group/group_reply_list.html:17 msgid "It can not be blank and should be no more than 150 characters." msgstr "输入不能为空且应少于150个字符。" @@ -441,10 +486,6 @@ msgstr "我的群组" msgid "New Group" msgstr "新建群组" -#: templates/group/groups_right_panel.html:17 -msgid "Creator: " -msgstr "创建者:" - #: templates/group/groups_right_panel.html:18 msgid "Time: " msgstr "创建时间:" diff --git a/group/templates/group/group_pubinfo.html b/group/templates/group/group_pubinfo.html index f1ca0afe69..bb73bbf1de 100644 --- a/group/templates/group/group_pubinfo.html +++ b/group/templates/group/group_pubinfo.html @@ -1,27 +1,27 @@ {% extends "myhome_base.html" %} -{% load seahub_tags group_avatar_tags %} +{% load seahub_tags group_avatar_tags i18n %} {% load url from future %} {% block main_panel %}
-
+

- +
{% endblock %} @@ -32,6 +32,9 @@ $('#add').click(function() { }); $('#group-join-submit').click(function() { + var self = $(this); + self.attr('disabled', 'disabled'); + $.ajax({ url: '{% url 'group_joinrequest' group.id %}', type: 'POST', @@ -42,6 +45,7 @@ $('#group-join-submit').click(function() { 'group_join_msg': $('#id_group_join_msg').val(), }, success: function(data) { + self.removeAttr('disabled'); location.reload(true); }, error: function(data, textStatus, jqXHR) { @@ -53,6 +57,7 @@ $('#group-join-submit').click(function() { apply_form_error('group-join-form', value[0]); } }); + self.removeAttr('disabled'); } }); diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo index 751bdc1220..cc9ab6dddc 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 9a5f657957..571a90e4a5 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-05 14:20+0800\n" +"POT-Creation-Date: 2012-11-05 16:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -212,8 +212,7 @@ msgstr "未知错误" #: views.py:842 views.py:858 msgid "" "Failed to remove library. Only staff or owner can perform this operation." -msgstr "" -"删除资料库失败, 只有团体管理员或资料库创建者有权删除资料库。" +msgstr "删除资料库失败, 只有团体管理员或资料库创建者有权删除资料库。" #: views.py:1108 msgid "Failed to create repo" @@ -671,25 +670,25 @@ msgstr "已用空间" msgid "My Home" msgstr "我的页面" -#: templates/myhome_base.html:12 templates/org_base.html:12 -msgid "Public Library" -msgstr "公共资料" - -#: templates/myhome_base.html:16 templates/org_admin_base.html:14 +#: templates/myhome_base.html:11 templates/org_admin_base.html:14 #: templates/org_base.html:15 templates/pubinfo.html:22 msgid "Groups" msgstr "群组" -#: templates/myhome_base.html:19 templates/org_base.html:18 +#: templates/myhome_base.html:14 templates/org_base.html:18 #: templates/snippets/my_owned_repos.html:35 msgid "Share" msgstr "共享" -#: templates/myhome_base.html:22 +#: templates/myhome_base.html:17 msgid "Contacts" msgstr "通讯录" -#: templates/myhome_base.html:26 templates/org_base.html:21 +#: templates/myhome_base.html:21 templates/org_base.html:12 +msgid "Public Library" +msgstr "公共资料" + +#: templates/myhome_base.html:24 templates/org_base.html:21 msgid "Public Info" msgstr "公共信息" @@ -731,7 +730,8 @@ msgstr "小提示" #: templates/public_home.html:10 msgid "" -"Libraries marked as read-only can only be viewing, can not be downloaded." +"Libraries marked as read-only can only be viewed online, can not be " +"downloaded." msgstr "标记为只读的资料库只能查看,无法整个下载。" #: templates/public_home.html:15 @@ -1303,6 +1303,22 @@ msgstr "修改前" msgid "after modification" msgstr "修改后" +#: templates/update_file_error.html:6 +msgid "Update file " +msgstr "更新文件 " + +#: templates/update_file_error.html:14 templates/upload_file_error.html:10 +msgid "error: " +msgstr "失败:" + +#: templates/upload_file_error.html:6 +msgid "Upload file" +msgstr "上传文件" + +#: templates/upload_file_error.html:6 +msgid "to" +msgstr "到" + #: templates/userinfo.html:13 msgid "Profile" msgstr "设置" diff --git a/templates/public_home.html b/templates/public_home.html index 68c4287c5e..77d84b4af9 100644 --- a/templates/public_home.html +++ b/templates/public_home.html @@ -7,7 +7,7 @@ {% block left_panel %}

{% trans "Tips"%}

-

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

+

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

{% endblock %} diff --git a/templates/update_file_error.html b/templates/update_file_error.html index eb7d0f420f..845452cfae 100644 --- a/templates/update_file_error.html +++ b/templates/update_file_error.html @@ -1,9 +1,9 @@ {% extends base_template %} -{% load seahub_tags %} +{% load seahub_tags i18n %} {% block main_panel %}
-

更新文件 +

{% trans "Update file " %} {% for name, link in zipped %} {% if not forloop.last %} {{ name }} / @@ -11,7 +11,7 @@ {{ name }} {% endif %} {% endfor %} - 失败: + {% trans "error: " %}

{{ err_msg }}

diff --git a/templates/upload_file_error.html b/templates/upload_file_error.html index ec1a45705b..abfac98127 100644 --- a/templates/upload_file_error.html +++ b/templates/upload_file_error.html @@ -1,13 +1,13 @@ {% extends base_template %} -{% load seahub_tags %} +{% load seahub_tags i18n %} {% block main_panel %}
-

上传文件{% if filename %} {{ filename }} {% endif %}到 +

{% trans "Upload file" %} {% if filename %} {{ filename }} {% endif %} {% trans "to" %} {% for name, link in zipped %} {{ name }} / {% endfor %} - 失败: + {% trans "error: " %}

{{ err_msg }}