diff --git a/README.md b/README.md index 6ba78a41..ab1b93f7 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,7 @@ Translations and contributors: - Portuguese ([yakko](https://github.com/yakko)) - Swedish ([stefanm](https://github.com/stefanm)) - Simplified Chinese ([董劭田 DONG Shaotian](https://github.com/richarddong)) +- Traditional Chinese ([Arthur CHAN](https://github.com/arthurtalkgoal)) - Hungarian ([egivandor](https://github.com/egivandor)) - Russian ([ilyacherevkov](https://github.com/ilyacherevkov)) diff --git a/app/assets/javascripts/mercury/locales/zh.local.js.coffee b/app/assets/javascripts/mercury/locales/zh.local.js.coffee deleted file mode 100644 index cc2cdbdf..00000000 --- a/app/assets/javascripts/mercury/locales/zh.local.js.coffee +++ /dev/null @@ -1,203 +0,0 @@ -Mercury.I18n['zh'] = - - _CN_: - # ## Javascript Strings - - # ### Default Configuration - "Save": "保存" - "Save this page": "保存本页" - "Preview": "预览" - "Preview this page": "预览本页" - "Undo": "撤销" - "Undo your last action": "撤销上一个操作" - "Redo": "重做" - "Redo your last action": "重做上一个操作" - "Link": "链接" - "Insert Link": "插入链接" - "Media": "多媒体" - "Insert Media (images and videos)": "插入多媒体(图片、视频)" - "Table": "表格" - "Insert Table": "插入表格" - "Character": "符号" - "Special Characters": "特殊符号" - "Snippet": "小片段" - "Snippet Panel": "小片段面板" - "History": "历史" - "Page Version History": "本页历史版本" - "Notes": "备忘" - "Page Notes": "本页备忘" - "Style": "样式" - "Block Format": "段落格式" - "Background Color": "背景颜色" - "Text Color": "文本颜色" - "Bold": "加粗" - "Italicize": "斜体" - "Overline": "上划线" - "Strikethrough": "删除线" - "Underline": "下划线" - "Subscript": "下标" - "Superscript": "上标" - "Align Left": "左对齐" - "Center": "居中" - "Align Right": "右对齐" - "Justify Full": "两端对齐" - "Unordered List": "无序列表" - "Numbered List": "有序列表" - "Decrease Indentation": "减小缩进" - "Increase Indentation": "增大缩进" - "Insert Table Row": "插入行" - "Insert a table row before the cursor": "在光标上方插入行" - "Insert a table row after the cursor": "在光标下方插入行" - "Delete Table Row": "删除行" - "Delete this table row": "删除本行" - "Insert Table Column": "插入列" - "Insert a table column before the cursor": "在光标左边插入列" - "Insert a table column after the cursor": "在光标右边插入列" - "Delete Table Column": "删除列" - "Delete this table column": "删除本列" - "Increase Cell Columns": "增加列数" - "Decrease Cell Columns": "减少列数" - "Increase Cell Rows": "增加行数" - "Decrease Cell Rows": "减少行数" - "Horizontal Rule": "分割线" - "Insert a horizontal rule": "插入分割线" - "Remove Formatting": "清除格式" - "Remove formatting for the selection": "清楚选中部分格式" - "Edit HTML": "编辑源代码(HTML)" - "Edit the HTML content": "编辑源代码 HTML 内容" - "Edit Snippet Settings": "编辑小片段设置" - "Remove Snippet": "删除小片段" - - # ### General - # Error Messages - "Mercury.Regions.%s is unsupported in this client. Supported browsers are %s.": "您的浏览器不支持 Mercury.Regions.%s,支持的浏览器包括:%s。" - "Mercury.PageEditor can only be instantiated once.": "Mercury.PageEditor 只能被实例化一次。" - "Opera isn't a fully supported browser, your results may not be optimal.": "Mercury 编辑器不完全支持 Opera 浏览器,您显示的内容可能并不完美。" - "Mercury.PageEditor failed to load: %s\n\nPlease try refreshing.": "Mercury.PageEditor 载入失败:%s\n\n请尝试刷新一下本页。" - "Region type is malformed, no data-type provided, or \"%s\" is unknown for the \"%s\" region.": "地区不正确,没有提供数据类型,或“%s”不在“%s”区域中。" - "Mercury was unable to save to the url: %s": "Mercury 无法保存至这一 URL:%s" - "invalid": "无效" - "can't be blank": "不能为空" - # Confirmations - "You have unsaved changes. Are you sure you want to leave without saving them first?": "您还有未保存的修改,确定要放弃修改并离开吗?" - - # ### Toolbar / Buttons - # Error Messages - "Unknown button type \"%s\" used for the \"%s\" button.": "未知的按钮类型“%s”被用于“%s”按钮。" - "Unknown button structure -- please provide an array, object, or string for \"%s\".": "未知的按钮结构——请给“%s”提供一个序列、对象或字符串。" - - # ### Modals / Dialogs / Etc. - # Error Messages - "Mercury was unable to load %s for the \"%s\" dialog.": "Mercury 编辑器无法载入 %s 至“%s”对话框。" - "Mercury was unable to load %s for the lightview.": "Mercury 编辑器无法载入 %s 至弹出区域。" - "Mercury was unable to load %s for the modal.": "Mercury 编辑器无法载入 %s 至弹出框。" - - # ### Snippets - # Error Messages - "Error loading the preview for the \"%s\" snippet.": "载入“%s”小片段预览时出错。" - # Misc - "Snippet Options": "小片段选项" - - # ### Uploader - # Error Messages - "Unable to process response: %s": "无法处理相应:%s" - "Error: Unable to upload the file": "错误:无法上传文件" - "Malformed response from server": "服务器响应格式有误" - "Too large": "上传文件过大" - "Unsupported format": "格式不受支持" - # Statuses - "Processing...": "处理中……" - "Uploading...": "上传中……" - "Aborted": "已中止" - "Successfully uploaded...": "上传成功……" - "Name: %s": "文件名:%s" - "Size: %s": "文件大小:%s" - "Type: %s": "文件类型:%s" - - # Statusbar - "Path:": "路径:" - - - # ## HTML / Template Strings - - # ### Modals - # Insert Link Modal (link.html) - "Link Content": "链接显示内容" - "Standard Links": "普通链接" - "URL": "网址" - "Index / Bookmark Links": "索引、书签链接" - "Existing Links": "已有链接" - "Bookmark": "书签" - "Options": "选项" - "Link Target": "链接目标窗口" - "Self (the same window or tab)": "本窗口中打开" - "Blank (a new window or tab)": "新窗口(或标签)中打开" - "Top (removes any frames)": "外层窗口中打开(去除帧框)" - "Popup Window (javascript new window popup)": "弹出窗口" - "Popup Width": "弹出窗口宽度" - "Popup Height": "弹出窗口高度" - - # Insert Media Modal (media.html) - "Images": "图片" - "Videos": "视频" - "YouTube URL": "YouTube 分享链接" - "Vimeo URL": "Vimeo 分享链接" - "Alignment": "对齐方式" - "None": "默认" - "Left": "左对齐" - "Right": "右对齐" - "Top": "顶对齐" - "Middle": "中对齐" - "Bottom": "底对齐" - "Absolute Middle": "绝对中对齐" - "Absolute Bottom": "绝对底对齐" - "Width": "宽度" - "Height": "高度" - "Insert Media": "插入多媒体" - - # Insert Table Modal (table.html) - "Rows": "行" - "Add Before": "前方插入" - "Add After": "后方插入" - "Remove": "删除" - "Columns": "列" - "Row Span": "行跨度" - "Column Span": "列跨度" - "Border": "边框线宽度" - "Spacing": "单元格间距" - - # HTML Editor Modal (htmleditor.html) - "HTML Editor": "HTML 编辑器" - "Save and Replace": "保存并替换" - - # ### Dialogs / Etc. - # Color Palettes (forecolor.html, backcolor.html) - "Last Color Picked": "上次选中的颜色" - - # Block Format Select (formatblock.html) - "Heading 1": "标题 1" - "Heading 2": "标题 2" - "Heading 3": "标题 3" - "Heading 4": "标题 4" - "Heading 5": "标题 5" - "Heading 6": "标题 6" - "Paragraph": "段落" - "Blockquote": "大段引用" - "Formatted": "预格式化" - - # About Mercury Panel (about.html) - "Project Home": "项目主页" - "Project Source": "项目源代码" - - # ### Demo / Placeholder / Defaults - "The history panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本历史面板需要与服务器后端共同实现。因为这是一个演示,所以我们没有加入这一功能。" - - "The notes panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本备忘面板需要与服务器后端共同实现。因为这是一个演示,所以我们没有加入这一功能。" - - "Snippet Name": "小片段名称" - "A one or two line long description of what this snippet does.": "用一两行描述一下这个小片段的功能" - - "First Name": "名字" - "Favorite Beer": "最喜欢的啤酒" - "Insert Snippet": "插入小片段" - diff --git a/app/assets/javascripts/mercury/locales/zh.locale.js.coffee b/app/assets/javascripts/mercury/locales/zh.locale.js.coffee new file mode 100644 index 00000000..587df588 --- /dev/null +++ b/app/assets/javascripts/mercury/locales/zh.locale.js.coffee @@ -0,0 +1,404 @@ +Mercury.I18n['zh'] = + + _CN_: + # ## Javascript Strings + + # ### Default Configuration + "Save": "保存" + "Save this page": "保存本页" + "Preview": "预览" + "Preview this page": "预览本页" + "Undo": "撤销" + "Undo your last action": "撤销上一个操作" + "Redo": "重做" + "Redo your last action": "重做上一个操作" + "Link": "链接" + "Insert Link": "插入链接" + "Media": "多媒体" + "Insert Media (images and videos)": "插入多媒体(图片、视频)" + "Table": "表格" + "Insert Table": "插入表格" + "Character": "符号" + "Special Characters": "特殊符号" + "Snippet": "小片段" + "Snippet Panel": "小片段面板" + "History": "历史" + "Page Version History": "本页历史版本" + "Notes": "备忘" + "Page Notes": "本页备忘" + "Style": "样式" + "Block Format": "段落格式" + "Background Color": "背景颜色" + "Text Color": "文本颜色" + "Bold": "加粗" + "Italicize": "斜体" + "Overline": "上划线" + "Strikethrough": "删除线" + "Underline": "下划线" + "Subscript": "下标" + "Superscript": "上标" + "Align Left": "左对齐" + "Center": "居中" + "Align Right": "右对齐" + "Justify Full": "两端对齐" + "Unordered List": "无序列表" + "Numbered List": "有序列表" + "Decrease Indentation": "减小缩进" + "Increase Indentation": "增大缩进" + "Insert Table Row": "插入行" + "Insert a table row before the cursor": "在光标上方插入行" + "Insert a table row after the cursor": "在光标下方插入行" + "Delete Table Row": "删除行" + "Delete this table row": "删除本行" + "Insert Table Column": "插入列" + "Insert a table column before the cursor": "在光标左边插入列" + "Insert a table column after the cursor": "在光标右边插入列" + "Delete Table Column": "删除列" + "Delete this table column": "删除本列" + "Increase Cell Columns": "增加列数" + "Decrease Cell Columns": "减少列数" + "Increase Cell Rows": "增加行数" + "Decrease Cell Rows": "减少行数" + "Horizontal Rule": "分割线" + "Insert a horizontal rule": "插入分割线" + "Remove Formatting": "清除格式" + "Remove formatting for the selection": "清除选中部分格式" + "Edit HTML": "编辑源代码(HTML)" + "Edit the HTML content": "编辑源代码 HTML 内容" + "Edit Snippet Settings": "编辑代码设置" + "Remove Snippet": "删除代码" + + # ### General + # Error Messages + "Mercury.Regions.%s is unsupported in this client. Supported browsers are %s.": "您的浏览器不支持 Mercury.Regions.%s,支持的浏览器包括:%s。" + "Mercury.PageEditor can only be instantiated once.": "Mercury.PageEditor 只能被实例化一次。" + "Opera isn't a fully supported browser, your results may not be optimal.": "Mercury 编辑器不完全支持 Opera 浏览器,您显示的内容可能并不完美。" + "Mercury.PageEditor failed to load: %s\n\nPlease try refreshing.": "Mercury.PageEditor 载入失败:%s\n\n请尝试刷新一下本页。" + "Region type is malformed, no data-type provided, or \"%s\" is unknown for the \"%s\" region.": "地区不正确,没有提供数据类型,或“%s”不在“%s”区域中。" + "Mercury was unable to save to the url: %s": "Mercury 无法保存至这一 URL:%s" + "invalid": "无效" + "can't be blank": "不能为空" + # Confirmations + "You have unsaved changes. Are you sure you want to leave without saving them first?": "您还有未保存的修改,确定要放弃修改并离开吗?" + + # ### Toolbar / Buttons + # Error Messages + "Unknown button type \"%s\" used for the \"%s\" button.": "未知的按钮类型“%s”被用于“%s”按钮。" + "Unknown button structure -- please provide an array, object, or string for \"%s\".": "未知的按钮结构——请给“%s”提供一个序列、对象或字符串。" + + # ### Modals / Dialogs / Etc. + # Error Messages + "Mercury was unable to load %s for the \"%s\" dialog.": "Mercury 编辑器无法载入 %s 至“%s”对话框。" + "Mercury was unable to load %s for the lightview.": "Mercury 编辑器无法载入 %s 至弹出区域。" + "Mercury was unable to load %s for the modal.": "Mercury 编辑器无法载入 %s 至弹出框。" + + # ### Snippets + # Error Messages + "Error loading the preview for the \"%s\" snippet.": "载入“%s”代码预览时出错。" + # Misc + "Snippet Options": "代码选项" + + # ### Uploader + # Error Messages + "Unable to process response: %s": "无法处理回馈:%s" + "Error: Unable to upload the file": "错误:无法上传文件" + "Malformed response from server": "服务器响应格式有误" + "Too large": "上传文件过大" + "Unsupported format": "格式不受支持" + # Statuses + "Processing...": "处理中……" + "Uploading...": "上传中……" + "Aborted": "已中止" + "Successfully uploaded...": "上传成功……" + "Name: %s": "文件名:%s" + "Size: %s": "文件大小:%s" + "Type: %s": "文件类型:%s" + + # Statusbar + "Path:": "路径:" + + + # ## HTML / Template Strings + + # ### Modals + # Insert Link Modal (link.html) + "Link Content": "链接显示内容" + "Standard Links": "普通链接" + "URL": "网址" + "Index / Bookmark Links": "索引、书签链接" + "Existing Links": "已有链接" + "Bookmark": "书签" + "Options": "选项" + "Link Target": "链接目标窗口" + "Self (the same window or tab)": "本窗口中打开" + "Blank (a new window or tab)": "新窗口(或标签)中打开" + "Top (removes any frames)": "外层窗口中打开(去除帧框)" + "Popup Window (javascript new window popup)": "弹出窗口" + "Popup Width": "弹出窗口宽度" + "Popup Height": "弹出窗口高度" + + # Insert Media Modal (media.html) + "Images": "图片" + "Videos": "视频" + "YouTube URL": "YouTube 分享链接" + "Vimeo URL": "Vimeo 分享链接" + "Alignment": "对齐方式" + "None": "默认" + "Left": "左对齐" + "Right": "右对齐" + "Top": "顶对齐" + "Middle": "中对齐" + "Bottom": "底对齐" + "Absolute Middle": "绝对中对齐" + "Absolute Bottom": "绝对底对齐" + "Width": "宽度" + "Height": "高度" + "Insert Media": "插入多媒体" + + # Insert Table Modal (table.html) + "Rows": "行" + "Add Before": "前方插入" + "Add After": "后方插入" + "Remove": "删除" + "Columns": "列" + "Row Span": "行跨度" + "Column Span": "列跨度" + "Border": "边框线宽度" + "Spacing": "单元格间距" + + # HTML Editor Modal (htmleditor.html) + "HTML Editor": "HTML 编辑器" + "Save and Replace": "保存并替换" + + # ### Dialogs / Etc. + # Color Palettes (forecolor.html, backcolor.html) + "Last Color Picked": "上次选中的颜色" + + # Block Format Select (formatblock.html) + "Heading 1": "标题 1" + "Heading 2": "标题 2" + "Heading 3": "标题 3" + "Heading 4": "标题 4" + "Heading 5": "标题 5" + "Heading 6": "标题 6" + "Paragraph": "段落" + "Blockquote": "大段引用" + "Formatted": "预格式化" + + # About Mercury Panel (about.html) + "Project Home": "项目主页" + "Project Source": "项目源代码" + + # ### Demo / Placeholder / Defaults + "The history panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本历史面板需要与服务器后端共同实现。因为这是一个演示,所以我们没有加入这一功能。" + + "The notes panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本备忘面板需要与服务器后端共同实现。因为这是一个演示,所以我们没有加入这一功能。" + + "Snippet Name": "代码名称" + "A one or two line long description of what this snippet does.": "用一两行描述一下这个代码的功能" + + "First Name": "名字" + "Favorite Beer": "最喜欢的啤酒" + "Insert Snippet": "插入代码" + + _TW_: + # ## Javascript Strings + + # ### Default Configuration + "Save": "儲存" + "Save this page": "儲存本頁" + "Preview": "預覽" + "Preview this page": "預覽本頁" + "Undo": "取消" + "Undo your last action": "取消上一個動作" + "Redo": "重做" + "Redo your last action": "重做上一個動作" + "Link": "連結" + "Insert Link": "插入連結" + "Media": "多媒體" + "Insert Media (images and videos)": "插入多媒體(圖本、視頻)" + "Table": "表格" + "Insert Table": "插入表格" + "Character": "符號" + "Special Characters": "特殊符號" + "Snippet": "小片段" + "Snippet Panel": "小片段面板" + "History": "歷史" + "Page Version History": "本頁歷史版本" + "Notes": "備註" + "Page Notes": "本頁備註" + "Style": "樣式" + "Block Format": "段落格式" + "Background Color": "背景顏色" + "Text Color": "文本顏色" + "Bold": "加粗" + "Italicize": "斜體" + "Overline": "上橫綫" + "Strikethrough": "删除綫" + "Underline": "下橫綫" + "Subscript": "下標" + "Superscript": "上標" + "Align Left": "左對齊" + "Center": "置中" + "Align Right": "右對齊" + "Justify Full": "兩端對齊" + "Unordered List": "無序列表" + "Numbered List": "有序列表" + "Decrease Indentation": "減小縮排" + "Increase Indentation": "增大縮排" + "Insert Table Row": "插入行" + "Insert a table row before the cursor": "在浮標上方插入行" + "Insert a table row after the cursor": "在浮標下方插入行" + "Delete Table Row": "删除行" + "Delete this table row": "删除本行" + "Insert Table Column": "插入列" + "Insert a table column before the cursor": "在浮標左邊插入列" + "Insert a table column after the cursor": "在浮標右邊插入列" + "Delete Table Column": "删除列" + "Delete this table column": "删除本列" + "Increase Cell Columns": "增加列數" + "Decrease Cell Columns": "减少列數" + "Increase Cell Rows": "增加行數" + "Decrease Cell Rows": "减少行數" + "Horizontal Rule": "分割綫" + "Insert a horizontal rule": "插入分割綫" + "Remove Formatting": "清除格式" + "Remove formatting for the selection": "清除選中部分格式" + "Edit HTML": "編輯源代碼(HTML)" + "Edit the HTML content": "编輯源代碼 HTML 内容" + "Edit Snippet Settings": "编輯代碼設置" + "Remove Snippet": "删除代碼" + + # ### General + # Error Messages + "Mercury.Regions.%s is unsupported in this client. Supported browsers are %s.": "您的瀏覽器不支持 Mercury.Regions.%s,支持的瀏覽器包括:%s。" + "Mercury.PageEditor can only be instantiated once.": "Mercury.PageEditor 只能被實現化一次。" + "Opera isn't a fully supported browser, your results may not be optimal.": "Mercury 编辑器不完全支持 Opera 瀏覽器,您顯示的内容可能並不完善。" + "Mercury.PageEditor failed to load: %s\n\nPlease try refreshing.": "Mercury.PageEditor 載入失敗:%s\n\n請嘗試更新一下本頁。" + "Region type is malformed, no data-type provided, or \"%s\" is unknown for the \"%s\" region.": "地區不正確,没有提供數據類型,或“%s”不在“%s”區域中。" + "Mercury was unable to save to the url: %s": "Mercury 無法保存這個 URL:%s" + "invalid": "無效" + "can't be blank": "不能空白" + # Confirmations + "You have unsaved changes. Are you sure you want to leave without saving them first?": "您還有未保存的修改,確定要放棄修改並離開嗎?" + + # ### Toolbar / Buttons + # Error Messages + "Unknown button type \"%s\" used for the \"%s\" button.": "未知的按鍵類型“%s”被用於“%s”按鍵。" + "Unknown button structure -- please provide an array, object, or string for \"%s\".": "未知的按鍵結構 —— 請給“%s”提供一個序列、對象或字串。" + + # ### Modals / Dialogs / Etc. + # Error Messages + "Mercury was unable to load %s for the \"%s\" dialog.": "Mercury 編輯器無法載入 %s 至“%s”對話框。" + "Mercury was unable to load %s for the lightview.": "Mercury 編輯器無法載入 %s 至跳出區域。" + "Mercury was unable to load %s for the modal.": "Mercury 編輯器無法載入 %s 至彈框。" + + # ### Snippets + # Error Messages + "Error loading the preview for the \"%s\" snippet.": "載入“%s”代碼預覽時出錯。" + # Misc + "Snippet Options": "代碼選項" + + # ### Uploader + # Error Messages + "Unable to process response: %s": "無法處理回饋:%s" + "Error: Unable to upload the file": "錯誤:無法上傳文件" + "Malformed response from server": "服務器響應格式有誤" + "Too large": "上傳文件過大" + "Unsupported format": "不支援格式" + # Statuses + "Processing...": "處理中……" + "Uploading...": "上傳中……" + "Aborted": "已中止" + "Successfully uploaded...": "上傳成功……" + "Name: %s": "文件名:%s" + "Size: %s": "文件大小:%s" + "Type: %s": "文件類型:%s" + + # Statusbar + "Path:": "路徑:" + + + # ## HTML / Template Strings + + # ### Modals + # Insert Link Modal (link.html) + "Link Content": "連結顯示内容" + "Standard Links": "標準連結" + "URL": "網址" + "Index / Bookmark Links": "索引、書簽連結" + "Existing Links": "已有連結" + "Bookmark": "書簽" + "Options": "選項" + "Link Target": "連結目標視窗" + "Self (the same window or tab)": "本視窗中打開" + "Blank (a new window or tab)": "新視窗(或標簽)中打開" + "Top (removes any frames)": "外層窗口中打開(去除框架)" + "Popup Window (javascript new window popup)": "彈出視窗" + "Popup Width": "彈出視窗闊度" + "Popup Height": "彈出視窗高度" + + # Insert Media Modal (media.html) + "Images": "圖片" + "Videos": "視頻" + "YouTube URL": "YouTube 分享連結" + "Vimeo URL": "Vimeo 分享連結" + "Alignment": "對齊方式" + "None": "默認" + "Left": "左對齊" + "Right": "右對齊" + "Top": "頂對齊" + "Middle": "中對齊" + "Bottom": "底對齊" + "Absolute Middle": "絕對置中對齊" + "Absolute Bottom": "絕對置底對齊" + "Width": "闊度" + "Height": "高度" + "Insert Media": "插入多媒體" + + # Insert Table Modal (table.html) + "Rows": "行" + "Add Before": "前方插入" + "Add After": "後方插入" + "Remove": "删除" + "Columns": "列" + "Row Span": "行跨度" + "Column Span": "列跨度" + "Border": "邊框綫闊度" + "Spacing": "間距" + + # HTML Editor Modal (htmleditor.html) + "HTML Editor": "HTML 編輯器" + "Save and Replace": "保存並替換" + + # ### Dialogs / Etc. + # Color Palettes (forecolor.html, backcolor.html) + "Last Color Picked": "上次選中的颜色" + + # Block Format Select (formatblock.html) + "Heading 1": "標題 1" + "Heading 2": "標題 2" + "Heading 3": "標題 3" + "Heading 4": "標題 4" + "Heading 5": "標題 5" + "Heading 6": "標題 6" + "Paragraph": "段落" + "Blockquote": "大段引用" + "Formatted": "預設格式化" + + # About Mercury Panel (about.html) + "Project Home": "項目主頁" + "Project Source": "項目源代碼" + + # ### Demo / Placeholder / Defaults + "The history panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本歷史面板需要與服務器後台共同實現。因為這是一个演示,所以我們没有加入此功能。" + + "The notes panel is expected to be implemented with a server back end. Since this is a demo, we didn't include it.": "本備忘面板需要與服務器后台共同實現。因為這是一個演示,所以我們没有加入此功能。" + + "Snippet Name": "代碼名稱" + "A one or two line long description of what this snippet does.": "用一兩行描述一下這個代碼的功能" + + "First Name": "名字" + "Favorite Beer": "最喜歡的啤酒" + "Insert Snippet": "插入代碼" + diff --git a/app/assets/javascripts/mercury/mercury-compiled.js b/app/assets/javascripts/mercury/mercury-compiled.js index b123f81e..44ed6d11 100644 --- a/app/assets/javascripts/mercury/mercury-compiled.js +++ b/app/assets/javascripts/mercury/mercury-compiled.js @@ -4584,13 +4584,16 @@ Showdown.converter = function() { data = this.serialize(); data = { content: data - }; + }; if (this.options.saveMethod === 'POST') { method = 'POST'; + } else if (this.options.saveMethod === 'PATCH') { + method = 'POST'; + data['_method'] = 'PATCH'; } else { method = 'PUT'; data['_method'] = method; - } + } Mercury.log('saving', data); options = { headers: Mercury.ajaxHeaders(), diff --git a/app/assets/javascripts/mercury/page_editor.js.coffee b/app/assets/javascripts/mercury/page_editor.js.coffee index ce715c15..d232a869 100644 --- a/app/assets/javascripts/mercury/page_editor.js.coffee +++ b/app/assets/javascripts/mercury/page_editor.js.coffee @@ -3,7 +3,7 @@ class @Mercury.PageEditor # options # saveStyle: 'form', or 'json' (defaults to json) # saveDataType: 'xml', 'json', 'jsonp', 'script', 'text', 'html' (defaults to json) - # saveMethod: 'POST', or 'PUT', create or update actions on save (defaults to PUT) + # saveMethod: 'POST', 'PUT', or 'PATCH' create or update actions on save (defaults to PUT) # visible: boolean, if the interface should start visible or not (defaults to true) constructor: (@saveUrl = null, @options = {}) -> throw Mercury.I18n('Mercury.PageEditor can only be instantiated once.') if window.mercuryInstance @@ -224,6 +224,9 @@ class @Mercury.PageEditor if @options.saveMethod == 'POST' method = 'POST' + else if @options.saveMethod == 'PATCH' + method = 'POST' + data['_method'] = 'patch' else method = 'PUT' data['_method'] = method