码迷,mamicode.com
首页 > Windows程序 > 详细

Atom windows 版不完全汉化方法 附代码

时间:2015-06-26 22:23:53      阅读:511      评论:0      收藏:0      [点我收藏+]

标签:

刚刚发布的 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 版不完全汉化方法 附代码

标签:

原文地址:http://www.cnblogs.com/night-ride-depart/p/4603271.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!