From 8c0b9cd4d8c8aaefdffc89597b49b4490ec4f00a Mon Sep 17 00:00:00 2001 From: zhengxie Date: Mon, 5 Nov 2012 14:35:37 +0800 Subject: [PATCH] i18n for views.py --- locale/zh_CN/LC_MESSAGES/django.mo | Bin 22164 -> 25650 bytes locale/zh_CN/LC_MESSAGES/django.po | 199 +++++++++++++++++++++++++++-- views.py | 120 ++++++++--------- 3 files changed, 249 insertions(+), 70 deletions(-) diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo index d16c8b456f2f705ecafc24bf8647369c5f987079..751bdc12205e3bd036aebcd6a36683d75b4985d7 100644 GIT binary patch delta 10582 zcmb8!2Yi%up2zVgBp@Y#^Z)`wsG(P-6N(fO1OiryLo$I#G81PKiku9cPy-GvfC37F z0s$F%6%|iBPmxm>%OZ=JNg_6EyX(rjpYJ^X#OUqq-94}S@&5n+&-3s9=b5axZhzFF zH=_JkYsRd%xH6(F>keF0#j*-Xe^FPZmX*`kvc};uyc@5g2b(vstT(l>dl>u#>~GXv%M8k+_Y509L{+SOIsT8r+Amcm%8CD_9;cV`aR8Rq-=q z?AA@x0B&IdR&UB+u_vnjB&>sOtV;jZA`+VUQ>cmuuo|96b#Mv$;K!&%iHoQJwJk(01t=)QTjd2I@iPWM!dNAP;r=pTmLpM{I}=e`|ZBeNZDB zk6PmCsFj(6>M##=CeEN{^fqch@0s!B&t9E6cRcd zvrv1q!ra(w@&{2fIft5Q0cxplqE;@tjXm=Q=pf$`bykL&^6^F|Y62Np3FqQ)z5h8R zHc)UGHR80k_JAHYF2c%`Z$!=TS=4hcpa%4k$)80H^mWt<+(6Cr8`Q+gx3kYwZPfin zSY7Xbd?djkGdBjJmUt*?q$5!sK49)oMm3y*+Jf0gAJ!^VM<-A#@CH`I53mY;idumi zsONsh>U#gHaKhA4L)6GxU^#4qs@NXuV^7o`CgD`{ptj-yC=!u%ZJ?PicP9{+eA446!*{Bs*X3RzH^?KBd_MyI*M^K08GFH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4aWDNzW*t$9`{&^XVhEvhornnJ z_|wjHjUPy5_$*88B1RF-34OIH-F0!E!`j@`)yiYAKQWyMqW&|h--3@2eTcDyQa0CH zA@97?PZgx^H2$+>{y}6Bm1z`-M+v1rh}VgK6Qzj8L^5rPV@*{0l&C}uCz?^$0hKlq z*+dL=b%`|MZORjgZG=(_t-mxE-k>mz$W^VSzws^NFXA0y2k|R0fw-4ykXc5wB*N&Y z8kR?;vo3+p8q~dHtt|5B zE0R!ppGYS^17{Ln5x)>e2=7upa)>X9pNQpz(jcO^b#R{iR-!GDOWmVbmr$xmxgEB! zwv)*}r3<8Qh*g0cKW^}A;(MYCQJx@a{qFyrNWpS+@(Q-Zd~8HqB|@$9`nZp>(z`@i z%607850vwWj)dDQ|Ii?>^e@5}$nn>a_La#uAfDDyPNAZJLOPL3{zX)ZA~GnS#8{#g z`M#+10PzBGKjER?QQS-ZDbd@5e0^dku1=2&_O(vf;)_qL?Awvp*xxOwipTdstpZ\n" "Language-Team: LANGUAGE \n" @@ -140,6 +140,85 @@ msgstr "" msgid "简体中文" msgstr "" +#: views.py:442 views.py:478 +msgid "Can not access library" +msgstr "无法访问该资料库" + +#: views.py:469 views.py:522 views.py:543 +msgid "Invalid url" +msgstr "非法链接" + +#: views.py:499 +msgid "Internal Server Error" +msgstr "服务器内部错误" + +#: views.py:501 +msgid "Filename contains invalid character" +msgstr "上传的文件名包含非法字符" + +#: views.py:503 +msgid "Duplicated filename" +msgstr "已存在同名的文件" + +#: views.py:505 +msgid "File not exists" +msgstr "文件不存在" + +#: views.py:507 +msgid "File size surpasses the limit" +msgstr "文件大小超过限制" + +#: views.py:509 +msgid "The space of owner is used up, upload failed" +msgstr "该资料库所有者的空间已用完,无法上传" + +#: views.py:511 +msgid "An error occurs during file transfer" +msgstr "文件传输出错" + +#: views.py:607 +msgid "Unable to view library modification" +msgstr "无法浏览该资料库修改历史" + +#: views.py:653 +msgid "Unable to view library snapshots" +msgstr "无法查看该资料库镜像" + +#: views.py:703 +msgid "You have no permission to restore library" +msgstr "你没有权限进行还原操作" + +#: views.py:719 +msgid "Please specify history ID" +msgstr "请指定历史记录ID" + +#: views.py:725 views.py:1490 views.py:1494 views.py:2336 views.py:2371 +#: views.py:2799 +msgid "Invalid arguments" +msgstr "非法参数" + +#: views.py:727 views.py:822 views.py:2284 +msgid "Library not exists" +msgstr "资料库不存在" + +#: views.py:729 +msgid "History you specified is not exists" +msgstr "指定的历史记录不存在" + +#: views.py:731 +msgid "Unknown error" +msgstr "未知错误" + +#: views.py:842 views.py:858 +msgid "" +"Failed to remove library. Only staff or owner can perform this operation." +msgstr "" +"删除资料库失败, 只有团体管理员或资料库创建者有权删除资料库。" + +#: views.py:1108 +msgid "Failed to create repo" +msgstr "创建失败" + #: views.py:1126 msgid "Operation successful" msgstr "操作成功" @@ -162,22 +241,125 @@ msgstr "%s 删除成功。" msgid "Internal error. Failed to delete %s." msgstr "内部错误。删除 %s 失败。" -#: views.py:1751 views.py:1761 +#: views.py:1446 +msgid "Unknown file encoding" +msgstr "文件编码无法识别" + +#: views.py:1475 +msgid "Internal Error" +msgstr "内部错误" + +#: views.py:1644 +msgid "Failed to download library, unable to find servre" +msgstr "下载失败:找不到服务器" + +#: views.py:1656 +msgid "Invalid server setting" +msgstr "服务器设置错误" + +#: views.py:1692 +#, 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 +msgid "copy" +msgstr "复制" + +#: views.py:1693 +msgid "move" +msgstr "移动" + +#: views.py:1709 +#, python-format +msgid "Successfully copying %(name)s:view" +msgstr "复制 %(name)s 成功:查看" + +#: views.py:1715 +#, python-format +msgid "Successfully moving %(name)s view" +msgstr "移动 %(name)s 成功:查看" + +#: views.py:1755 views.py:1765 msgid "Remove share failed" msgstr "取消共享失败" -#: views.py:1757 +#: views.py:1761 msgid "group id is not valid" msgstr "group id 无效" -#: views.py:1770 +#: views.py:1774 msgid "Remove share successful" msgstr "取消共享成功" -#: views.py:2561 views.py:2569 +#: views.py:1872 +msgid "Failed to set quota: internal error" +msgstr "内部错误,设置失败" + +#: views.py:1945 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:1947 views.py:1988 +msgid "Successfully sending mail" +msgstr "邮件发送成功" + +#: views.py:1949 views.py:1990 views.py:2611 +msgid "Failed to send mail" +msgstr "邮件发送失败" + +#: views.py:1960 +msgid "Successfully resetting password" +msgstr "密码重置成功" + +#: views.py:1965 +msgid "Failed to reset password: user does not exist" +msgstr "密码重置失败:用户不存在" + +#: views.py:1986 +msgid "Seafile Registration Information" +msgstr "Seafile注册信息" + +#: views.py:2202 +#, python-format +msgid "Successfully rename %(old)s to %(new)s。" +msgstr "%(old)s 已重命名为 %(new)s" + +#: views.py:2258 +msgid "Failed to create library" +msgstr "创建资料库失败" + +#: views.py:2357 +#, python-format +msgid "" +"Successfully revert %(path)s to root directory." +msgstr "成功还原 %(path)s 到根目录。" + +#: views.py:2361 views.py:2387 +#, python-format +msgid "Successfully revert %(path)s" +msgstr "成功还原 %(path)s" + +#: views.py:2383 +#, python-format +msgid "Successfully revert %(path)s to root directory." +msgstr "成功还原 %(path)s 到根目录。" + +#: views.py:2565 views.py:2573 msgid "Remove successful" msgstr "删除成功" +#: views.py:2607 +msgid "Your friend sharing a file to you on Seafile" +msgstr "您的好友通过Seafile分享了一个文件给您" + +#: views.py:2628 +msgid "Internal error" +msgstr "内部错误" + #: templates/404.html:6 msgid "Sorry, but the requested page could not be found." msgstr "对不起,你访问的页面不存在。" @@ -1101,13 +1283,6 @@ msgstr "已激活" msgid "Active" msgstr "激活" -#: 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 "密码重置" - #: templates/sys_useradmin.html:77 msgid "Really reset?" msgstr "确定要重置?" diff --git a/views.py b/views.py index 5c10913521..002ba59cb4 100644 --- a/views.py +++ b/views.py @@ -439,7 +439,7 @@ def repo_upload_file(request, repo_id): 'upload', request.user.username) else: - return render_permission_error(request, u'无法访问该资料库') + return render_permission_error(request, _(u'Can not access library')) no_quota = False if seafserv_threaded_rpc.check_quota(repo_id) < 0: @@ -466,7 +466,7 @@ def repo_update_file(request, repo_id): if request.method == 'GET': target_file = request.GET.get('p') if not target_file: - return render_error(request, u'非法链接') + return render_error(request, _(u'Invalid url')) zipped = gen_path_link (target_file, repo.name) if get_user_permission(request, repo_id) == 'rw': @@ -475,7 +475,7 @@ def repo_update_file(request, repo_id): 'update', request.user.username) else: - return render_permission_error(request, u'无法访问该资料库') + return render_permission_error(request, _(u'Can not access library')) no_quota = False if seafserv_threaded_rpc.check_quota(repo_id) < 0: @@ -496,19 +496,19 @@ def repo_update_file(request, repo_id): }, context_instance=RequestContext(request)) def upload_error_msg (code): - err_msg = u'服务器内部错误' + err_msg = _(u'Internal Server Error') if (code == 0): - err_msg = u'上传的文件名包含非法字符' + err_msg = _(u'Filename contains invalid character') elif (code == 1): - err_msg = u'已存在同名的文件' + err_msg = _(u'Duplicated filename') elif (code == 2): - err_msg = u'文件不存在' + err_msg = _(u'File not exists') elif (code == 3): - err_msg = u'文件大小超过限制' + err_msg = _(u'File size surpasses the limit') elif (code == 4): - err_msg = u'该资料库所有者的空间已用完,无法上传' + err_msg = _(u'The space of owner is used up, upload failed') elif (code == 5): - err_msg = u'文件传输出错' + err_msg = _(u'An error occurs during file transfer') return err_msg @ctx_switch_required @@ -519,7 +519,7 @@ def upload_file_error(request, repo_id): filename = request.GET.get('fn', '') err = request.GET.get('err') if not parent_dir or not err: - return render_error(request, u'非法链接') + return render_error(request, _(u'Invalid url')) zipped = gen_path_link (parent_dir, repo.name) @@ -540,7 +540,7 @@ def update_file_error(request, repo_id): target_file = request.GET.get('p') err = request.GET.get('err') if not target_file or not err: - return render_error(request, u'非法链接') + return render_error(request, _(u'Invalid url')) zipped = gen_path_link (target_file, repo.name) @@ -604,7 +604,7 @@ def repo_history(request, repo_id): View repo history. """ if not access_to_repo(request, repo_id, ''): - return render_permission_error(request, u'无法浏览该资料库修改历史') + return render_permission_error(request, _(u'Unable to view library modification')) repo = get_repo(repo_id) @@ -650,7 +650,7 @@ def repo_history(request, repo_id): @ctx_switch_required def repo_view_snapshot(request, repo_id): if not access_to_repo(request, repo_id, ''): - return render_permission_error(request, u'无法查看该资料库镜像') + return render_permission_error(request, _(u'Unable to view library snapshots')) repo = get_repo(repo_id) @@ -700,7 +700,7 @@ def repo_history_revert(request, repo_id): raise Http404 if not access_to_repo(request, repo_id): - return render_permission_error(request, u'您没有权限进行还原操作') + return render_permission_error(request, _(u'You have no permission to restore library')) password_set = False if repo.props.encrypted: @@ -716,19 +716,19 @@ def repo_history_revert(request, repo_id): commit_id = request.GET.get('commit_id', '') if not commit_id: - return render_error(request, u'请指定历史记录 ID') + return render_error(request, _(u'Please specify history ID')) try: seafserv_threaded_rpc.revert_on_server(repo_id, commit_id, request.user.username) except SearpcError, e: if e.msg == 'Bad arguments': - return render_error(request, u'非法参数') + return render_error(request, _(u'Invalid arguments')) elif e.msg == 'No such repo': - return render_error(request, u'资料库不存在') + return render_error(request, _(u'Library not exists')) elif e.msg == "Commit doesn't exist": - return render_error(request, u'指定的历史记录不存在') + return render_error(request, _(u'History you specified is not exists')) else: - return render_error(request, u'未知错误') + return render_error(request, _(u'Unknown error')) return HttpResponseRedirect(reverse(repo_history, args=[repo_id])) @@ -819,7 +819,7 @@ def modify_token(request, repo_id): def remove_repo(request, repo_id): repo = get_repo(repo_id) if not repo: - return render_error(request, u"该资料库不存在") + return render_error(request, _(u'Library not exists')) user = request.user.username org, base_template = check_and_get_org_by_repo(repo_id, user) @@ -839,7 +839,7 @@ def remove_repo(request, repo_id): repo_name=repo.name, ) else: - err_msg = u'删除资料库失败, 只有团体管理员或资料库创建者有权删除资料库。' + err_msg = _(u'Failed to remove library. Only staff or owner can perform this operation.') return render_permission_error(request, err_msg) else: # Remove repo in personal context, only repo owner or site staff can @@ -855,7 +855,7 @@ def remove_repo(request, repo_id): repo_name=repo.name, ) else: - err_msg = u'删除资料库失败, 只有管理员或资料库创建者有权删除资料库。' + err_msg = _(u'Failed to remove library. Only staff or owner can perform this operation.') return render_permission_error(request, err_msg) next = request.META.get('HTTP_REFERER', None) @@ -1105,7 +1105,7 @@ def public_repo_create(request): except: repo_id = None if not repo_id: - result['error'] = u"创建失败" + result['error'] = _(u'Failed to create repo') else: result['success'] = True repo_created.send(sender=None, @@ -1443,7 +1443,7 @@ def repo_file_get(raw_path): u_content = content.decode('gbk') encoding = 'gbk' except UnicodeDecodeError: - err = u'文件编码无法识别' + err = _(u'Unknown file encoding') return err, '', '', '' file_content = u_content @@ -1472,7 +1472,7 @@ def pdf_full_view(request): def update_file_after_edit(request, repo_id): content_type = 'application/json; charset=utf-8' - def error_json(error_msg=u"内部错误"): + def error_json(error_msg=_(u'Internal Error')): return HttpResponse(json.dumps({'error': error_msg}), status=400, content_type=content_type) @@ -1487,11 +1487,11 @@ def update_file_after_edit(request, repo_id): encoding = request.POST.get('encoding') path = request.GET.get('p') if content is None or not path: - return error_json(u"参数错误") + return error_json(_(u'Invalid arguments')) head_id = request.GET.get('head', None) if encoding not in ["gbk", "utf-8"]: - return error_json(u"参数错误") + return error_json(_(u'Invalid arguments')) content = content.encode(encoding) @@ -1641,7 +1641,7 @@ def repo_download(request): relay_id = ccnet_rpc.get_session_info().id if not relay_id: return render_to_response('error.html', { - "error_msg": u"下载失败:无法取得中继" + "error_msg": _(u"Failed to download library, unable to find servre") }, context_instance=RequestContext(request)) try: @@ -1653,7 +1653,7 @@ def repo_download(request): addr, port = get_ccnet_server_addr_port () if not (addr and port): - return render_error(request, u"服务器设置错误") + return render_error(request, _(u"Invalid server setting")) ccnet_applet_root = get_ccnetapplet_root() email = urllib2.quote(request.user.username) @@ -1689,8 +1689,10 @@ def file_move(request): if obj_type == 'dir': src_dir = os.path.join(src_path, obj_name) if dst_path.startswith(src_dir): - error_msg = u"不能把目录 %s %s到它的子目录 %s中" \ - % (src_dir, u"复制" if op == 'cp' else u"移动", dst_path) + error_msg = _(u'Can not %(op)s directory %(src)s to its subdirectory %(des)s') \ + % {'op': _(u"copy") if op == 'cp' else _(u"move"), + 'src': src_dir, + 'des': dst_path} #return render_error(request, error_msg) messages.add_message(request, messages.ERROR, error_msg) url = reverse('repo', args=[src_repo_id]) + ('?p=%s' % urllib2.quote(src_path.encode('utf-8'))) @@ -1704,12 +1706,14 @@ def file_move(request): seafserv_threaded_rpc.copy_file (src_repo_id, src_path, obj_name, dst_repo_id, dst_path, new_obj_name, request.user.username) - messages.add_message(request, messages.INFO, u'%s 复制成功:查看' % (obj_name, msg_url)) + messages.success(request, _(u'Successfully copying %(name)s:view') % \ + {"name":obj_name, "url":msg_url}) elif op == 'mv': seafserv_threaded_rpc.move_file (src_repo_id, src_path, obj_name, dst_repo_id, dst_path, new_obj_name, request.user.username) - messages.add_message(request, messages.INFO, u'%s 移动成功:查看' % (obj_name, msg_url)) + messages.success(request, _(u'Successfully moving %(name)s view') % \ + {"name":obj_name, "url":msg_url}) except Exception, e: return render_error(request, str(e)) @@ -1865,7 +1869,7 @@ def user_info(request, email): try: seafserv_threaded_rpc.set_user_quota(email, quota) except: - result['error'] = u'内部错误,设置失败' + result['error'] = _(u'Failed to set quota: internal error') return HttpResponse(json.dumps(result), content_type=content_type) result['success'] = True @@ -1938,11 +1942,11 @@ def send_user_reset_email(request, email, password): 'password': password, } try: - send_mail(u'密码重置', t.render(Context(c)), + send_mail(_(u'Password Reset'), t.render(Context(c)), None, [email], fail_silently=False) - messages.add_message(request, messages.INFO, '通知邮件已成功。') + messages.success(request, _(u'Successfully sending mail')) except: - messages.add_message(request, messages.ERROR, '邮件发送失败。') + messages.error(request, _(u'Failed to send mail')) @login_required @sys_staff_required @@ -1953,13 +1957,13 @@ def user_reset(request, user_id): user.set_password(INIT_PASSWD) user.save() - messages.add_message(request, messages.INFO, u'密码重置成功。') + messages.success(request, _(u'Successfully resetting password')) if hasattr(settings, 'EMAIL_HOST'): send_user_reset_email(request, user.email, INIT_PASSWD) except User.DoesNotExist: - msg =u'密码重置失败,用户不存在。' - messages.add_message(request, messages.ERROR, msg) + msg = _(u'Failed to reset password: user does not exist') + messages.error(request, msg) return HttpResponseRedirect(reverse('sys_useradmin')) @@ -1979,11 +1983,11 @@ def send_user_add_mail(request, email, password): 'protocol': use_https and 'https' or 'http', } try: - send_mail(u'SeaCloud注册信息', t.render(Context(c)), + send_mail(_(u'Seafile Registration Information'), t.render(Context(c)), None, [email], fail_silently=False) - messages.add_message(request, messages.INFO, '邮件发送成功。') + messages.success(request, _(u'Successfully sending mail')) except: - messages.add_message(request, messages.ERROR, '邮件发送失败。') + messages.error(request, _(u'Failed to send mail')) @login_required def user_add(request): @@ -2195,8 +2199,8 @@ def repo_rename_file(request): try: seafserv_threaded_rpc.rename_file (repo_id, parent_dir, oldname, newname, user) - messages.add_message(request, messages.INFO, u'%s 已重命名为 %s。' % \ - (oldname, newname)) + messages.success(request, _(u'Successfully rename %(old)s to %(new)s。') % \ + {"old":oldname, "new":newname}) except Exception, e: result['error'] = str(e) return HttpResponse(json.dumps(result), content_type=content_type) @@ -2251,7 +2255,7 @@ def repo_create(request): except: repo_id = None if not repo_id: - result['error'] = u"创建目录失败" + result['error'] = _(u"Failed to create library") else: result['success'] = True repo_created.send(sender=None, @@ -2277,7 +2281,7 @@ def render_file_revisions (request, repo_id): repo = get_repo(repo_id) if not repo: - error_msg = u"资料库不存在" + error_msg = _(u"Library not exists") return render_error(request, error_msg) try: @@ -2329,7 +2333,7 @@ def repo_revert_file (request, repo_id): from_page = request.GET.get('from') if not (commit_id and path and from_page): - return render_error(request, u"参数错误") + return render_error(request, _(u"Invalid arguments")) try: ret = seafserv_threaded_rpc.revert_file (repo_id, commit_id, @@ -2350,11 +2354,11 @@ def repo_revert_file (request, repo_id): if ret == 1: root_url = reverse('repo', args=[repo_id]) + u'?p=/' - msg = u'%s 已还原到根目录下' % (path.lstrip('/'), root_url) + msg = _(u'Successfully revert %(path)s to root directory.') % {"path":path.lstrip('/'), "root":root_url} messages.add_message(request, messages.INFO, msg) else: file_view_url = reverse('repo_view_file', args=[repo_id]) + u'?p=' + urllib2.quote(path.encode('utf-8')) - msg = u'%s 已经还原' % (file_view_url, path.lstrip('/')) + msg = _(u'Successfully revert %(path)s') % {"url":file_view_url, "path":path.lstrip('/')} messages.add_message(request, messages.INFO, msg) return HttpResponseRedirect(url) @@ -2364,7 +2368,7 @@ def repo_revert_dir (request, repo_id): path = request.GET.get('p') if not (commit_id and path): - return render_error(request, u"参数错误") + return render_error(request, _(u"Invalid arguments")) try: ret = seafserv_threaded_rpc.revert_dir (repo_id, commit_id, @@ -2376,11 +2380,11 @@ def repo_revert_dir (request, repo_id): if ret == 1: root_url = reverse('repo', args=[repo_id]) + u'?p=/' - msg = u'%s 已还原到根目录下' % (path.lstrip('/'), root_url) + msg = _(u'Successfully revert %(path)s to root directory.') % {"path":path.lstrip('/'), "url":root_url} messages.add_message(request, messages.INFO, msg) else: dir_view_url = reverse('repo', args=[repo_id]) + u'?p=' + urllib2.quote(path.encode('utf-8')) - msg = u'%s 已经还原' % (dir_view_url, path.lstrip('/')) + msg = _(u'Successfully revert %(path)s') % {"url":dir_view_url, "path":path.lstrip('/')} messages.add_message(request, messages.INFO, msg) return HttpResponseRedirect(url) @@ -2600,11 +2604,11 @@ def send_shared_link(request): } try: - send_mail('您的好友通过SeaCloud分享了一个文件给您', + send_mail(_(u'Your friend sharing a file to you on Seafile'), t.render(Context(c)), None, [to_email], fail_silently=False) except: - data = json.dumps({'error':u'发送失败'}) + data = json.dumps({'error':_(u'Failed to send mail')}) return HttpResponse(data, status=500, content_type=content_type) data = json.dumps("success") @@ -2621,7 +2625,7 @@ def flash_prepare(raw_path, obj_id, doctype): try: f = urllib2.urlopen(url=curl, data=urllib.urlencode(data)) except urllib2.URLError, e: - return u'内部错误', False + return _(u'Internal error'), False else: ret = f.read() ret_dict = json.loads(ret) @@ -2792,7 +2796,7 @@ def repo_star_file(request, repo_id): content_type = 'application/json; charset=utf-8' if not (path and state): - return HttpResponse(json.dumps({'success':False, 'err_msg':u'参数错误'}), + return HttpResponse(json.dumps({'success':False, 'err_msg':_(u'Invalid arguments')}), content_type=content_type) org_id = int(request.POST.get('org_id'))