1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

11.0 fix translation (#6544)

* remove useless translation (#6543)

* remove useless translation
This commit is contained in:
Michael An 2024-08-13 12:07:57 +08:00 committed by GitHub
parent c1fd9ddbe1
commit f4908fa201
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 16 additions and 18 deletions

View File

@ -57,7 +57,7 @@ class Plans extends Component {
assetQuota = (assetQuotaUnitCount) * currentPlan.asset_quota_unit;
totalAmount = assetQuotaUnitCount * currentPlan.price_per_asset_quota_unit;
} else {
toaster.danger(gettext('Internal Server Error.'));
toaster.danger(gettext('Internal Server Error'));
return;
}
@ -263,8 +263,8 @@ class Plans extends Component {
return this.renderAddUser();
} else if (paymentType === 'buy_quota') {
return this.renderBuyQuota();
} else {
toaster.danger(gettext('Internal Server Error.'));
} else {
toaster.danger(gettext('Internal Server Error'));
return;
}
}

View File

@ -9,13 +9,13 @@ import moment from 'moment';
const OPERATIONS =[
{
value: 'active',
text: gettext('active'),
text: gettext('Active'),
is_active: true,
isSelected: false,
},
{
value: 'inactive',
text: gettext('inactive'),
text: gettext('Inactive'),
is_active: false,
isSelected: false,
},

View File

@ -239,7 +239,7 @@ class Account(APIView):
if space_quota_mb < 0:
return api_error(status.HTTP_400_BAD_REQUEST,
_('Space quota is too low (minimum value is 0)'))
'Space quota is too low (minimum value is 0)')
if is_org_context(request):
org_id = request.user.org.org_id
@ -247,7 +247,7 @@ class Account(APIView):
get_file_size_unit('MB')
if space_quota_mb > org_quota_mb:
return api_error(status.HTTP_400_BAD_REQUEST, \
_('Failed to set quota: maximum quota is %d MB' % org_quota_mb))
'Failed to set quota: maximum quota is %d MB' % org_quota_mb)
# argument check for is_trial
is_trial = request.data.get("is_trial", None)

View File

@ -174,7 +174,7 @@ class AdminUsersBatch(APIView):
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
if quota_total_mb < 0:
error_msg = _('Space quota is too low (minimum value is 0)')
error_msg = 'Space quota is too low (minimum value is 0)'
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
quota_total_byte = quota_total_mb * get_file_size_unit('MB')

View File

@ -83,6 +83,6 @@ class RepoAutoDeleteView(APIView):
repo_auto_delete, _ = RepoAutoDelete.objects.update_or_create(repo_id=repo_id, defaults={'days':auto_delete_days})
except Exception as e:
logger.error(e)
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, 'Internal Server Error.')
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, 'Internal Server Error')
return Response({'auto_delete_days':repo_auto_delete.days})

View File

@ -153,7 +153,7 @@ class SetUserQuotaForm(forms.Form):
"""
space_quota = forms.IntegerField(min_value=0,
error_messages={'required': _('Space quota can\'t be empty'),
'min_value': _('Space quota is too low (minimum value is 0)')})
'min_value': 'Space quota is too low (minimum value is 0)'})
class RepoSettingForm(forms.Form):
"""

View File

@ -175,7 +175,7 @@ class InstAdminUser(APIView):
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
if quota_total_mb < 0:
error_msg = _("Space quota is too low (minimum value is 0).")
error_msg = "Space quota is too low (minimum value is 0)."
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
quota = quota_total_mb * get_file_size_unit('MB')
@ -183,7 +183,7 @@ class InstAdminUser(APIView):
if available_quota is not None:
# None means has unlimit quota
if available_quota == 0 or available_quota < quota:
error_msg = _(f"Failed to set quota: maximum quota is {available_quota} MB")
error_msg = "Failed to set quota: maximum quota is %d MB" % available_quota
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
seafile_api.set_user_quota(email, quota)

View File

@ -240,7 +240,7 @@ def user_set_quota(request, email):
available_quota = get_institution_available_quota(request.user.institution)
if available_quota < quota:
result = {}
result['error'] = _('Failed to set quota: maximum quota is %d MB' % (available_quota / 10 ** 6))
result['error'] = 'Failed to set quota: maximum quota is %d MB' % (available_quota / 10 ** 6)
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
seafile_api.set_user_quota(email, quota)

View File

@ -468,7 +468,7 @@ class OrgAdminUser(APIView):
# -1 means org has unlimited quota
if org_quota > 0 and quota_total_mb > org_quota_mb:
error_msg = _(u'Failed to set quota: maximum quota is %d MB' % org_quota_mb)
error_msg = 'Failed to set quota: maximum quota is %d MB' % org_quota_mb
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
quota_total = int(quota_total_mb) * get_file_size_unit('MB')

View File

@ -4,7 +4,6 @@ import time
import json
from functools import wraps
from django.core.cache import cache
from django.utils.translation import gettext as _
from django.http import HttpResponse, HttpResponseBadRequest, \
HttpResponseForbidden
@ -84,7 +83,7 @@ def rate_limit(number=REQUEST_RATE_LIMIT_NUMBER,
cache.set(cache_key, data, timeout=period)
if data['count'] > number:
return HttpResponse(_("Too many requests"), status=429)
return HttpResponse("Too many requests", status=429)
return func(request, *args, **kwargs)
return wrapped

View File

@ -298,8 +298,7 @@ def user_set_quota(request, email):
org_id = org[0].org_id
org_quota_mb = seafserv_threaded_rpc.get_org_quota(org_id) / get_file_size_unit('MB')
if space_quota_mb > org_quota_mb:
result['error'] = _('Failed to set quota: maximum quota is %d MB' % \
org_quota_mb)
result['error'] = 'Failed to set quota: maximum quota is %d MB' % org_quota_mb
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
else:
seafile_api.set_org_user_quota(org_id, email, space_quota)