فهرست منبع

菜单项添加中文翻译。 #201

oldj 8 سال پیش
والد
کامیت
1224f02ed8
6فایلهای تغییر یافته به همراه80 افزوده شده و 22 حذف شده
  1. 22 0
      app/lang/cn.js
  2. 22 0
      app/lang/en.js
  3. 34 19
      app/menu/main_menu.js
  4. 0 1
      app/static/bundle.js
  5. 1 1
      app/static/common.js
  6. 1 1
      app/version.js

+ 22 - 0
app/lang/cn.js

@@ -44,6 +44,26 @@ exports.content = {
   , is_updated_title: '已是最新'
   , language: '语言'
   , last_refresh: '上次更新:'
+  , menu_about: '关于'
+  , menu_bringalltofront: '所有窗口移至最前'
+  , menu_close: '关闭'
+  , menu_cut: '剪切'
+  , menu_copy: '复制'
+  , menu_delete: '删除'
+  , menu_hide: '隐藏'
+  , menu_hideothers: '隐藏其他'
+  , menu_minimize: '最小化'
+  , menu_paste: '粘贴'
+  , menu_quit: '退出'
+  , menu_reload: '重新载入'
+  , menu_resetzoom: '重置缩放'
+  , menu_selectall: '全选'
+  , menu_toggle_developer_tools: '切换开发者工具'
+  , menu_togglefullscreen: '切换全屏'
+  , menu_unhide: '取消隐藏'
+  , menu_zoom: '缩放'
+  , menu_zoomin: '放大'
+  , menu_zoomout: '缩小'
   , never: '从不'
   , new: '新建'
   , new_version_available: '检测到新版本,立刻下载?'
@@ -59,6 +79,7 @@ exports.content = {
   , preferences: '设置'
   , quit: '退出'
   , readonly: '只读'
+  , redo: '重做'
   , refresh: '刷新'
   , remote_hosts: '远程方案'
   , search: '搜索'
@@ -71,6 +92,7 @@ exports.content = {
   , tmp_clean: '临时去掉所有绑定'
   , tmp_recover: '恢复绑定'
   , toggle_dock_icon: '显示/隐藏 Dock 图标'
+  , undo: '撤销'
   , untitled: '未命名'
   , url: 'URL 地址'
   , view: '视图'

+ 22 - 0
app/lang/en.js

@@ -44,6 +44,26 @@ exports.content = {
   , is_updated_title: 'You are up to date!'
   , language: 'Language'
   , last_refresh: 'Last refresh: '
+  , menu_about: 'About'
+  , menu_bringalltofront: 'Bring All to Front'
+  , menu_close: 'Close'
+  , menu_cut: 'Cut'
+  , menu_copy: 'Copy'
+  , menu_delete: 'Delete'
+  , menu_hide: 'Hide'
+  , menu_hideothers: 'Hide Others'
+  , menu_minimize: 'Minimize'
+  , menu_paste: 'Paste'
+  , menu_quit: 'Quit'
+  , menu_reload: 'Reload'
+  , menu_resetzoom: 'Reset Zoom'
+  , menu_toggle_developer_tools: 'Toggle Developer Tools'
+  , menu_togglefullscreen: 'Toggle Full Screen'
+  , menu_selectall: 'Select All'
+  , menu_unhide: 'Unhide'
+  , menu_zoom: 'Zoom'
+  , menu_zoomin: 'Zoom In'
+  , menu_zoomout: 'Zoom Out'
   , never: 'never'
   , new: 'New'
   , new_version_available: 'New version available, download now?'
@@ -59,6 +79,7 @@ exports.content = {
   , preferences: 'Preferences'
   , quit: 'Quit'
   , readonly: 'Read only'
+  , redo: 'Redo'
   , refresh: 'Refresh'
   , remote_hosts: 'Remote hosts'
   , search: 'Search'
@@ -71,6 +92,7 @@ exports.content = {
   , tmp_clean: 'Temporarily turn off all rules.'
   , tmp_recover: 'Recover rules.'
   , toggle_dock_icon: 'Toggle Dock Icon'
+  , undo: 'Undo'
   , untitled: 'untitled'
   , url: 'URL'
   , view: 'View'

+ 34 - 19
app/menu/main_menu.js

@@ -37,7 +37,7 @@ function doInit (app, lang) {
             dialog.showOpenDialog({
               title: lang.import,
               defaultPath: path.join(last_path || download_path ||
-                                     paths.home_path, 'sh.json'),
+                paths.home_path, 'sh.json'),
               filters: [
                 {name: 'JSON', extensions: ['json']},
                 {name: 'All Files', extensions: ['*']}
@@ -56,7 +56,7 @@ function doInit (app, lang) {
             dialog.showSaveDialog({
               title: lang.export,
               defaultPath: path.join(last_path || download_path ||
-                                     paths.home_path, 'sh.json'),
+                paths.home_path, 'sh.json'),
               filters: [
                 {name: 'JSON', extensions: ['json']},
                 {name: 'All Files', extensions: ['*']}
@@ -85,22 +85,27 @@ function doInit (app, lang) {
       label: lang.edit,
       submenu: [
         {
+          label: lang.undo,
           role: 'undo'
         }, {
+          label: lang.redo,
           role: 'redo'
         }, {
           type: 'separator'
         }, {
+          label: lang.menu_cut,
           role: 'cut'
         }, {
+          label: lang.menu_copy,
           role: 'copy'
         }, {
+          label: lang.menu_paste,
           role: 'paste'
         }, {
-          role: 'pasteandmatchstyle'
-        }, {
+          label: lang.menu_delete,
           role: 'delete'
         }, {
+          label: lang.menu_selectall,
           role: 'selectall'
         }, {
           type: 'separator'
@@ -142,30 +147,35 @@ function doInit (app, lang) {
         //     type: 'separator'
         // },
         {
+          label: lang.menu_resetzoom,
           role: 'resetzoom'
         },
         {
+          label: lang.menu_zoomin,
           role: 'zoomin'
         },
         {
+          label: lang.menu_zoomout,
           role: 'zoomout'
         },
         {
           type: 'separator'
         },
         {
+          label: lang.menu_togglefullscreen,
           role: 'togglefullscreen'
         }
       ]
     }, {
       label: lang.window,
       role: 'window',
-      submenu: [
-        {
-          role: 'minimize'
-        }, {
-          role: 'close'
-        }]
+      submenu: [{
+        label: lang.menu_minimize,
+        role: 'minimize'
+      }, {
+        label: lang.menu_close,
+        role: 'close'
+      }]
     }, {
       label: lang.help,
       role: 'help',
@@ -199,6 +209,7 @@ function doInit (app, lang) {
       label: name,
       submenu: [
         {
+          label: lang.menu_about,
           role: 'about'
         }, {
           type: 'separator'
@@ -211,14 +222,18 @@ function doInit (app, lang) {
         //     type: 'separator'
         // },
         {
+          label: lang.menu_hide,
           role: 'hide'
         }, {
+          label: lang.menu_hideothers,
           role: 'hideothers'
         }, {
+          label: lang.menu_unhide,
           role: 'unhide'
         }, {
           type: 'separator'
         }, {
+          label: lang.menu_quit,
           role: 'quit'
         }]
     })
@@ -242,24 +257,24 @@ function doInit (app, lang) {
     // Window menu.
     template[4].submenu = [
       {
-        label: 'Close',
+        label: lang.menu_close,
         accelerator: 'CmdOrCtrl+W',
         role: 'close'
       },
       {
-        label: 'Minimize',
+        label: lang.menu_minimize,
         accelerator: 'CmdOrCtrl+M',
         role: 'minimize'
       },
       {
-        label: 'Zoom',
+        label: lang.menu_zoom,
         role: 'zoom'
       },
       {
         type: 'separator'
       },
       {
-        label: 'Bring All to Front',
+        label: lang.menu_bringalltofront,// 'Bring All to Front',
         role: 'front'
       }
     ]
@@ -268,13 +283,13 @@ function doInit (app, lang) {
       type: 'separator'
     })
     template[0].submenu.unshift({
-      label: `About ${name}`,
+      label: `${lang.menu_about} ${name}`,
       role: 'about',
       click: () => {
         dialog.showMessageBox({
           type: 'info',
           buttons: [],
-          title: 'About',
+          title: lang.menu_about,
           message: `${name} v${version.slice(0, 3).join('.')} (${version[3]})`
         })
       }
@@ -284,7 +299,7 @@ function doInit (app, lang) {
       type: 'separator'
     })
     template[0].submenu.push({
-      label: 'Quit',
+      label: lang.menu_quit,
       role: 'quit',
       accelerator: 'CmdOrCtrl+Q'
     })
@@ -297,14 +312,14 @@ function doInit (app, lang) {
     // VIEW
     template[3].submenu = [
       {
-        label: 'Reload',
+        label: lang.menu_reload,
         accelerator: 'CmdOrCtrl+R',
         click (item, focusedWindow) {
           if (focusedWindow) focusedWindow.reload()
         }
       },
       {
-        label: 'Toggle Developer Tools',
+        label: lang.menu_toggle_developer_tools,// 'Toggle Developer Tools',
         accelerator: process.platform === 'darwin'
           ? 'Alt+Command+I'
           : 'Ctrl+Shift+I',

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1
app/static/bundle.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
app/static/common.js


+ 1 - 1
app/version.js

@@ -1 +1 @@
-exports.version = [3,3,5,5253];
+exports.version = [3,3,5,5255];

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است