From 7a9e58438c13e49c9dcc7043c2839bfd8ab90dfd Mon Sep 17 00:00:00 2001 From: Maxim Martynov Date: Mon, 9 Aug 2021 11:11:43 +0300 Subject: [PATCH 01/10] Fix send2trash tests failing on Windows --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2a75fd08ba3..4ae0febdc6c 100755 --- a/setup.py +++ b/setup.py @@ -122,7 +122,7 @@ 'nbformat', 'nbconvert', 'ipykernel', # bless IPython kernel for now - 'Send2Trash>=1.5.0', + 'Send2Trash>=1.8.0', 'terminado>=0.8.3', 'prometheus_client' ], From c1543ac36711aeca9bb41e05a2d177c00cb5bea3 Mon Sep 17 00:00:00 2001 From: maliubiao Date: Thu, 21 Oct 2021 14:51:29 +0800 Subject: [PATCH 02/10] fix chinese translation typo --- notebook/i18n/zh_CN/LC_MESSAGES/notebook.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po b/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po index 9009f957cba..6b641c0fd29 100644 --- a/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po +++ b/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po @@ -368,7 +368,7 @@ msgstr "" #: notebook/notebookapp.py:1187 #, python-format msgid "The port %i is already in use, trying another port." -msgstr "端口 %i 已经被站用, 请尝试其他端口." +msgstr "端口 %i 已经被占用, 请尝试其他端口." #: notebook/notebookapp.py:1190 #, python-format From f6d96fadf26ea9b02c558b01281af0e08dd62eba Mon Sep 17 00:00:00 2001 From: Jiaqi Date: Mon, 1 Nov 2021 09:58:43 -0400 Subject: [PATCH 03/10] Change to use a universal Chinese translation on certain words --- notebook/i18n/zh_CN/LC_MESSAGES/nbjs.po | 95 +++++++------ notebook/i18n/zh_CN/LC_MESSAGES/nbui.po | 149 ++++++++++---------- notebook/i18n/zh_CN/LC_MESSAGES/notebook.po | 133 ++++++++--------- 3 files changed, 190 insertions(+), 187 deletions(-) diff --git a/notebook/i18n/zh_CN/LC_MESSAGES/nbjs.po b/notebook/i18n/zh_CN/LC_MESSAGES/nbjs.po index 07a1317368c..f3b7be07ebf 100644 --- a/notebook/i18n/zh_CN/LC_MESSAGES/nbjs.po +++ b/notebook/i18n/zh_CN/LC_MESSAGES/nbjs.po @@ -4,6 +4,7 @@ # FIRST AUTHOR , 2017. # #, fuzzy +# Universal translation: cell=单元格; kernal=内核; don't translate notebook whenever referring to Jupyter Notebook msgid "" msgstr "" "Project-Id-Version: Jupyter VERSION\n" @@ -35,11 +36,11 @@ msgstr "编辑元数据" #: notebook/static/base/js/dialog.js:202 msgid "Edit Notebook Metadata" -msgstr "编辑笔记本元数据" +msgstr "编辑Notebook元数据" #: notebook/static/base/js/dialog.js:204 msgid "Edit Cell Metadata" -msgstr "编辑块元数据" +msgstr "编辑单元格元数据" #: notebook/static/base/js/dialog.js:208 #: notebook/static/notebook/js/notebook.js:485 @@ -74,11 +75,11 @@ msgstr "警告: 不能保存无效的JSON。" #: notebook/static/base/js/dialog.js:247 msgid "There are no attachments for this cell." -msgstr "这个块没有附件。" +msgstr "这个单元格没有附件。" #: notebook/static/base/js/dialog.js:250 msgid "Current cell attachments" -msgstr "当前块附件" +msgstr "当前单元格附件" #: notebook/static/base/js/dialog.js:259 #: notebook/static/notebook/js/celltoolbarpresets/attachments.js:46 @@ -104,7 +105,7 @@ msgstr "编辑笔记本附件" #: notebook/static/base/js/dialog.js:350 msgid "Edit Cell Attachments" -msgstr "编辑块附件" +msgstr "编辑单元格附件" #: notebook/static/base/js/dialog.js:373 msgid "Select a file to insert." @@ -188,7 +189,7 @@ msgstr "重启内核(带确认对话框)" #: notebook/static/notebook/js/actions.js:113 msgid "restart kernel and run all cells" -msgstr "重启内核并且运行所有代码块" +msgstr "重启内核并且运行所有单元格" #: notebook/static/notebook/js/actions.js:114 msgid "restart the kernel, then re-run the whole notebook (no confirmation dialog)" @@ -196,11 +197,11 @@ msgstr "重启服务,然后重新运行整个笔记本(无确认对话框) #: notebook/static/notebook/js/actions.js:120 msgid "confirm restart kernel and run all cells" -msgstr "确认重启内核并且运行所有代码块" +msgstr "确认重启内核并且运行所有单元格" #: notebook/static/notebook/js/actions.js:121 msgid "restart the kernel, then re-run the whole notebook (with dialog)" -msgstr "重启内核, 然后重新运行整个代码(带确认对话框)" +msgstr "重启内核, 然后重新运行整个notebook(带确认对话框)" #: notebook/static/notebook/js/actions.js:127 msgid "restart kernel and clear output" @@ -225,36 +226,36 @@ msgstr "中断内核" #: notebook/static/notebook/js/actions.js:150 msgid "run cell and select next" -msgstr "运行代码块并且选择下一个代码块" +msgstr "运行单元格并且选择下一个单元格" #: notebook/static/notebook/js/actions.js:152 msgid "run cell, select below" -msgstr "运行代码块, 选择下面的代码块" +msgstr "运行单元格, 选择下面的单元格" #: notebook/static/notebook/js/actions.js:159 #: notebook/static/notebook/js/actions.js:160 msgid "run selected cells" -msgstr "运行选中的代码块" +msgstr "运行选中的单元格" #: notebook/static/notebook/js/actions.js:167 #: notebook/static/notebook/js/actions.js:168 msgid "run cell and insert below" -msgstr "运行代码块并且在下面插入代码块" +msgstr "运行单元格并且在下面插入单元格" #: notebook/static/notebook/js/actions.js:175 #: notebook/static/notebook/js/actions.js:176 msgid "run all cells" -msgstr "运行所有的代码块" +msgstr "运行所有的单元格" #: notebook/static/notebook/js/actions.js:183 #: notebook/static/notebook/js/actions.js:184 msgid "run all cells above" -msgstr "运行上面所有的代码块" +msgstr "运行上面所有的单元格" #: notebook/static/notebook/js/actions.js:190 #: notebook/static/notebook/js/actions.js:191 msgid "run all cells below" -msgstr "运行下面所有的代码块" +msgstr "运行下面所有的单元格" #: notebook/static/notebook/js/actions.js:197 #: notebook/static/notebook/js/actions.js:198 @@ -269,22 +270,22 @@ msgstr "插入图片" #: notebook/static/notebook/js/actions.js:213 #: notebook/static/notebook/js/actions.js:214 msgid "cut cell attachments" -msgstr "剪切代码块的附件" +msgstr "剪切单元格的附件" #: notebook/static/notebook/js/actions.js:221 #: notebook/static/notebook/js/actions.js:222 msgid "copy cell attachments" -msgstr "复制代码块的附件" +msgstr "复制单元格的附件" #: notebook/static/notebook/js/actions.js:229 #: notebook/static/notebook/js/actions.js:230 msgid "paste cell attachments" -msgstr "粘贴代码块的附件" +msgstr "粘贴单元格的附件" #: notebook/static/notebook/js/actions.js:237 #: notebook/static/notebook/js/actions.js:238 msgid "split cell at cursor" -msgstr "在光标处分割代码块" +msgstr "在光标处分割单元格" #: notebook/static/notebook/js/actions.js:245 #: notebook/static/notebook/js/actions.js:246 @@ -293,45 +294,45 @@ msgstr "进入编辑模式" #: notebook/static/notebook/js/actions.js:253 msgid "select previous cell" -msgstr "选择上一个代码块" +msgstr "选择上一个单元格" #: notebook/static/notebook/js/actions.js:254 msgid "select cell above" -msgstr "选择上面的代码块" +msgstr "选择上面的单元格" #: notebook/static/notebook/js/actions.js:265 msgid "select next cell" -msgstr "选择下一个代码块" +msgstr "选择下一个单元格" #: notebook/static/notebook/js/actions.js:266 msgid "select cell below" -msgstr "选择下面的代码块" +msgstr "选择下面的单元格" #: notebook/static/notebook/js/actions.js:277 msgid "extend selection above" -msgstr "扩展上面的代码块" +msgstr "扩展上面的单元格" #: notebook/static/notebook/js/actions.js:278 msgid "extend selected cells above" -msgstr "扩展上面选择的代码块" +msgstr "扩展上面选择的单元格" #: notebook/static/notebook/js/actions.js:289 msgid "extend selection below" -msgstr "扩展下面的代码块" +msgstr "扩展下面的单元格" #: notebook/static/notebook/js/actions.js:290 msgid "extend selected cells below" -msgstr "扩展下面选择的代码块" +msgstr "扩展下面选择的单元格" #: notebook/static/notebook/js/actions.js:301 #: notebook/static/notebook/js/actions.js:302 msgid "cut selected cells" -msgstr "剪切选择的代码块" +msgstr "剪切选择的单元格" #: notebook/static/notebook/js/actions.js:312 #: notebook/static/notebook/js/actions.js:313 msgid "copy selected cells" -msgstr "复制选择的代码块" +msgstr "复制选择的单元格" #: notebook/static/notebook/js/actions.js:327 #: notebook/static/notebook/js/actions.js:328 @@ -346,73 +347,73 @@ msgstr "粘贴到下面" #: notebook/static/notebook/js/actions.js:344 #: notebook/static/notebook/js/actions.js:345 msgid "insert cell above" -msgstr "在上面插入代码块" +msgstr "在上面插入单元格" #: notebook/static/notebook/js/actions.js:354 #: notebook/static/notebook/js/actions.js:355 msgid "insert cell below" -msgstr "在下面插入代码块" +msgstr "在下面插入单元格" #: notebook/static/notebook/js/actions.js:365 #: notebook/static/notebook/js/actions.js:366 msgid "change cell to code" -msgstr "把代码块变成代码" +msgstr "把单元格变成代码快" #: notebook/static/notebook/js/actions.js:373 #: notebook/static/notebook/js/actions.js:374 msgid "change cell to markdown" -msgstr "把代码块变成 Markdown" +msgstr "把单元格变成 Markdown" #: notebook/static/notebook/js/actions.js:381 #: notebook/static/notebook/js/actions.js:382 msgid "change cell to raw" -msgstr "清除代码块格式" +msgstr "清除单元格格式" #: notebook/static/notebook/js/actions.js:389 #: notebook/static/notebook/js/actions.js:390 msgid "change cell to heading 1" -msgstr "把代码块变成标题 1" +msgstr "把单元格变成标题 1" #: notebook/static/notebook/js/actions.js:397 #: notebook/static/notebook/js/actions.js:398 msgid "change cell to heading 2" -msgstr "把代码块变成标题 2" +msgstr "把单元格变成标题 2" #: notebook/static/notebook/js/actions.js:405 #: notebook/static/notebook/js/actions.js:406 msgid "change cell to heading 3" -msgstr "把代码块变成标题 3" +msgstr "把单元格变成标题 3" #: notebook/static/notebook/js/actions.js:413 #: notebook/static/notebook/js/actions.js:414 msgid "change cell to heading 4" -msgstr "把代码块变成标题 4" +msgstr "把单元格变成标题 4" #: notebook/static/notebook/js/actions.js:421 #: notebook/static/notebook/js/actions.js:422 msgid "change cell to heading 5" -msgstr "把代码块变成标题 5" +msgstr "把单元格变成标题 5" #: notebook/static/notebook/js/actions.js:429 #: notebook/static/notebook/js/actions.js:430 msgid "change cell to heading 6" -msgstr "把代码块变成标题 6" +msgstr "把单元格变成标题 6" #: notebook/static/notebook/js/actions.js:437 msgid "toggle cell output" -msgstr "切换代码块输出" +msgstr "显示/隐藏单元格输出" #: notebook/static/notebook/js/actions.js:438 msgid "toggle output of selected cells" -msgstr "切换选定单元格的输出" +msgstr "显示/隐藏选定单元格的输出" #: notebook/static/notebook/js/actions.js:445 msgid "toggle cell scrolling" -msgstr "切换单元格滚动" +msgstr "切换单元格为滚动" #: notebook/static/notebook/js/actions.js:446 msgid "toggle output scrolling of selected cells" -msgstr "切换选中单元格的输出滚动" +msgstr "切换选中单元格的输出为滚动" #: notebook/static/notebook/js/actions.js:453 msgid "clear cell output" @@ -424,7 +425,7 @@ msgstr "清空已选择单元格的输出" #: notebook/static/notebook/js/actions.js:460 msgid "move cells down" -msgstr "下移" +msgstr "下移单元格" #: notebook/static/notebook/js/actions.js:461 msgid "move selected cells down" @@ -432,7 +433,7 @@ msgstr "下移选中单元格" #: notebook/static/notebook/js/actions.js:469 msgid "move cells up" -msgstr "上移" +msgstr "上移单元格" #: notebook/static/notebook/js/actions.js:470 msgid "move selected cells up" @@ -459,7 +460,7 @@ msgstr "删除选中单元格" #: notebook/static/notebook/js/actions.js:502 #: notebook/static/notebook/js/actions.js:503 msgid "undo cell deletion" -msgstr "撤销删除" +msgstr "撤销删除单元格" #: notebook/static/notebook/js/actions.js:512 msgid "merge cell with previous cell" diff --git a/notebook/i18n/zh_CN/LC_MESSAGES/nbui.po b/notebook/i18n/zh_CN/LC_MESSAGES/nbui.po index 2b7c506244e..4fd1341e259 100644 --- a/notebook/i18n/zh_CN/LC_MESSAGES/nbui.po +++ b/notebook/i18n/zh_CN/LC_MESSAGES/nbui.po @@ -4,6 +4,7 @@ # FIRST AUTHOR , 2017. # #, fuzzy +# Universal translation: cell=单元格; kernal=内核; don't translate notebook whenever referring to Jupyter Notebook msgid "" msgstr "" "Project-Id-Version: Jupyter VERSION\n" @@ -19,7 +20,7 @@ msgstr "" #: notebook/templates/404.html:3 msgid "You are requesting a page that does not exist!" -msgstr "请求的代码不存在!" +msgstr "您所请求的页面不存在!" #: notebook/templates/edit.html:37 msgid "current mode" @@ -81,11 +82,11 @@ msgstr "显示/隐藏 标题和logo" #: notebook/templates/edit.html:71 notebook/templates/notebook.html:163 msgid "Toggle Header" -msgstr "切换Header" +msgstr "显示/隐藏 标题栏" #: notebook/templates/edit.html:72 notebook/templates/notebook.html:171 msgid "Toggle Line Numbers" -msgstr "切换行号" +msgstr "显示/隐藏 行号" #: notebook/templates/edit.html:75 msgid "Language" @@ -127,15 +128,15 @@ msgstr "菜单" #: notebook/templates/notebook.html:65 notebook/templates/notebook.html:254 msgid "Kernel" -msgstr "服务" +msgstr "内核" #: notebook/templates/notebook.html:68 msgid "This notebook is read-only" -msgstr "这个代码是只读的" +msgstr "这个notebook文件是只读的" #: notebook/templates/notebook.html:81 msgid "New Notebook" -msgstr "新建代码" +msgstr "新建Notebook" #: notebook/templates/notebook.html:85 msgid "Opens a new window with the Dashboard view" @@ -147,7 +148,7 @@ msgstr "打开..." #: notebook/templates/notebook.html:90 msgid "Open a copy of this notebook's contents and start a new kernel" -msgstr "打开代码内容的副本并启动一个新的服务" +msgstr "复制并打开当前notebook的内容,同时启动一个新的内核" #: notebook/templates/notebook.html:91 msgid "Make a Copy..." @@ -159,11 +160,11 @@ msgstr "重命名..." #: notebook/templates/notebook.html:93 msgid "Save and Checkpoint" -msgstr "保存" +msgstr "保存,且作为一个检查点" #: notebook/templates/notebook.html:96 msgid "Revert to Checkpoint" -msgstr "恢复" +msgstr "恢复到某一个检查点" #: notebook/templates/notebook.html:106 msgid "Print Preview" @@ -171,11 +172,11 @@ msgstr "打印预览" #: notebook/templates/notebook.html:107 msgid "Download as" -msgstr "下载" +msgstr "另存为" #: notebook/templates/notebook.html:109 msgid "Notebook (.ipynb)" -msgstr "代码(.ipynb)" +msgstr "Notebook (.ipynb)" #: notebook/templates/notebook.html:110 msgid "Script" @@ -199,7 +200,7 @@ msgstr "" #: notebook/templates/notebook.html:115 msgid "PDF via LaTeX (.pdf)" -msgstr "" +msgstr "通过LaTeX生成的PDF (.pdf)" #: notebook/templates/notebook.html:118 msgid "Deploy as" @@ -207,15 +208,15 @@ msgstr "部署在" #: notebook/templates/notebook.html:123 msgid "Trust the output of this notebook" -msgstr "信任代码的输出" +msgstr "信任当前notebook的输出" #: notebook/templates/notebook.html:124 msgid "Trust Notebook" -msgstr "信任代码" +msgstr "信任当前Notebook" #: notebook/templates/notebook.html:127 msgid "Shutdown this notebook's kernel, and close this window" -msgstr "关闭代码服务并关闭窗口" +msgstr "关闭当前notebook的内核,并关闭当前窗口" #: notebook/templates/notebook.html:128 msgid "Close and Halt" @@ -223,55 +224,55 @@ msgstr "关闭" #: notebook/templates/notebook.html:133 msgid "Cut Cells" -msgstr "剪切代码块" +msgstr "剪切单元格" #: notebook/templates/notebook.html:134 msgid "Copy Cells" -msgstr "复制代码块" +msgstr "复制单元格" #: notebook/templates/notebook.html:135 msgid "Paste Cells Above" -msgstr "粘贴到上面" +msgstr "粘贴单元格到上面" #: notebook/templates/notebook.html:136 msgid "Paste Cells Below" -msgstr "粘贴到下面" +msgstr "粘贴单元格到下面" #: notebook/templates/notebook.html:137 msgid "Paste Cells & Replace" -msgstr "粘贴代码块 & 替换" +msgstr "粘贴单元格 & 替换" #: notebook/templates/notebook.html:138 msgid "Delete Cells" -msgstr "删除代码块" +msgstr "删除单元格" #: notebook/templates/notebook.html:139 msgid "Undo Delete Cells" -msgstr "撤销删除" +msgstr "撤销删除单元格" #: notebook/templates/notebook.html:141 msgid "Split Cell" -msgstr "分割代码块" +msgstr "分割单元格" #: notebook/templates/notebook.html:142 msgid "Merge Cell Above" -msgstr "合并上面的代码块" +msgstr "合并上面的单元格" #: notebook/templates/notebook.html:143 msgid "Merge Cell Below" -msgstr "合并下面的代码块" +msgstr "合并下面的单元格" #: notebook/templates/notebook.html:145 msgid "Move Cell Up" -msgstr "上移代码块" +msgstr "上移单元格" #: notebook/templates/notebook.html:146 msgid "Move Cell Down" -msgstr "下移代码块" +msgstr "下移单元格" #: notebook/templates/notebook.html:148 msgid "Edit Notebook Metadata" -msgstr "编辑界面元数据" +msgstr "编辑Notebook的元数据" #: notebook/templates/notebook.html:150 msgid "Find and Replace" @@ -299,15 +300,15 @@ msgstr "显示/隐藏 操作图标" #: notebook/templates/notebook.html:167 msgid "Toggle Toolbar" -msgstr "" +msgstr "显示/隐藏 工具栏" #: notebook/templates/notebook.html:170 msgid "Show/Hide line numbers in cells" -msgstr "显示/隐藏行号" +msgstr "显示/隐藏 当前单元格的行号" #: notebook/templates/notebook.html:174 msgid "Cell Toolbar" -msgstr "单元格工具栏" +msgstr "单元格 工具栏" #: notebook/templates/notebook.html:179 msgid "Insert" @@ -315,19 +316,19 @@ msgstr "插入" #: notebook/templates/notebook.html:182 msgid "Insert an empty Code cell above the currently active cell" -msgstr "在当前活动单元上插入一个空的代码单元格" +msgstr "在当前代码块上面插入一个空的单元格" #: notebook/templates/notebook.html:183 msgid "Insert Cell Above" -msgstr "插入单元格上面" +msgstr "在上面插入一个单元格" #: notebook/templates/notebook.html:185 msgid "Insert an empty Code cell below the currently active cell" -msgstr "在当前活动单元下面插入一个空的代码单元格" +msgstr "在当前代码块下面插入一个空的单元格" #: notebook/templates/notebook.html:186 msgid "Insert Cell Below" -msgstr "插入单元格下面" +msgstr "在下面插入一个单元格" #: notebook/templates/notebook.html:189 msgid "Cell" @@ -335,7 +336,7 @@ msgstr "单元格" #: notebook/templates/notebook.html:191 msgid "Run this cell, and move cursor to the next one" -msgstr "运行这个单元格,并将光标移到下一个" +msgstr "运行此单元格,并将光标移到下一个" #: notebook/templates/notebook.html:192 msgid "Run Cells" @@ -343,19 +344,19 @@ msgstr "运行所有单元格" #: notebook/templates/notebook.html:193 msgid "Run this cell, select below" -msgstr "运行此单元,选择以下选项" +msgstr "运行此单元格,并自动选择下一个" #: notebook/templates/notebook.html:194 msgid "Run Cells and Select Below" -msgstr "运行单元格并自动选择下一个" +msgstr "运行所有单元格,并自动选择下一个" #: notebook/templates/notebook.html:195 msgid "Run this cell, insert below" -msgstr "运行单元格并选择以下" +msgstr "运行此单元格,并在下面插入一个新的单元格" #: notebook/templates/notebook.html:196 msgid "Run Cells and Insert Below" -msgstr "运行单元格并在下面插入" +msgstr "运行所有单元格,并在下面插入一个新的单元格" #: notebook/templates/notebook.html:197 msgid "Run all cells in the notebook" @@ -367,23 +368,23 @@ msgstr "运行所有" #: notebook/templates/notebook.html:199 msgid "Run all cells above (but not including) this cell" -msgstr "运行上面的所有单元(但不包括)这个单元格" +msgstr "运行上面所有的单元格(但不包括这个单元格)" #: notebook/templates/notebook.html:200 msgid "Run All Above" -msgstr "运行上面的代码块" +msgstr "运行上面所有的单元格" #: notebook/templates/notebook.html:201 msgid "Run this cell and all cells below it" -msgstr "运行当前及以下代码块" +msgstr "运行当前及以下所有的单元格" #: notebook/templates/notebook.html:202 msgid "Run All Below" -msgstr "运行下面的代码块" +msgstr "运行下面的所有的单元格" #: notebook/templates/notebook.html:205 msgid "All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells" -msgstr "代码里的所有单元格都有一个类型. 默认情况下, 新单元被创建为'Code'单元格" +msgstr "Notebook里的所有单元格都有一个类型。默认新单元格都会被创建为代码单元格" #: notebook/templates/notebook.html:206 msgid "Cell Type" @@ -391,7 +392,7 @@ msgstr "单元格类型" #: notebook/templates/notebook.html:209 msgid "Contents will be sent to the kernel for execution, and output will display in the footer of cell" -msgstr "内容将被发送到内核以执行, 输出将显示在单元格的页脚." +msgstr "内容将被发送到内核执行,输出将显示在单元格的页脚。" #: notebook/templates/notebook.html:212 msgid "Contents will be rendered as HTML and serve as explanatory text" @@ -399,11 +400,11 @@ msgstr "内容将以HTML形式呈现, 并作为解释性文本" #: notebook/templates/notebook.html:213 notebook/templates/notebook.html:298 msgid "Markdown" -msgstr "标签" +msgstr "" #: notebook/templates/notebook.html:215 msgid "Contents will pass through nbconvert unmodified" -msgstr "内容将通过未经修改的nbconvert" +msgstr "内容将通过nbconvert且不会被修改" #: notebook/templates/notebook.html:216 msgid "Raw NBConvert" @@ -419,15 +420,15 @@ msgstr "隐藏/显示当前单元格输出" #: notebook/templates/notebook.html:224 notebook/templates/notebook.html:240 msgid "Toggle" -msgstr "切换" +msgstr "显示/隐藏" #: notebook/templates/notebook.html:227 msgid "Scroll the output of the current cell" -msgstr "滚动当前单元格的输出" +msgstr "滚动到当前单元格的输出" #: notebook/templates/notebook.html:228 notebook/templates/notebook.html:244 msgid "Toggle Scrolling" -msgstr "切换滚动" +msgstr "滚动显示" #: notebook/templates/notebook.html:231 msgid "Clear the output of the current cell" @@ -443,11 +444,11 @@ msgstr "所有输出" #: notebook/templates/notebook.html:239 msgid "Hide/Show the output of all cells" -msgstr "隐藏/显示 所有代码块的输出" +msgstr "隐藏/显示 所有单元格的输出" #: notebook/templates/notebook.html:243 msgid "Scroll the output of all cells" -msgstr "滚动所有单元格的输出" +msgstr "切换所有单元格的输出为滚动模式" #: notebook/templates/notebook.html:247 msgid "Clear the output of all cells" @@ -455,7 +456,7 @@ msgstr "清空所有代码块的输出" #: notebook/templates/notebook.html:257 msgid "Send Keyboard Interrupt (CTRL-C) to the Kernel" -msgstr "按下CTRL-C 中断服务" +msgstr "按下CTRL-C 中断内核" #: notebook/templates/notebook.html:258 msgid "Interrupt" @@ -463,7 +464,7 @@ msgstr "中断" #: notebook/templates/notebook.html:261 msgid "Restart the Kernel" -msgstr "重启服务" +msgstr "重启内核" #: notebook/templates/notebook.html:262 msgid "Restart" @@ -479,7 +480,7 @@ msgstr "重启 & 清空输出" #: notebook/templates/notebook.html:269 msgid "Restart the Kernel and re-run the notebook" -msgstr "重启服务并且重新运行代码" +msgstr "重启内核并且重新运行整个notebook" #: notebook/templates/notebook.html:270 msgid "Restart & Run All" @@ -487,7 +488,7 @@ msgstr "重启 & 运行所有" #: notebook/templates/notebook.html:273 msgid "Reconnect to the Kernel" -msgstr "重新连接服务" +msgstr "重连内核" #: notebook/templates/notebook.html:274 msgid "Reconnect" @@ -495,7 +496,7 @@ msgstr "重连" #: notebook/templates/notebook.html:282 msgid "Change kernel" -msgstr "改变服务" +msgstr "更换内核" #: notebook/templates/notebook.html:287 msgid "Help" @@ -511,7 +512,7 @@ msgstr "用户界面之旅" #: notebook/templates/notebook.html:291 msgid "Opens a tooltip with all keyboard shortcuts" -msgstr "打开所有快捷键提示信息" +msgstr "打开包含所有快捷键的提示信息" #: notebook/templates/notebook.html:291 msgid "Keyboard Shortcuts" @@ -547,7 +548,7 @@ msgstr "Jupyter Notebook需要的JavaScript." #: notebook/templates/page.html:115 msgid "Please enable it to proceed. " -msgstr "请允许它继续." +msgstr "请启用它以继续。" #: notebook/templates/page.html:122 msgid "dashboard" @@ -579,7 +580,7 @@ msgstr "选择操作对象." #: notebook/templates/tree.html:35 msgid "Duplicate selected" -msgstr "复制选择的对象" +msgstr "复制选中的对象" #: notebook/templates/tree.html:35 msgid "Duplicate" @@ -587,11 +588,11 @@ msgstr "复制" #: notebook/templates/tree.html:36 msgid "Rename selected" -msgstr "重命名" +msgstr "重命名选中的对象" #: notebook/templates/tree.html:37 msgid "Move selected" -msgstr "移动" +msgstr "移动选中的对象" #: notebook/templates/tree.html:37 msgid "Move" @@ -599,7 +600,7 @@ msgstr "移动" #: notebook/templates/tree.html:38 msgid "Download selected" -msgstr "下载" +msgstr "下载选中的对象" #: notebook/templates/tree.html:39 msgid "Shutdown selected notebook(s)" @@ -612,19 +613,19 @@ msgstr "关闭" #: notebook/templates/tree.html:40 msgid "View selected" -msgstr "查看" +msgstr "查看选中的对象" #: notebook/templates/tree.html:41 msgid "Edit selected" -msgstr "编辑" +msgstr "编辑选中的对象" #: notebook/templates/tree.html:42 msgid "Delete selected" -msgstr "删除" +msgstr "删除选中的对象" #: notebook/templates/tree.html:50 msgid "Click to browse for a file to upload." -msgstr "点击浏览文件上传" +msgstr "浏览文件并上传" #: notebook/templates/tree.html:51 msgid "Upload" @@ -652,7 +653,7 @@ msgstr "刷新笔记列表" #: notebook/templates/tree.html:90 msgid "Select All / None" -msgstr "全选 / 全部选" +msgstr "全选 / 全不选" #: notebook/templates/tree.html:93 msgid "Select..." @@ -668,15 +669,15 @@ msgstr "文件夹" #: notebook/templates/tree.html:99 msgid "Select All Notebooks" -msgstr "选择所有笔记" +msgstr "选择所有Notebooks" #: notebook/templates/tree.html:99 msgid "All Notebooks" -msgstr "所有笔记" +msgstr "所有Notebooks" #: notebook/templates/tree.html:100 msgid "Select Running Notebooks" -msgstr "选择运行中的笔记" +msgstr "选择运行中的Notebooks" #: notebook/templates/tree.html:100 msgid "Running" @@ -716,11 +717,11 @@ msgstr "终端不可用" #: notebook/templates/tree.html:162 msgid "Notebooks" -msgstr "笔记" +msgstr "" #: notebook/templates/tree.html:169 msgid "There are no notebooks running." -msgstr "没有笔记正在运行" +msgstr "没有notebooks正在运行" #: notebook/templates/tree.html:178 msgid "Clusters tab is now provided by IPython parallel." diff --git a/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po b/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po index 6b641c0fd29..aa03cd5831d 100644 --- a/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po +++ b/notebook/i18n/zh_CN/LC_MESSAGES/notebook.po @@ -4,6 +4,7 @@ # FIRST AUTHOR , 2017. # #, fuzzy +# Universal translation: cell=单元格; kernal=内核; don't translate notebook whenever referring to Jupyter Notebook msgid "" msgstr "" "Project-Id-Version: Jupyter VERSION\n" @@ -19,20 +20,20 @@ msgstr "" #: notebook/notebookapp.py:49 msgid "The Jupyter Notebook requires tornado >= 4.0" -msgstr "该程序要求 tornado 版本 >= 4.0" +msgstr "Jupyter Notebook要求拥有 tornado 版本号 >= 4.0" #: notebook/notebookapp.py:53 msgid "The Jupyter Notebook requires tornado >= 4.0, but you have < 1.1.0" -msgstr "该程序要求 tornado 版本 >= 4.0, 可是现实却是 < 1.1.0" +msgstr "Jupyter Notebook要求拥有 tornado 版本号 >= 4.0, 但你的版本号却是 < 1.1.0" #: notebook/notebookapp.py:55 #, python-format msgid "The Jupyter Notebook requires tornado >= 4.0, but you have %s" -msgstr "该程序要求 tornado 版本 >= 4.0, 可是现实却是 %s" +msgstr "Jupyter Notebook要求拥有 tornado 版本号 >= 4.0, 但你的版本号却是 %s" #: notebook/notebookapp.py:205 msgid "The `ignore_minified_js` flag is deprecated and no longer works." -msgstr "" +msgstr "`ignore_minified_js` 这个标志已经被弃用且不再工作。" #: notebook/notebookapp.py:206 #, python-format @@ -41,46 +42,46 @@ msgstr "在使用notebook的JavaScript和LESS时,可以替换使用 `%s` " #: notebook/notebookapp.py:207 msgid "The `ignore_minified_js` flag is deprecated and will be removed in Notebook 6.0" -msgstr "" +msgstr "`ignore_minified_js` 这个标志已经被弃用,且会在Notebook 6.0版本时被移除" #: notebook/notebookapp.py:385 msgid "List currently running notebook servers." -msgstr "列出当前运行的Notebook服务." +msgstr "列出当前运行的Notebook服务。" #: notebook/notebookapp.py:389 msgid "Produce machine-readable JSON list output." -msgstr "生成机器可读的JSON输出." +msgstr "生成机器可读的JSON输出。" #: notebook/notebookapp.py:391 msgid "Produce machine-readable JSON object on each line of output." -msgstr "当前运行的服务" +msgstr "在每一行输出上生成机器可读的JSON。" #: notebook/notebookapp.py:395 msgid "If True, the output will be a JSON list of objects, one per active notebook server, each with the details from the relevant server info file." -msgstr "如果是正确的,输出将是一个对象的JSON列表,一个活动的笔记本服务器,每一个都有相关的服务器信息文件的详细信息。" +msgstr "如果是正确的,输出将是一个对象的JSON列表,每个活动的笔记本服务器都有一个,每一个都有相关的服务器信息文件的详细信息。" #: notebook/notebookapp.py:399 msgid "If True, each line of output will be a JSON object with the details from the server info file. For a JSON list output, see the NbserverListApp.jsonlist configuration value" -msgstr "如果是正确的,每一行输出将是一个JSON对象,其中有来自服务器信息文件的详细信息。对于一个JSON列表输出,请参阅NbserverListApp。jsonlist配置值" +msgstr "如果是正确的,每一行输出将是一个JSON对象,且包含来自服务器信息文件的详细信息。对于一个JSON列表输出,请参阅NbserverListApp.jsonlist配置值" #: notebook/notebookapp.py:425 msgid "Don't open the notebook in a browser after startup." -msgstr "在启动服务以后不在浏览器中打开一个窗口." +msgstr "请不要在启动服务以后在浏览器中打开notebook。" #: notebook/notebookapp.py:429 msgid "DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib." -msgstr "" +msgstr "尚未启用!请在notebook中使用 %pylab or %matplotlib 指令来启用 matplotlib 包。" #: notebook/notebookapp.py:445 msgid "Allow the notebook to be run from root user." -msgstr "允许notebook在root用户下运行." +msgstr "允许notebook在root用户下运行。" #: notebook/notebookapp.py:476 msgid "" "The Jupyter HTML Notebook.\n" " \n" " This launches a Tornado based HTML Notebook Server that serves up an HTML5/Javascript Notebook client." -msgstr "The Jupyter HTML Notebook.\n \n 这将启动一个基于tornado的HTML笔记本服务器,它提供一个html5/javascript笔记本客户端。" +msgstr "The Jupyter HTML Notebook.\n \n 这将启动一个基于tornado的HTML Notebook服务器,并提供一个HTML5/Javascript Notebook客户端。" #: notebook/notebookapp.py:515 msgid "Deprecated: Use minified JS file or not, mainly use during dev to avoid JS recompilation" @@ -88,11 +89,11 @@ msgstr "" #: notebook/notebookapp.py:546 msgid "Set the Access-Control-Allow-Credentials: true header" -msgstr "设置Access-Control-Allow-Credentials:true报头" +msgstr "请把Access-Control-Allow-Credentials设置为:true header" #: notebook/notebookapp.py:550 msgid "Whether to allow the user to run the notebook as root." -msgstr "是否允许notebook在root用户下运行." +msgstr "是否允许notebook在root用户下运行。" #: notebook/notebookapp.py:554 msgid "The default URL to redirect to from `/`" @@ -100,48 +101,48 @@ msgstr "从 `/` 重定向到的默认URL " #: notebook/notebookapp.py:558 msgid "The IP address the notebook server will listen on." -msgstr "notebook服务会监听的IP地址." +msgstr "notebook服务会监听的IP地址。" #: notebook/notebookapp.py:571 #, python-format msgid "" "Cannot bind to localhost, using 127.0.0.1 as default ip\n" "%s" -msgstr "不能绑定到localhost, 使用127.0.0.1作为默认的IP \n %s" +msgstr "不能绑定到localhost, 请使用127.0.0.1作为默认的IP \n %s" #: notebook/notebookapp.py:585 msgid "The port the notebook server will listen on." -msgstr "notebook服务会监听的IP端口." +msgstr "notebook服务会监听的IP端口。" #: notebook/notebookapp.py:589 msgid "The number of additional ports to try if the specified port is not available." -msgstr "如果指定的端口不可用,则要尝试其他端口的数量." +msgstr "如果指定的端口不可用,则要尝试其他端口的数量。" #: notebook/notebookapp.py:593 msgid "The full path to an SSL/TLS certificate file." -msgstr "SSL/TLS 认证文件所在全路径." +msgstr "SSL/TLS 认证文件所在的完整路径。" #: notebook/notebookapp.py:597 msgid "The full path to a private key file for usage with SSL/TLS." -msgstr "SSL/TLS 私钥文件所在全路径." +msgstr "SSL/TLS 私钥文件所在的完整路径。" #: notebook/notebookapp.py:601 msgid "The full path to a certificate authority certificate for SSL/TLS client authentication." -msgstr "用于ssl/tls客户端身份验证的证书颁发证书的完整路径." +msgstr "SSL/TLS 客户端身份验证的证书所在的完整路径。" #: notebook/notebookapp.py:605 msgid "The file where the cookie secret is stored." -msgstr "存放cookie密钥的文件被保存了." +msgstr "那个存放cookie密钥的文件。" #: notebook/notebookapp.py:634 #, python-format msgid "Writing notebook server cookie secret to %s" -msgstr "把notebook 服务cookie密码写入 %s" +msgstr "把notebook服务器的cookie密码写入 %s" #: notebook/notebookapp.py:641 #, python-format msgid "Could not set permissions on %s" -msgstr "不能在 %s 设置权限" +msgstr "无法在 %s 设置权限" #: notebook/notebookapp.py:646 msgid "" @@ -152,14 +153,14 @@ msgid "" "\n" " Setting to an empty string disables authentication altogether, which is NOT RECOMMENDED.\n" " " -msgstr "" +msgstr "服务器第一次连接所需要的认证秘钥。\n \n 如果没有弃用密码,\n 默认将生成一个新的随机秘钥。\n \n 由于设置为一个空白字段会自动关闭认证,我们不推荐该行为。\n" #: notebook/notebookapp.py:656 msgid "" "One-time token used for opening a browser.\n" " Once used, this token cannot be used again.\n" " " -msgstr "" +msgstr "打开浏览器的一次性秘钥。\n 一旦使用,则无法再次使用。\n" #: notebook/notebookapp.py:732 msgid "" @@ -176,17 +177,17 @@ msgstr "" #: notebook/notebookapp.py:743 msgid "DEPRECATED, use tornado_settings" -msgstr "" +msgstr "已被弃用!请使用 tornado_settings" #: notebook/notebookapp.py:748 msgid "" "\n" " webapp_settings is deprecated, use tornado_settings.\n" -msgstr "" +msgstr "webapp_settings已被弃用,请使用tornado_settings。" #: notebook/notebookapp.py:752 msgid "Supply overrides for the tornado.web.Application that the Jupyter notebook uses." -msgstr "" +msgstr "Supply重写了Jupyter notebook正在使用的tornado.web.Application。" #: notebook/notebookapp.py:756 msgid "" @@ -217,34 +218,34 @@ msgstr "" #: notebook/notebookapp.py:778 msgid "Supply extra arguments that will be passed to Jinja environment." -msgstr "" +msgstr "请添加Jinja环境所需要的额外的变量。" #: notebook/notebookapp.py:782 msgid "Extra variables to supply to jinja templates when rendering." -msgstr "" +msgstr "需要额外的变量去渲染Jinja模板。" #: notebook/notebookapp.py:818 msgid "DEPRECATED use base_url" -msgstr "" +msgstr "已被弃用!请使用 base_url" #: notebook/notebookapp.py:822 msgid "base_project_url is deprecated, use base_url" -msgstr "" +msgstr "base_project_url已被弃用!请使用 base_url" #: notebook/notebookapp.py:838 msgid "Path to search for custom.js, css" -msgstr "" +msgstr "搜索custom.js, css所在的路径" #: notebook/notebookapp.py:850 msgid "" "Extra paths to search for serving jinja templates.\n" "\n" " Can be used to override templates from notebook.templates." -msgstr "" +msgstr "额外寻找Jinja模板的路径。\n \n 可以被用来覆盖 notebook.templates 里的模板" #: notebook/notebookapp.py:861 msgid "extra paths to look for Javascript notebook extensions" -msgstr "" +msgstr "额外寻找Javascript notebook扩展的路径" #: notebook/notebookapp.py:906 #, python-format @@ -293,40 +294,40 @@ msgid "" "\n" " DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.\n" " " -msgstr "" +msgstr "\n 尚未启用!请在Notebook里使用 %pylab or %matplotlib 指令去启用matplotlib。\n" #: notebook/notebookapp.py:994 msgid "Support for specifying --pylab on the command line has been removed." -msgstr "" +msgstr "不再支持在命令行里使用 --pylab 指令。" #: notebook/notebookapp.py:996 msgid "Please use `%pylab{0}` or `%matplotlib{0}` in the notebook itself." -msgstr "" +msgstr "请在notebook里使用 %pylab{0}` or `%matplotlib{0}`。" #: notebook/notebookapp.py:1001 msgid "The directory to use for notebooks and kernels." -msgstr "用于笔记本和内核的目录。" +msgstr "用于notebooks和内核的目录。" #: notebook/notebookapp.py:1024 #, python-format msgid "No such notebook dir: '%r'" -msgstr "没有找到路径: '%r' " +msgstr "没有找到notebook的路径: '%r' " #: notebook/notebookapp.py:1037 msgid "DEPRECATED use the nbserver_extensions dict instead" -msgstr "不赞成使用nbserverextensions" +msgstr "已被弃用!请使用 nbserver_extensions dict 指令" #: notebook/notebookapp.py:1042 msgid "server_extensions is deprecated, use nbserver_extensions" -msgstr "服务器扩展被弃用,使用nbserverextensions" +msgstr "server_extensions指令已被弃用,请使用nbserver_extensions" #: notebook/notebookapp.py:1046 msgid "Dict of Python modules to load as notebook server extensions.Entry values can be used to enable and disable the loading ofthe extensions. The extensions will be loaded in alphabetical order." -msgstr "将Python模块作为笔记本服务器扩展加载。可以使用条目值来启用和禁用扩展的加载。这些扩展将以字母顺序加载。" +msgstr "可被作为notebook服务器扩展的Python模块们。可以使用条目值来启用和禁用扩展的加载。这些扩展将以字母顺序加载。" #: notebook/notebookapp.py:1055 msgid "Reraise exceptions encountered loading server extensions?" -msgstr "重新运行的异常会遇到加载服务器扩展吗?" +msgstr "加载服务器扩展时,遇到重新引发的异常?" #: notebook/notebookapp.py:1058 msgid "" @@ -346,7 +347,7 @@ msgstr "" msgid "" "(sec) Time window used to \n" " check the message and data rate limits." -msgstr "(sec)时间窗口被用来 \n 检查消息和数据速率限制." +msgstr "(sec)时间窗口被用来 \n 检查消息和限制数据速率。" #: notebook/notebookapp.py:1077 #, python-format @@ -355,7 +356,7 @@ msgstr "找不到文件或文件夹: %s" #: notebook/notebookapp.py:1147 msgid "Notebook servers are configured to only be run with a password." -msgstr "服务设置为只能使用密码运行." +msgstr "Notebook服务器被设置为只能使用密码运行。" #: notebook/notebookapp.py:1148 msgid "Hint: run the following command to set a password" @@ -363,21 +364,21 @@ msgstr "提示: 运行下面命令设置密码" #: notebook/notebookapp.py:1149 msgid "\t$ python -m notebook.auth password" -msgstr "" +msgstr "\t$ python -m notebook.auth password" #: notebook/notebookapp.py:1187 #, python-format msgid "The port %i is already in use, trying another port." -msgstr "端口 %i 已经被占用, 请尝试其他端口." +msgstr "端口 %i 已经被占用, 请尝试其他端口。" #: notebook/notebookapp.py:1190 #, python-format msgid "Permission to listen on port %i denied" -msgstr "监听端口 %i 失败" +msgstr "没有监听端口 %i 的权限" #: notebook/notebookapp.py:1199 msgid "ERROR: the notebook server could not be started because no available port could be found." -msgstr "错误: 服务启动失败因为没有找到可用的端口. " +msgstr "错误: Notebook服务器启动失败 - 因为没有找到可用的端口。" #: notebook/notebookapp.py:1205 msgid "[all ip addresses on your system]" @@ -403,15 +404,15 @@ msgstr "" #: notebook/notebookapp.py:1269 #, python-format msgid "Shutdown this notebook server (%s/[%s])? " -msgstr "关闭服务 (%s/[%s])" +msgstr "关闭这个notebook服务器 (%s/[%s])" #: notebook/notebookapp.py:1275 msgid "Shutdown confirmed" -msgstr "关闭确定" +msgstr "确认关闭" #: notebook/notebookapp.py:1279 msgid "No answer for 5s:" -msgstr "5s 未响应" +msgstr "5秒未响应" #: notebook/notebookapp.py:1280 msgid "resuming operation..." @@ -431,39 +432,39 @@ msgstr "加载插件 %s 失败" #, python-format msgid "Shutting down %d kernel" msgid_plural "Shutting down %d kernels" -msgstr[0] "关闭 %d 服务" -msgstr[1] "关闭 %d 服务" +msgstr[0] "关闭 %d 内核" +msgstr[1] "关闭 %d 内核" #: notebook/notebookapp.py:1383 #, python-format msgid "%d active kernel" msgid_plural "%d active kernels" -msgstr[0] "%d 活跃的服务" -msgstr[1] "%d 活跃的服务" +msgstr[0] "%d 活跃的内核" +msgstr[1] "%d 活跃的内核" #: notebook/notebookapp.py:1387 #, python-format msgid "" "The Jupyter Notebook is running at:\n" "%s" -msgstr "本程序运行在: %s" +msgstr "Jupyter Notebook运行在:\n %s" #: notebook/notebookapp.py:1434 msgid "Running as root is not recommended. Use --allow-root to bypass." -msgstr "不建议以root身份运行.使用--allow-root绕过过." +msgstr "不建议以root身份运行。请使用 --allow-root 绕过。" #: notebook/notebookapp.py:1440 msgid "Use Control-C to stop this server and shut down all kernels (twice to skip confirmation)." -msgstr "使用control-c停止此服务器并关闭所有内核(两次跳过确认)." +msgstr "使用 Control-C 停止此服务器并关闭所有内核(连续操作两次便可跳过确认界面)。" #: notebook/notebookapp.py:1442 msgid "Welcome to Project Jupyter! Explore the various tools available and their corresponding documentation. If you are interested in contributing to the platform, please visit the communityresources section at http://jupyter.org/community.html." -msgstr "欢迎来到项目Jupyter! 探索可用的各种工具及其相应的文档. 如果你有兴趣对这个平台,请访问http://jupyter.org/community.html community resources部分." +msgstr "欢迎来到Jupyter项目! 探索可用的各种工具及其相应的文档。如果你有兴趣对这个平台,请访问http://jupyter.org/community.html 的community resources部分。" #: notebook/notebookapp.py:1453 #, python-format msgid "No web browser found: %s." -msgstr "没有找到web浏览器: %s." +msgstr "没有找到网页浏览器: %s。" #: notebook/notebookapp.py:1458 #, python-format @@ -477,7 +478,7 @@ msgstr "已经中断..." #: notebook/services/contents/filemanager.py:525 #, python-format msgid "Serving notebooks from local directory: %s" -msgstr "启动notebooks 在本地路径: %s" +msgstr "notebooks 运行所在的本地路径: %s" #: notebook/services/contents/manager.py:69 msgid "Untitled" From 751c7eb0cc7d252e5ee3a378056c6eee107445a1 Mon Sep 17 00:00:00 2001 From: David Leen Date: Wed, 3 Nov 2021 14:55:23 -0700 Subject: [PATCH 04/10] Fix asyncio error when opening notebooks This is a fix for https://github.com/jupyter/notebook/issues/6164 `nest_asyncio` must be applied before any async tasks have been created otherwise there could be tasks queued that are unpatched, and thus do not respect nested loops. An example of an unpatched task can be seen in the original issue: ``` ``` which originates from Tornado. A similar issue was reported in `nest-asyncio`: https://github.com/erdewit/nest_asyncio/issues/22 where the solution is to call `apply` on import so that unpatched tasks do not get created. --- notebook/notebookapp.py | 27 +++++++++++++++++++++++++++ notebook/tests/launchnotebook.py | 14 ++++++++++---- setup.py | 1 + 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 510e51240c6..e07bfcf507f 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -2092,7 +2092,34 @@ def _init_asyncio_patch(self): FIXME: if/when tornado supports the defaults in asyncio, remove and bump tornado requirement for py38 + + With the introduction of the async kernel, the existing sync kernel + requires the use of nested loops in order to run code synchronously. + This is done in `jupyter_client` using the helper util `run_sync`: + + ref: https://github.com/jupyter/jupyter_client/blob/f453b51eeeff9e905c583b7da3905c0e35cfbdf0/jupyter_client/utils.py#L11 + + which creates a new event loop and relies on `nest_asyncio` patching + to allow nested loops. This requires that *all* potential tasks are + patched before executing. When only some tasks are patched it leads to + the following issue: + + ref: https://github.com/jupyter/notebook/issues/6164 + + So we must call `nest_asyncio.apply()` method as early as possible. It + is preferable to do this in the consuming application rather than the + `jupyter_client` as it is a global patch and would impact all consumers + rather than just the ones that rely on synchronous kernel behavior. """ + import nest_asyncio + + try: + nest_asyncio.apply() + except RuntimeError: + # nest_asyncio requires a running loop in order to patch. + # In tests the loop may not have been created yet. + pass + if sys.platform.startswith("win") and sys.version_info >= (3, 8): import asyncio try: diff --git a/notebook/tests/launchnotebook.py b/notebook/tests/launchnotebook.py index bb5f8b77818..426ce43ffd9 100644 --- a/notebook/tests/launchnotebook.py +++ b/notebook/tests/launchnotebook.py @@ -167,10 +167,16 @@ def start_thread(): token=cls.token, **bind_args ) - if 'asyncio' in sys.modules: - app._init_asyncio_patch() - import asyncio - asyncio.set_event_loop(asyncio.new_event_loop()) + if "asyncio" in sys.modules: + app._init_asyncio_patch() + import asyncio + + asyncio.set_event_loop(asyncio.new_event_loop()) + # Patch the current loop in order to match production + # behavior + import nest_asyncio + + nest_asyncio.apply() # don't register signal handler during tests app.init_signal = lambda : None # clear log handlers and propagate to root for nose to capture it diff --git a/setup.py b/setup.py index 4ae0febdc6c..c54f9a15947 100755 --- a/setup.py +++ b/setup.py @@ -121,6 +121,7 @@ 'jupyter_client>=5.3.4', 'nbformat', 'nbconvert', + 'nest-asyncio>=1.5', 'ipykernel', # bless IPython kernel for now 'Send2Trash>=1.8.0', 'terminado>=0.8.3', From 25abca0723c24bbfb122e9b12f090e1766eab81a Mon Sep 17 00:00:00 2001 From: Niyas Sait Date: Thu, 11 Nov 2021 16:05:57 +0000 Subject: [PATCH 05/10] Enable terminal tests as pywinpty is ported for python 3.9 --- .github/workflows/python.yml | 2 +- notebook/conftest.py | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 notebook/conftest.py diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 92ee5d5214e..6d6f7be07ac 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python-version: [ '3.6' , '3.7', '3.8', '3.9' ] # Windows 3.9 fails due to the pywinpty dependency not working (Issue #5967) + python-version: [ '3.6' , '3.7', '3.8', '3.9' ] steps: - name: Checkout uses: actions/checkout@v1 diff --git a/notebook/conftest.py b/notebook/conftest.py deleted file mode 100644 index 2b1a913653d..00000000000 --- a/notebook/conftest.py +++ /dev/null @@ -1,10 +0,0 @@ - -import pytest - -import sys - -# TODO: Remove this hook once Issue #5967 is resolved. -def pytest_ignore_collect(path): - if str(path).endswith("test_terminals_api.py"): - if sys.platform.startswith('win') and sys.version_info >= (3, 9): - return True # do not collect From a9a31c096eeffe1bff4e9164c6a0442e0e13cdb3 Mon Sep 17 00:00:00 2001 From: Ben Greiner Date: Mon, 15 Nov 2021 19:38:24 +0100 Subject: [PATCH 06/10] TST: don't look in user site for serverextensions (#6233) * TST: don't look in user site for serverextensions --- notebook/tests/test_serverextensions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notebook/tests/test_serverextensions.py b/notebook/tests/test_serverextensions.py index 35da80d4c53..898647926bc 100644 --- a/notebook/tests/test_serverextensions.py +++ b/notebook/tests/test_serverextensions.py @@ -1,5 +1,6 @@ import imp import os +import site import sys from unittest import TestCase from unittest.mock import patch @@ -84,6 +85,11 @@ def setUp(self): p = patch.object(mod, 'ENV_CONFIG_PATH', []) self.patches.append(p) + # avoid adding the user site to the config paths with jupyter-core >= 4.9 + # https://github.com/jupyter/jupyter_core/pull/242 + p = patch.object(site, + 'ENABLE_USER_SITE', False) + self.patches.append(p) for p in self.patches: p.start() self.addCleanup(p.stop) From 34b48688aac45766a0a9bc79838dd428c8e3f51e Mon Sep 17 00:00:00 2001 From: Kevin Bates Date: Tue, 16 Nov 2021 14:50:02 -0800 Subject: [PATCH 07/10] Automated Changelog Entry for 6.4.6 on master (#6234) * Automated Changelog Entry for 6.4.6 on master * Update CHANGELOG.md Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d0c1e7c72..ae7d23cbe1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,31 @@ Use `pip install pip --upgrade` to upgrade pip. Check pip version with +## 6.4.6 + +([Full Changelog](https://github.com/jupyter/notebook/compare/v6.4.5...160c27d3c23dafe8b42240571db21b0d5cbae2fe)) + +### Bugs fixed + +- Fix `asyncio` error when opening notebooks [#6221](https://github.com/jupyter/notebook/pull/6221) ([@dleen](https://github.com/dleen)) +- Change to use a universal Chinese translation on certain words [#6218](https://github.com/jupyter/notebook/pull/6218) ([@jackexu](https://github.com/jackexu)) +- Fix Chinese translation typo [#6211](https://github.com/jupyter/notebook/pull/6211) ([@maliubiao](https://github.com/maliubiao) +- Fix `send2trash` tests failing on Windows [#6127](https://github.com/jupyter/notebook/pull/6127) ([@dolfinus](https://github.com/dolfinus)) + +### Maintenance and upkeep improvements + +- TST: don't look in user site for serverextensions [#6233](https://github.com/jupyter/notebook/pull/6233) ([@bnavigator](https://github.com/bnavigator)) +- Enable terminal tests as `pywinpty` is ported for python 3.9 [#6228](https://github.com/jupyter/notebook/pull/6228) ([@nsait-linaro](https://github.com/nsait-linaro)) + + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter/notebook/graphs/contributors?from=2021-10-19&to=2021-11-16&type=c)) + +[@bnavigator](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Abnavigator+updated%3A2021-10-19..2021-11-16&type=Issues) | [@dleen](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Adleen+updated%3A2021-10-19..2021-11-16&type=Issues) | [@dolfinus](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Adolfinus+updated%3A2021-10-19..2021-11-16&type=Issues) | [@jackexu](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Ajackexu+updated%3A2021-10-19..2021-11-16&type=Issues) | [@kevin-bates](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Akevin-bates+updated%3A2021-10-19..2021-11-16&type=Issues) | [@maliubiao](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Amaliubiao+updated%3A2021-10-19..2021-11-16&type=Issues) | [@nsait-linaro](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Ansait-linaro+updated%3A2021-10-19..2021-11-16&type=Issues) | [@takluyver](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Atakluyver+updated%3A2021-10-19..2021-11-16&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3AZsailer+updated%3A2021-10-19..2021-11-16&type=Issues) + + + ## 6.4.5 ([Full Changelog](https://github.com/jupyter/notebook/compare/v6.4.4...ccd9665571107e02a325a738b8baebd6532b2d3d)) @@ -34,15 +59,12 @@ Use `pip install pip --upgrade` to upgrade pip. Check pip version with - Pin `nbsphinx` to 0.8.6, clean up orphaned resources [#6194](https://github.com/jupyter/notebook/pull/6194) ([@kevin-bates](https://github.com/kevin-bates)) - Fix typo in docstring [#6188](https://github.com/jupyter/notebook/pull/6188) ([@jgarte](https://github.com/jgarte)) - ### Contributors to this release ([GitHub contributors page for this release](https://github.com/jupyter/notebook/graphs/contributors?from=2021-09-03&to=2021-10-19&type=c)) [@blink1073](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Ablink1073+updated%3A2021-09-03..2021-10-19&type=Issues) | [@jgarte](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Ajgarte+updated%3A2021-09-03..2021-10-19&type=Issues) | [@kevin-bates](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Akevin-bates+updated%3A2021-09-03..2021-10-19&type=Issues) | [@martinRenou](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3AmartinRenou+updated%3A2021-09-03..2021-10-19&type=Issues) | [@mgeier](https://github.com/search?q=repo%3Ajupyter%2Fnotebook+involves%3Amgeier+updated%3A2021-09-03..2021-10-19&type=Issues) - - ## 6.4.4 ([Full Changelog](https://github.com/jupyter/notebook/compare/v6.4.3...c06c340574e1d2207940c5bd1190eb73d82ab945)) From 20e9ebdb2e89990eb33a70fba9c1ce70af1e171a Mon Sep 17 00:00:00 2001 From: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:58:35 +0000 Subject: [PATCH 08/10] Publish 6.4.6 SHA256 hashes: notebook-6.4.6-py3-none-any.whl: 5cad068fa82cd4fb98d341c052100ed50cd69fbfb4118cb9b8ab5a346ef27551 notebook-6.4.6.tar.gz: 7bcdf79bd1cda534735bd9830d2cbedab4ee34d8fe1df6e7b946b3aab0902ba3 --- notebook/_version.py | 2 +- notebook/static/base/js/namespace.js | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/notebook/_version.py b/notebook/_version.py index 29244a3b215..ebd1bffdb70 100644 --- a/notebook/_version.py +++ b/notebook/_version.py @@ -5,7 +5,7 @@ import re # Version string must appear intact for tbump versioning -__version__ = '6.4.5' +__version__ = '6.4.6' # Build up version_info tuple for backwards compatibility pattern = r'(?P\d+).(?P\d+).(?P\d+)(?P.*)' diff --git a/notebook/static/base/js/namespace.js b/notebook/static/base/js/namespace.js index eeab968d7c9..9cd125c1029 100644 --- a/notebook/static/base/js/namespace.js +++ b/notebook/static/base/js/namespace.js @@ -73,7 +73,7 @@ define(function(){ // tree jglobal('SessionList','tree/js/sessionlist'); - Jupyter.version = "6.4.5"; + Jupyter.version = "6.4.6"; Jupyter._target = '_blank'; return Jupyter; diff --git a/pyproject.toml b/pyproject.toml index 57c348462a2..827a2367de3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ before-build-python = ["pip install babel", "npm install -g po2json"] ignore-glob = ["docs/source/examples/Notebook/Working With Markdown Cells.ipynb", "docs-translations/**/README.md", "docs/source/contributing.rst", "docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb", "CHANGELOG.md", "notebook/static/components/**/*.*"] [tool.tbump.version] -current = "6.4.5" +current = "6.4.6" regex = ''' (?P\d+)\.(?P\d+)\.(?P\d+) ((?Pa|b|rc|.dev)(?P\d+))? From d5f0c97091da7f99d98325eed02e4905e98bbfc0 Mon Sep 17 00:00:00 2001 From: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:58:41 +0000 Subject: [PATCH 09/10] Bump to 6.5.0.dev0 --- notebook/_version.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/_version.py b/notebook/_version.py index ebd1bffdb70..6c5729f54dc 100644 --- a/notebook/_version.py +++ b/notebook/_version.py @@ -5,7 +5,7 @@ import re # Version string must appear intact for tbump versioning -__version__ = '6.4.6' +__version__ = '6.5.0.dev0' # Build up version_info tuple for backwards compatibility pattern = r'(?P\d+).(?P\d+).(?P\d+)(?P.*)' diff --git a/pyproject.toml b/pyproject.toml index 827a2367de3..9553029ced3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ before-build-python = ["pip install babel", "npm install -g po2json"] ignore-glob = ["docs/source/examples/Notebook/Working With Markdown Cells.ipynb", "docs-translations/**/README.md", "docs/source/contributing.rst", "docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb", "CHANGELOG.md", "notebook/static/components/**/*.*"] [tool.tbump.version] -current = "6.4.6" +current = "6.5.0.dev0" regex = ''' (?P\d+)\.(?P\d+)\.(?P\d+) ((?Pa|b|rc|.dev)(?P\d+))? From 601ac0e4f4ccf630f0ac8943411992790e419797 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 18 Nov 2021 15:50:27 -0600 Subject: [PATCH 10/10] enforce labels on PRs (#6235) --- .github/workflows/enforce-label.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/enforce-label.yml diff --git a/.github/workflows/enforce-label.yml b/.github/workflows/enforce-label.yml new file mode 100644 index 00000000000..354a0468d70 --- /dev/null +++ b/.github/workflows/enforce-label.yml @@ -0,0 +1,11 @@ +name: Enforce PR label + +on: + pull_request: + types: [labeled, unlabeled, opened, edited, synchronize] +jobs: + enforce-label: + runs-on: ubuntu-latest + steps: + - name: enforce-triage-label + uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1