mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
Modified upload/update and group i18n
This commit is contained in:
@@ -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)'),
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user