標籤:
剛剛發布的 Atom 1.0 . 看到的第一眼就喜歡上了它. 不太喜歡 vs code 的龐大.
可惜沒中文, 於是找啊找.終於找到個半吊子的方法來漢化 - -
不喜勿噴
查看的官方開發文檔 https://atom.io/docs/api/v1.0.0/MenuManager
以及git倉庫 https://github.com/atom/atom
由於只有添加的方法,沒有消除的方法,所以就這個樣子了,沒法刪除原來的菜單.
諸君也可以自己試試看.
而且以下漢化用代碼是根據
https://github.com/atom/atom/blob/master/menus/win32.cson
的代碼改變而來的,他們沒有更新條目,所以漢化還缺命令,[尋找]什麼的,[包],都是空的(汗).以後有時間補上吧.
具體方法
開啟Atom, 功能表列 - File - Open Your Init Script
把以下代碼插入到檔案中 (也就是使用者檔案下的 (%使用者名稱)\.atom\init.coffee 檔案)
atom.menu.add [ { label: ‘檔案‘ submenu: [ { label: ‘開啟一個新視窗‘, command: ‘application:new-window‘ } { label: ‘開啟一個新檔案‘, command: ‘application:new-file‘ } { label: ‘開啟檔案...‘, command: ‘application:open-file‘ } { label: ‘開啟檔案夾...‘, command: ‘application:open-folder‘ } { label: ‘向工程添加一個檔案夾...‘, command: ‘application:add-project-folder‘ } { label: ‘重新開啟被關閉的項目‘, command: ‘pane:reopen-closed-item‘ } { type: ‘separator‘ } { label: ‘設定‘, command: ‘application:show-settings‘ } { label: ‘開啟設定檔‘, command: ‘application:open-your-config‘ } { label: ‘開啟初始化指令檔‘, command: ‘application:open-your-init-script‘ } { label: ‘開啟快速鍵設定檔‘, command: ‘application:open-your-keymap‘ } { label: ‘開啟Snippets設定檔‘, command: ‘application:open-your-snippets‘ } { label: ‘開啟風格設定檔‘, command: ‘application:open-your-stylesheet‘ } { type: ‘separator‘ } { label: ‘儲存‘, command: ‘core:save‘ } { label: ‘另存新檔...‘, command: ‘core:save-as‘ } { label: ‘儲存所有玩家‘, command: ‘window:save-all‘ } { type: ‘separator‘ } { label: ‘關閉標籤‘, command: ‘core:close‘ } { label: ‘關閉窗格‘, command: ‘pane:close‘ } { label: ‘關閉視窗‘, command: ‘window:close‘ } { type: ‘separator‘ } { label: ‘退出‘, command: ‘application:quit‘ } ] } { label: ‘編輯‘ submenu: [ { label: ‘撤銷‘, command: ‘core:undo‘ } { label: ‘重做‘, command: ‘core:redo‘ } { type: ‘separator‘ } { label: ‘剪貼‘, command: ‘core:cut‘ } { label: ‘複製‘, command: ‘core:copy‘ } { label: ‘複製路徑‘, command: ‘editor:copy-path‘ } { label: ‘粘貼‘, command: ‘core:paste‘ } { label: ‘全選‘, command: ‘core:select-all‘ } { type: ‘separator‘ } { label: ‘注釋選中行‘, command: ‘editor:toggle-line-comments‘ } { label: ‘行編輯‘, submenu: [ { label: ‘向右縮排選中行‘, command: ‘editor:indent-selected-rows‘ } { label: ‘負值縮排選中行‘, command: ‘editor:outdent-selected-rows‘ } { label: ‘自動縮排‘, command: ‘editor:auto-indent‘ } { type: ‘separator‘ } { label: ‘上移選中行‘, command: ‘editor:move-line-up‘ } { label: ‘下移選中行‘, command: ‘editor:move-line-down‘ } { label: ‘複製選中行‘, command: ‘editor:duplicate-lines‘ } { label: ‘刪除選中行‘, command: ‘editor:delete-line‘ } { label: ‘合并到當前行‘, command: ‘editor:join-lines‘ } ] } { label: ‘文本‘, submenu: [ { label: ‘轉為大寫字母‘, command: ‘editor:upper-case‘ } { label: ‘轉為小寫字母‘, command: ‘editor:lower-case‘ } { type: ‘separator‘ } { label: ‘刪除到下一個單詞‘, command: ‘editor:delete-to-end-of-word‘ } { label: ‘刪除到前一個單詞末尾‘, command: ‘editor:delete-to-previous-word-boundary‘ } { label: ‘刪除到前一個單詞‘, command: ‘editor:delete-to-next-word-boundary‘ } { label: ‘刪除選中行‘, command: ‘editor:delete-line‘ } { type: ‘separator‘ } { label: ‘互動左右文字‘, command: ‘editor:transpose‘ } ] } { label: ‘摺疊‘, submenu: [ { label: ‘摺疊當前塊‘, command: ‘editor:fold-current-row‘ } { label: ‘展開當前塊‘, command: ‘editor:unfold-current-row‘ } { label: ‘展開所有的摺疊塊‘, command: ‘editor:unfold-all‘ } { type: ‘separator‘ } { label: ‘摺疊所有塊‘, command: ‘editor:fold-all‘ } { label: ‘摺疊所有的1級塊‘, command: ‘editor:fold-at-indent-level-1‘ } { label: ‘摺疊所有的2級塊‘, command: ‘editor:fold-at-indent-level-2‘ } { label: ‘摺疊所有的3級塊‘, command: ‘editor:fold-at-indent-level-3‘ } { label: ‘摺疊所有的4級塊‘, command: ‘editor:fold-at-indent-level-4‘ } { label: ‘摺疊所有的5級塊‘, command: ‘editor:fold-at-indent-level-5‘ } { label: ‘摺疊所有的6級塊‘, command: ‘editor:fold-at-indent-level-6‘ } { label: ‘摺疊所有的7級塊‘, command: ‘editor:fold-at-indent-level-7‘ } { label: ‘摺疊所有的8級塊‘, command: ‘editor:fold-at-indent-level-8‘ } { label: ‘摺疊所有的9級塊‘, command: ‘editor:fold-at-indent-level-9‘ } ] } ] } { label: ‘視圖‘ submenu: [ { label: ‘重新載入視窗‘, command: ‘window:reload‘ } { label: ‘全屏‘, command: ‘window:toggle-full-screen‘ } { label: ‘隱藏功能表列‘, command: ‘window:toggle-menu-bar‘ } { label: ‘窗格‘ submenu: [ { label: ‘向上開啟新窗格‘, command: ‘pane:split-up‘ } { label: ‘向下開啟新窗格‘, command: ‘pane:split-down‘ } { label: ‘向左開啟新窗格‘, command: ‘pane:split-left‘ } { label: ‘向右開啟新窗格‘, command: ‘pane:split-right‘ } { type: ‘separator‘ } { label: ‘焦點轉移到下一個窗格‘, command: ‘window:focus-next-pane‘ } { label: ‘焦點轉移到前一個窗格‘, command: ‘window:focus-previous-pane‘ } { type: ‘separator‘ } { label: ‘焦點轉移到上邊的窗格‘, command: ‘window:focus-pane-above‘ } { label: ‘焦點轉移到下邊的窗格‘, command: ‘window:focus-pane-below‘ } { label: ‘焦點轉移到左邊的窗格‘, command: ‘window:focus-pane-on-left‘ } { label: ‘焦點轉移到右邊的窗格‘, command: ‘window:focus-pane-on-right‘ } { type: ‘separator‘ } { label: ‘關閉窗格‘, command: ‘pane:close‘ } ] } { label: ‘開發人員工具‘ submenu: [ { label: ‘Open In &Dev Mode...‘, command: ‘application:open-dev‘ } { label: ‘Run &Atom Specs‘, command: ‘application:run-all-specs‘ } { label: ‘Run Package &Specs‘, command: ‘window:run-package-specs‘ } { label: ‘審查元素‘, command: ‘window:toggle-dev-tools‘ } ] } { type: ‘separator‘ } { label: ‘增大字型大小‘, command: ‘window:increase-font-size‘ } { label: ‘減小字型大小‘, command: ‘window:decrease-font-size‘ } { label: ‘重設字型大小‘, command: ‘window:reset-font-size‘ } { type: ‘separator‘ } { label: ‘Toggle Soft &Wrap‘, command: ‘editor:toggle-soft-wrap‘ } { label: ‘重設字型大小‘, command: ‘window:Toggle:show-settings‘ } ] } { label: ‘選擇‘ submenu: [ { label: ‘向上添加游標‘, command: ‘editor:add-selection-above‘ } { label: ‘向下添加游標‘, command: ‘editor:add-selection-below‘ } { label: ‘將選區轉換成多個單行選區‘, command: ‘editor:split-selections-into-lines‘} { label: ‘將選區轉換成一行行選區‘, command: ‘editor:consolidate-selections‘} { type: ‘separator‘ } { label: ‘選中到頂部‘, command: ‘core:select-to-top‘ } { label: ‘選中到底部‘, command: ‘core:select-to-bottom‘ } { type: ‘separator‘ } { label: ‘選中當前行‘, command: ‘editor:select-line‘ } { label: ‘選中當前單詞‘, command: ‘editor:select-word‘ } { label: ‘選中到詞的開始‘, command: ‘editor:select-to-beginning-of-word‘ } { label: ‘選中到行的開始‘, command: ‘editor:select-to-beginning-of-line‘ } { label: ‘選中到當前行的第一個字元‘, command: ‘editor:select-to-first-character-of-line‘ } { label: ‘選中到詞的末尾‘, command: ‘editor:select-to-end-of-word‘ } { label: ‘選中到行的開始‘, command: ‘find-and-replace:elect-to-end-of-line‘ } ] } { label: ‘尋找‘ submenu: [] } { label: ‘包‘ submenu: [] } { label: ‘協助‘ submenu: [ { label: ‘查看我們的團隊‘, command: ‘application:open-terms-of-use‘ } { label: ‘查看認證‘, command: ‘application:open-license‘ } { label: ‘版本號碼 1.0.0‘, enabled: false } { label: ‘安裝跟新並重啟‘, command: ‘application:install-update‘, visible: false} { label: ‘檢查更新‘, command: ‘application:check-for-update‘, visible: false} { label: ‘檢查更新‘, enabled: false, visible: false} { label: ‘下載更新‘, enabled: false, visible: false} { type: ‘separator‘ } { label: ‘開啟開發文檔頁面‘, command: ‘application:open-documentation‘ } { label: ‘開啟藍圖頁面‘, command: ‘application:open-roadmap‘ } { label: ‘開啟問答頁面‘, command: ‘application:open-faq‘ } { type: ‘separator‘ } { label: ‘開啟討論頁面‘, command: ‘application:open-discussions‘ } { label: ‘報告問題‘, command: ‘application:report-issue‘ } { label: ‘搜尋問題‘, command: ‘application:search-issues‘ } ] } ]
Atom windows 版不完全漢化方法 附代碼