diff --git a/admin/file-upload-js.php b/admin/file-upload-js.php index e4606ee5..75df115a 100644 --- a/admin/file-upload-js.php +++ b/admin/file-upload-js.php @@ -23,7 +23,7 @@ $(document).ready(function() { } $val = number_format(ceil($val / (1024 *1024))); - _e('附件上传失败, 请确认附件尺寸没有超过 %s 并且服务器附件目录可以写入', "{$val}Mb"); ?>', + _e('文件上传失败, 请确认文件尺寸没有超过 %s 并且服务器文件目录可以写入', "{$val}Mb"); ?>', loading = $('') .appendTo(document.body); @@ -61,7 +61,7 @@ $(document).ready(function() { echo json_encode($types); ?>, - typesError : '', + typesError : '', onUpload : fileUploadStart, onError : function (id) { $('#' + id).remove(); @@ -125,13 +125,13 @@ $(document).ready(function() { } $val = number_format(ceil($val / (1024 *1024))); - _e('附件尺寸不能超过 %s', "{$val}Mb"); ?>'); + _e('文件尺寸不能超过 %s', "{$val}Mb"); ?>'); break; case 'FileTypeNotAllowed': // The file type is not in the specified list 'allowedfiletypes' break; case 'FileExtensionNotAllowed': - alert(''.replace('%s', file.name)); + alert(''.replace('%s', file.name)); break; default: break; @@ -176,7 +176,7 @@ $(document).ready(function() { function attachDeleteEvent (el) { var file = $('a.file', el).text(); $('.delete', el).click(function () { - if (confirm(''.replace('%s', file))) { + if (confirm(''.replace('%s', file))) { var cid = $(this).parents('li').data('cid'); $.post('index('/action/contents-attachment-edit'); ?>', {'do' : 'delete', 'cid' : cid}, diff --git a/admin/js/markdown.js b/admin/js/markdown.js index f3ee7ac5..ad3e333b 100644 --- a/admin/js/markdown.js +++ b/admin/js/markdown.js @@ -3061,6 +3061,9 @@ else redo: "Redo - Ctrl+Y", redomac: "Redo - Ctrl+Shift+Z", + ok: "OK", + cancel: "Cancel", + help: "Markdown Editing Help" }; @@ -4076,7 +4079,7 @@ else // callback: The function which is executed when the prompt is dismissed, either via OK or Cancel. // It receives a single argument; either the entered text (if OK was chosen) or null (if Cancel // was chosen). - ui.prompt = function (text, defaultInputText, callback) { + ui.prompt = function (text, defaultInputText, callback, ok, cancel) { // These variables need to be declared at this level since they are used // in multiple functions. @@ -4172,7 +4175,7 @@ else okButton.type = "button"; okButton.className = "btn-s primary"; okButton.onclick = function () { return close(false); }; - okButton.innerHTML = "OK"; + okButton.innerHTML = ok; /* style = okButton.style; style.margin = "10px"; @@ -4185,7 +4188,7 @@ else cancelButton.type = "button"; cancelButton.className = "btn-s"; cancelButton.onclick = function () { return close(true); }; - cancelButton.innerHTML = "Cancel"; + cancelButton.innerHTML = cancel; /* style = cancelButton.style; style.margin = "10px"; @@ -4806,11 +4809,11 @@ else if (isImage) { if (!this.hooks.insertImageDialog(linkEnteredCallback)) - ui.prompt(this.getString("imagedialog"), imageDefaultText, linkEnteredCallback); + ui.prompt(this.getString("imagedialog"), imageDefaultText, linkEnteredCallback, this.getString("ok"), this.getString("cancel")); } else { if (!this.hooks.insertLinkDialog(linkEnteredCallback)) - ui.prompt(this.getString("linkdialog"), linkDefaultText, linkEnteredCallback); + ui.prompt(this.getString("linkdialog"), linkDefaultText, linkEnteredCallback, this.getString("ok"), this.getString("cancel")); } return true; } diff --git a/admin/manage-medias.php b/admin/manage-medias.php index 36bd7674..80296fca 100644 --- a/admin/manage-medias.php +++ b/admin/manage-medias.php @@ -20,7 +20,7 @@ $stat = Typecho_Widget::widget('Widget_Stat');
@@ -78,7 +78,7 @@ $stat = Typecho_Widget::widget('Widget_Stat'); -
+
diff --git a/admin/media.php b/admin/media.php index 92aa632c..993d4a4f 100644 --- a/admin/media.php +++ b/admin/media.php @@ -58,7 +58,7 @@ $(document).ready(function() { } $val = number_format(ceil($val / (1024 *1024))); - _e('附件上传失败, 请确认附件尺寸没有超过 %s 并且服务器附件目录可以写入', "{$val}Mb"); ?>', + _e('文件上传失败, 请确认文件尺寸没有超过 %s 并且服务器文件目录可以写入', "{$val}Mb"); ?>', loading = $('') .appendTo(document.body); @@ -82,7 +82,7 @@ $(document).ready(function() { } function fileUploadComplete (id, url, data) { - $('#' + id).html(''.replace('%s', data.title)) + $('#' + id).html(''.replace('%s', data.title)) .effect('highlight', 1000, function () { $(this).remove(); window.location.reload(); @@ -92,7 +92,7 @@ $(document).ready(function() { $('.upload-file').fileUpload({ url : 'index('/action/upload?do=modify&cid=' . $attachment->cid); ?>', types : ['.attachment->type(); ?>'], - typesError : '', + typesError : '', onUpload : fileUploadStart, onError : function (id) { $('#' + id).remove(); @@ -146,13 +146,13 @@ $(document).ready(function() { } $val = number_format(ceil($val / (1024 *1024))); - _e('附件尺寸不能超过 %s', "{$val}Mb"); ?>'); + _e('文件尺寸不能超过 %s', "{$val}Mb"); ?>'); break; case 'FileTypeNotAllowed': // The file type is not in the specified list 'allowedfiletypes' break; case 'FileExtensionNotAllowed': - alert(''.replace('%s', file.name)); + alert(''.replace('%s', file.name)); break; default: break; diff --git a/admin/write-js.php b/admin/write-js.php index cb2880e5..32b4ca94 100644 --- a/admin/write-js.php +++ b/admin/write-js.php @@ -197,6 +197,12 @@ $(document).ready(function () { redo: ' - Ctrl+Y', redomac: ' - Ctrl+Shift+Z', + imagedialog: '

', + linkdialog: '

', + + ok: '', + cancel: '', + help: '' }; diff --git a/var/Widget/Contents/Attachment/Admin.php b/var/Widget/Contents/Attachment/Admin.php index 6f264bb8..77e31acc 100644 --- a/var/Widget/Contents/Attachment/Admin.php +++ b/var/Widget/Contents/Attachment/Admin.php @@ -1,6 +1,6 @@ select()->where('table.contents.type = ?', 'attachment'); - /** 如果具有编辑以上权限,可以查看所有附件,反之只能查看自己的附件 */ + /** 如果具有编辑以上权限,可以查看所有文件,反之只能查看自己的文件 */ if (!$this->user->pass('editor', true)) { $select->where('table.contents.authorId = ?', $this->user->uid); } diff --git a/var/Widget/Contents/Attachment/Edit.php b/var/Widget/Contents/Attachment/Edit.php index f79a4437..932629a6 100644 --- a/var/Widget/Contents/Attachment/Edit.php +++ b/var/Widget/Contents/Attachment/Edit.php @@ -24,7 +24,7 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen * 获取页面偏移的URL Query * * @access protected - * @param integer $cid 附件id + * @param integer $cid 文件id * @param string $status 状态 * @return string */ @@ -54,7 +54,7 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen ->limit(1), array($this, 'push')); if (!$this->have()) { - throw new Typecho_Widget_Exception(_t('附件不存在'), 404); + throw new Typecho_Widget_Exception(_t('文件不存在'), 404); } else if ($this->have() && !$this->allow('edit')) { throw new Typecho_Widget_Exception(_t('没有编辑权限'), 403); } @@ -62,10 +62,10 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen } /** - * 判断附件名转换到缩略名后是否合法 + * 判断文件名转换到缩略名后是否合法 * * @access public - * @param string $name 附件名 + * @param string $name 文件名 * @return boolean */ public function nameToSlug($name) @@ -81,7 +81,7 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen } /** - * 判断附件缩略名是否存在 + * 判断文件缩略名是否存在 * * @access public * @param string $slug 缩略名 @@ -116,18 +116,18 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen $form = new Typecho_Widget_Helper_Form(Typecho_Common::url('/action/contents-attachment-edit', $this->options->index), Typecho_Widget_Helper_Form::POST_METHOD); - /** 附件名称 */ + /** 文件名称 */ $name = new Typecho_Widget_Helper_Form_Element_Text('name', NULL, $this->title, _t('标题 *')); $form->addInput($name); - /** 附件缩略名 */ + /** 文件缩略名 */ $slug = new Typecho_Widget_Helper_Form_Element_Text('slug', NULL, $this->slug, _t('缩略名'), - _t('附件缩略名用于创建友好的链接形式,建议使用字母,数字,下划线和横杠.')); + _t('文件缩略名用于创建友好的链接形式,建议使用字母,数字,下划线和横杠.')); $form->addInput($slug); - /** 附件描述 */ + /** 文件描述 */ $description = new Typecho_Widget_Helper_Form_Element_Textarea('description', NULL, $this->attachment->description, - _t('描述'), _t('此文字用于描述附件,在有的主题中它会被显示.')); + _t('描述'), _t('此文字用于描述文件,在有的主题中它会被显示.')); $form->addInput($description); /** 分类动作 */ @@ -144,19 +144,19 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen $delete = new Typecho_Widget_Helper_Layout('a', array('href' => Typecho_Common::url('/action/contents-attachment-edit?do=delete&cid=' . $this->cid, $this->options->index), 'class' => 'operate-delete', - 'lang' => _t('你确认删除附件 %s 吗?', $this->attachment->name))); - $submit->container($delete->html(_t('删除附件'))); + 'lang' => _t('你确认删除文件 %s 吗?', $this->attachment->name))); + $submit->container($delete->html(_t('删除文件'))); $form->addItem($submit); - $name->addRule('required', _t('必须填写附件标题')); - $name->addRule(array($this, 'nameToSlug'), _t('附件标题无法被转换为缩略名')); + $name->addRule('required', _t('必须填写文件标题')); + $name->addRule(array($this, 'nameToSlug'), _t('文件标题无法被转换为缩略名')); $slug->addRule(array($this, 'slugExists'), _t('缩略名已经存在')); return $form; } /** - * 更新附件 + * 更新文件 * * @access public * @return void @@ -195,8 +195,8 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen /** 提示信息 */ $this->widget('Widget_Notice')->set('publish' == $this->status ? - _t('附件 %s 已经被更新', $this->permalink, $this->title) : - _t('未归档附件 %s 已经被更新', $this->title), NULL, 'success'); + _t('文件 %s 已经被更新', $this->permalink, $this->title) : + _t('未归档文件 %s 已经被更新', $this->title), NULL, 'success'); } @@ -246,11 +246,11 @@ class Widget_Contents_Attachment_Edit extends Widget_Contents_Post_Edit implemen } if ($this->request->isAjax()) { - $this->response->throwJson($deleteCount > 0 ? array('code' => 200, 'message' => _t('附件已经被删除')) - : array('code' => 500, 'message' => _t('没有附件被删除'))); + $this->response->throwJson($deleteCount > 0 ? array('code' => 200, 'message' => _t('文件已经被删除')) + : array('code' => 500, 'message' => _t('没有文件被删除'))); } else { /** 设置提示信息 */ - $this->widget('Widget_Notice')->set($deleteCount > 0 ? _t('附件已经被删除') : _t('没有附件被删除'), NULL, + $this->widget('Widget_Notice')->set($deleteCount > 0 ? _t('文件已经被删除') : _t('没有文件被删除'), NULL, $deleteCount > 0 ? 'success' : 'notice'); /** 返回原网页 */ diff --git a/var/Widget/Contents/Attachment/Related.php b/var/Widget/Contents/Attachment/Related.php index 3246fb9c..1e28f636 100644 --- a/var/Widget/Contents/Attachment/Related.php +++ b/var/Widget/Contents/Attachment/Related.php @@ -1,6 +1,6 @@ select()->where('table.contents.type = ?', 'attachment'); - //order字段在附件里代表所属文章 + //order字段在文件里代表所属文章 $select->where('table.contents.parent = ?', $this->parameter->parentId); /** 提交查询 */ diff --git a/var/Widget/Contents/Attachment/Unattached.php b/var/Widget/Contents/Attachment/Unattached.php index f38120d2..e7717052 100644 --- a/var/Widget/Contents/Attachment/Unattached.php +++ b/var/Widget/Contents/Attachment/Unattached.php @@ -1,6 +1,6 @@