From 11f64b714da79cf959cfbe8a6270ddc7fc87bb34 Mon Sep 17 00:00:00 2001
From: heyunjiang <598119677@qq.com>
Date: Tue, 8 Mar 2016 10:47:23 +0800
Subject: [PATCH 1/4] menuItem add
---
docs-translations/zh-CN/api/menu-item.md | 57 ++++++++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 docs-translations/zh-CN/api/menu-item.md
diff --git a/docs-translations/zh-CN/api/menu-item.md b/docs-translations/zh-CN/api/menu-item.md
new file mode 100644
index 000000000000..3d5eceedcb91
--- /dev/null
+++ b/docs-translations/zh-CN/api/menu-item.md
@@ -0,0 +1,57 @@
+# 菜单项
+菜单项模块允许你向应用或[menu][1]添加选项。
+
+查看[menu][1]例子。
+
+## 类:MenuItem
+使用下面的方法创建一个新的 `MenuItem`
+
+###new MenuItem(options)
+* `options` Object
+ * `click` Function - 当菜单项被点击的时候,使用 `click(menuItem,browserWindow)` 调用
+ * `role` String - 定义菜单项的行为,在指定 `click` 属性时将会被忽略
+ * `type` String - 取值 `normal`,`separator`,`checkbox`or`radio`
+ * `label` String
+ * `sublabel` String
+ * `accelerator` [Accelerator][2]
+ * `icon` [NativeImage][3]
+ * `enabled` Boolean
+ * `visible` Boolean
+ * `checked` Boolean
+ * `submenu` Menu - 应当作为 `submenu` 菜单项的特定类型,当它作为 `type: 'submenu'` 菜单项的特定类型时可以忽略。如果它的值不是 `Menu`,将自动转为 `Menu.buildFromTemplate`。
+ * `id` String - 标志一个菜单的唯一性。如果被定义使用,它将被用作这个菜单项的参考位置属性。
+ * `position` String - 定义给定的菜单的具体指定位置信息。
+
+在创建菜单项时,如果有匹配的方法,建议指定 `role` 属性,不需要人为操作它的行为,这样菜单使用可以给用户最好的体验。
+
+
+`role`属性值可以为:
+
+* `undo`
+* `redo`
+* `cut`
+* `copy`
+* `paste`
+* `selectall`
+* `minimize` - 最小化当前窗口
+* `close` - 关闭当前窗口
+
+在 OS X 上,`role` 还可以有以下值:
+
+* `about` - 匹配 `orderFrontStandardAboutPanel` 行为
+* `hide` - 匹配 `hide` 行为
+* `hideothers` - 匹配 `hideOtherApplications` 行为
+* `unhide` - 匹配 `unhideAllApplications` 行为
+* `front` - 匹配 `arrangeInFront` 行为
+* `window` - "Window" 菜单项
+* `help` - "Help" 菜单项
+* `services` - "Services" 菜单项
+
+
+
+
+
+
+ [1]:https://github.com/heyunjiang/electron/blob/master/docs-translations/zh-CN/api/menu.md
+ [2]:https://github.com/heyunjiang/electron/blob/master/docs/api/accelerator.md
+ [3]:https://github.com/heyunjiang/electron/blob/master/docs/api/native-image.md
\ No newline at end of file
From 89328c873c6ce6ee379e6cdf69ab064c88aa9373 Mon Sep 17 00:00:00 2001
From: heyunjiang <598119677@qq.com>
Date: Tue, 8 Mar 2016 16:30:09 +0800
Subject: [PATCH 2/4] add api doc begin 2.5
---
docs-translations/zh-CN/api/synopsis.md | 71 ++++++++
.../tutorial/chrome-command-line-switches.md | 158 ++++++++++++++++++
docs-translations/zh-CN/tutorial/process.md | 48 ++++++
3 files changed, 277 insertions(+)
create mode 100644 docs-translations/zh-CN/api/synopsis.md
create mode 100644 docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
create mode 100644 docs-translations/zh-CN/tutorial/process.md
diff --git a/docs-translations/zh-CN/api/synopsis.md b/docs-translations/zh-CN/api/synopsis.md
new file mode 100644
index 000000000000..a1a2a6d01222
--- /dev/null
+++ b/docs-translations/zh-CN/api/synopsis.md
@@ -0,0 +1,71 @@
+# 简介
+
+所有的[Node.js's built-in modules][1]在Electron中都可用,并且所有的node的第三方组件也可以放心使用(包括[自身的模块][2])。
+
+Electron也提供了一些额外的内置组件来开发传统桌面应用。一些组件只可以在主进程中使用,一些只可以在渲染进程中使用,但是也有部分可以在这2种进程中都可使用。
+
+基本规则:GUI模块或者系统底层的模块只可以在主进程中使用。要使用这些模块,你应当很熟悉[主进程vs渲染进程][3]脚本的概念。
+
+主进程脚本看起来像个普通的nodejs脚本
+
+```javascript
+const electron = require('electron');
+const app = electron.app;
+const BrowserWindow = electron.BrowserWindow;
+
+var window = null;
+
+app.on('ready', function() {
+ window = new BrowserWindow({width: 800, height: 600});
+ window.loadURL('https://github.com');
+});
+```
+
+渲染进程和传统的web界面一样,除了它具有使用node模块的能力:
+
+```html
+
+
+
+
+
+
+```
+
+如果想运行应用,参考 `Run your app` 。
+
+## 解构任务
+
+如果你使用的是CoffeeScript或Babel,你可以使用[destructuring assignment][4]来让使用内置模块更简单:
+
+```javascript
+const {app, BrowserWindow} = require('electron');
+```
+
+然而如果你使用的是普通的JavaScript,你就需要等到Chrome支持ES6了。
+
+##使用内置模块时禁用旧样式
+
+在版本v0.35.0之前,所有的内置模块都需要按造 `require('module-name')` 形式来使用,虽然它有很多[弊端][5],我们仍然在老的应用中友好的支持它。
+
+为了完整的禁用旧样式,你可以设置环境变量 `ELECTRON_HIDE_INTERNAL_MODULES ` :
+
+```javascript
+process.env.ELECTRON_HIDE_INTERNAL_MODULES = 'true'
+```
+
+或者调用 `hideInternalModules` API:
+
+```javascript
+require('electron').hideInternalModules()
+```
+
+
+ [1]:http://nodejs.org/api/
+ [2]:https://github.com/heyunjiang/electron/blob/master/docs/tutorial/using-native-node-modules.md
+ [3]:https://github.com/heyunjiang/electron/blob/master/docs/tutorial/quick-start.md#the-main-process
+ [4]:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
+ [5]:https://github.com/atom/electron/issues/387
\ No newline at end of file
diff --git a/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md b/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
new file mode 100644
index 000000000000..14e4a431bccd
--- /dev/null
+++ b/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
@@ -0,0 +1,158 @@
+# 支持的 Chrome 命令行开关
+
+这页列出了Chrome浏览器和Electron支持的命令行开关. 你也可以在[app][app]模块的[ready][ready]事件发出之前使用[app.commandLine.appendSwitch][append-switch] 来添加它们到你应用的main脚本里面:
+
+```javascript
+const app = require('electron').app;
+app.commandLine.appendSwitch('remote-debugging-port', '8315');
+app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
+
+app.on('ready', function() {
+ // Your code here
+});
+```
+
+## --client-certificate=`path`
+
+设置客户端的证书文件 `path` .
+
+## --ignore-connections-limit=`domains`
+
+忽略用 `,` 分隔的 `domains` 列表的连接限制.
+
+## --disable-http-cache
+
+禁用 HTTP 请求的 磁盘缓存.
+
+## --remote-debugging-port=`port`
+
+在指定的 `端口` 通过 HTTP 开启远程调试.
+
+## --js-flags=`flags`
+
+Specifies the flags passed to JS engine. It has to be passed when starting
+Electron if you want to enable the `flags` in the main process.
+
+```bash
+$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
+```
+
+## --proxy-server=`address:port`
+
+Use a specified proxy server, which overrides the system setting. This switch
+only affects requests with HTTP protocol, including HTTPS and WebSocket
+requests. It is also noteworthy that not all proxy servers support HTTPS and
+WebSocket requests.
+
+## --proxy-bypass-list=`hosts`
+
+Instructs Electron to bypass the proxy server for the given semi-colon-separated
+list of hosts. This flag has an effect only if used in tandem with
+`--proxy-server`.
+
+For example:
+
+```javascript
+app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com;1.2.3.4:5678')
+```
+
+Will use the proxy server for all hosts except for local addresses (`localhost`,
+`127.0.0.1` etc.), `google.com` subdomains, hosts that contain the suffix
+`foo.com` and anything at `1.2.3.4:5678`.
+
+## --proxy-pac-url=`url`
+
+Uses the PAC script at the specified `url`.
+
+## --no-proxy-server
+
+Don't use a proxy server and always make direct connections. Overrides any other
+proxy server flags that are passed.
+
+## --host-rules=`rules`
+
+A comma-separated list of `rules` that control how hostnames are mapped.
+
+For example:
+
+* `MAP * 127.0.0.1` Forces all hostnames to be mapped to 127.0.0.1
+* `MAP *.google.com proxy` Forces all google.com subdomains to be resolved to
+ "proxy".
+* `MAP test.com [::1]:77` Forces "test.com" to resolve to IPv6 loopback. Will
+ also force the port of the resulting socket address to be 77.
+* `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for
+ "www.google.com".
+
+These mappings apply to the endpoint host in a net request (the TCP connect
+and host resolver in a direct connection, and the `CONNECT` in an HTTP proxy
+connection, and the endpoint host in a `SOCKS` proxy connection).
+
+## --host-resolver-rules=`rules`
+
+Like `--host-rules` but these `rules` only apply to the host resolver.
+
+## --ignore-certificate-errors
+
+Ignores certificate related errors.
+
+## --ppapi-flash-path=`path`
+
+Sets the `path` of the pepper flash plugin.
+
+## --ppapi-flash-version=`version`
+
+Sets the `version` of the pepper flash plugin.
+
+## --log-net-log=`path`
+
+Enables net log events to be saved and writes them to `path`.
+
+## --ssl-version-fallback-min=`version`
+
+Sets the minimum SSL/TLS version ("tls1", "tls1.1" or "tls1.2") that TLS
+fallback will accept.
+
+## --cipher-suite-blacklist=`cipher_suites`
+
+Specifies comma-separated list of SSL cipher suites to disable.
+
+## --disable-renderer-backgrounding
+
+Prevents Chromium from lowering the priority of invisible pages' renderer
+processes.
+
+This flag is global to all renderer processes, if you only want to disable
+throttling in one window, you can take the hack of
+[playing silent audio][play-silent-audio].
+
+## --enable-logging
+
+Prints Chromium's logging into console.
+
+This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
+earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
+environment variable to achieve the same effect.
+
+## --v=`log_level`
+
+Gives the default maximal active V-logging level; 0 is the default. Normally
+positive values are used for V-logging levels.
+
+This switch only works when `--enable-logging` is also passed.
+
+## --vmodule=`pattern`
+
+Gives the per-module maximal V-logging levels to override the value given by
+`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in
+source files `my_module.*` and `foo*.*`.
+
+Any pattern containing a forward or backward slash will be tested against the
+whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the
+logging level for all code in the source files under a `foo/bar` directory.
+
+This switch only works when `--enable-logging` is also passed.
+
+[app]: app.md
+[append-switch]: app.md#appcommandlineappendswitchswitch-value
+[ready]: app.md#event-ready
+[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
\ No newline at end of file
diff --git a/docs-translations/zh-CN/tutorial/process.md b/docs-translations/zh-CN/tutorial/process.md
new file mode 100644
index 000000000000..d07741247aa5
--- /dev/null
+++ b/docs-translations/zh-CN/tutorial/process.md
@@ -0,0 +1,48 @@
+# 进程
+
+Electron 中的 `process` 对象 与 upstream node 中的有以下的不同点:
+
+* `process.type` String - 进程类型, 可以是 `browser` (i.e. main process)
+ 或 `renderer`.
+* `process.versions['electron']` String - Electron的版本.
+* `process.versions['chrome']` String - Chromium的版本.
+* `process.resourcesPath` String - JavaScript源代码路径.
+* `process.mas` Boolean - 在Mac App Store 创建, 它的值为 `true`, 在其它的地方值为 `undefined`.
+
+## 事件
+
+### 事件: 'loaded'
+
+在Electron已经加载了其内部预置脚本和它准备加载主进程或渲染进程的时候触发.
+
+当node被完全关闭的时候,它可以被预加载脚本使用来添加(原文: removed)与node无关的全局符号来回退到全局范围:
+
+```js
+// preload.js
+var _setImmediate = setImmediate;
+var _clearImmediate = clearImmediate;
+process.once('loaded', function() {
+ global.setImmediate = _setImmediate;
+ global.clearImmediate = _clearImmediate;
+});
+```
+
+## 属性
+
+### `process.noAsar`
+
+设置它为 `true` 可以使 `asar` 文件在node的内置模块中实效.
+
+## 方法
+
+`process` 对象有如下方法:
+
+### `process.hang()`
+
+使当前进程的主线成挂起.
+
+### `process.setFdLimit(maxDescriptors)` _OS X_ _Linux_
+
+* `maxDescriptors` Integer
+
+设置文件描述符软限制于 `maxDescriptors` 或硬限制与os, 无论它是否低于当前进程.
\ No newline at end of file
From d35996b4a0cfe5388f879f47110d80f235505690 Mon Sep 17 00:00:00 2001
From: heyunjiang <598119677@qq.com>
Date: Tue, 8 Mar 2016 19:57:53 +0800
Subject: [PATCH 3/4] position modify
---
.../zh-CN/api/chrome-command-line-switches.md | 144 ++++++++++++++++
.../zh-CN/{tutorial => api}/process.md | 0
.../tutorial/chrome-command-line-switches.md | 158 ------------------
3 files changed, 144 insertions(+), 158 deletions(-)
create mode 100644 docs-translations/zh-CN/api/chrome-command-line-switches.md
rename docs-translations/zh-CN/{tutorial => api}/process.md (100%)
delete mode 100644 docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
diff --git a/docs-translations/zh-CN/api/chrome-command-line-switches.md b/docs-translations/zh-CN/api/chrome-command-line-switches.md
new file mode 100644
index 000000000000..234f3c63b1ec
--- /dev/null
+++ b/docs-translations/zh-CN/api/chrome-command-line-switches.md
@@ -0,0 +1,144 @@
+# 支持的 Chrome 命令行开关
+
+这页列出了Chrome浏览器和Electron支持的命令行开关. 你也可以在[app][app]模块的[ready][ready]事件发出之前使用[app.commandLine.appendSwitch][append-switch] 来添加它们到你应用的main脚本里面:
+
+```javascript
+const app = require('electron').app;
+app.commandLine.appendSwitch('remote-debugging-port', '8315');
+app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
+
+app.on('ready', function() {
+ // Your code here
+});
+```
+
+## --client-certificate=`path`
+
+设置客户端的证书文件 `path` .
+
+## --ignore-connections-limit=`domains`
+
+忽略用 `,` 分隔的 `domains` 列表的连接限制.
+
+## --disable-http-cache
+
+禁用 HTTP 请求.
+
+## --remote-debugging-port=`port`
+
+在指定的 `端口` 通过 HTTP 开启远程调试.
+
+## --js-flags=`flags`
+
+指定引擎过渡到 JS 引擎.
+
+在启动Electron时,如果你想在主进程中激活 `flags` ,它将被转换.
+
+```bash
+$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
+```
+
+## --proxy-server=`address:port`
+
+使用一个特定的代理服务器,它将比系统设置的优先级更高.这个开关只有在使用 HTTP 协议时有效,它包含 HTTPS 和 WebSocket 请求. 值得注意的是,不是所有的代理服务器都支持 HTTPS 和 WebSocket 请求.
+
+## --proxy-bypass-list=`hosts`
+
+让 Electron 使用(原文:bypass) 提供的以 semi-colon 分隔的hosts列表的代理服务器.这个开关只有在使用 `--proxy-server` 时有效.
+
+例如:
+
+```javascript
+app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com;1.2.3.4:5678')
+```
+
+
+将会为所有的hosts使用代理服务器,除了本地地址 (`localhost`,
+`127.0.0.1` etc.), `google.com` 子域, 以 `foo.com` 结尾的hosts,和所有类似 `1.2.3.4:5678`的.
+
+## --proxy-pac-url=`url`
+
+在指定的 `url` 上使用 PAC 脚本.
+
+## --no-proxy-server
+
+不使用代理服务并且总是使用直接连接.忽略所有的合理代理标志.
+
+## --host-rules=`rules`
+
+一个逗号分隔的 `rule` 列表来控制主机名如何映射.
+
+例如:
+
+* `MAP * 127.0.0.1` 强制所有主机名映射到 127.0.0.1
+* `MAP *.google.com proxy` 强制所有 google.com 子域 使用 "proxy".
+* `MAP test.com [::1]:77` 强制 "test.com" 使用 IPv6 回环地址. 也强制使用端口 77.
+* `MAP * baz, EXCLUDE www.google.com` 重新全部映射到 "baz", 除了
+ "www.google.com".
+
+这些映射适用于终端网络请求
+(TCP 连接
+和 主机解析 以直接连接的方式, 和 `CONNECT` 以代理连接, 还有 终端 host 使用 `SOCKS` 代理连接).
+
+## --host-resolver-rules=`rules`
+
+类似 `--host-rules` ,但是 `rules` 只适合主机解析.
+
+## --ignore-certificate-errors
+
+忽略与证书相关的错误.
+
+## --ppapi-flash-path=`path`
+
+设置Pepper Flash插件的路径 `path` .
+
+## --ppapi-flash-version=`version`
+
+设置Pepper Flash插件版本号.
+
+## --log-net-log=`path`
+
+使网络日志事件能够被读写到 `path`.
+
+## --ssl-version-fallback-min=`version`
+
+设置最简化的 SSL/TLS 版本号 ("tls1", "tls1.1" or "tls1.2"),TLS 可接受回退.
+
+## --cipher-suite-blacklist=`cipher_suites`
+
+指定逗号分隔的 SSL 密码套件 列表实效.
+
+## --disable-renderer-backgrounding
+
+防止 Chromium 降低隐藏的渲染进程优先级.
+
+这个标志对所有渲染进程全局有效,如果你只想在一个窗口中禁止使用,你可以采用 hack 方法[playing silent audio][play-silent-audio].
+
+## --enable-logging
+
+打印 Chromium 信息输出到控制台.
+
+如果在用户应用加载完成之前解析`app.commandLine.appendSwitch` ,这个开关将实效,但是你可以设置 `ELECTRON_ENABLE_LOGGING` 环境变量来达到相同的效果.
+
+## --v=`log_level`
+
+设置默认最大活跃 V-logging 标准; 默认为 0.通常 V-logging 标准值为肯定值.
+
+This switch only works when `--enable-logging` is also passed.
+
+## --vmodule=`pattern`
+
+Gives the per-module maximal V-logging levels to override the value given by
+`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in
+source files `my_module.*` and `foo*.*`.
+
+Any pattern containing a forward or backward slash will be tested against the
+whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the
+logging level for all code in the source files under a `foo/bar` directory.
+
+This switch only works when `--enable-logging` is also passed.
+
+[app]: app.md
+[append-switch]: app.md#appcommandlineappendswitchswitch-value
+[ready]: app.md#event-ready
+[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
\ No newline at end of file
diff --git a/docs-translations/zh-CN/tutorial/process.md b/docs-translations/zh-CN/api/process.md
similarity index 100%
rename from docs-translations/zh-CN/tutorial/process.md
rename to docs-translations/zh-CN/api/process.md
diff --git a/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md b/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
deleted file mode 100644
index 14e4a431bccd..000000000000
--- a/docs-translations/zh-CN/tutorial/chrome-command-line-switches.md
+++ /dev/null
@@ -1,158 +0,0 @@
-# 支持的 Chrome 命令行开关
-
-这页列出了Chrome浏览器和Electron支持的命令行开关. 你也可以在[app][app]模块的[ready][ready]事件发出之前使用[app.commandLine.appendSwitch][append-switch] 来添加它们到你应用的main脚本里面:
-
-```javascript
-const app = require('electron').app;
-app.commandLine.appendSwitch('remote-debugging-port', '8315');
-app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
-
-app.on('ready', function() {
- // Your code here
-});
-```
-
-## --client-certificate=`path`
-
-设置客户端的证书文件 `path` .
-
-## --ignore-connections-limit=`domains`
-
-忽略用 `,` 分隔的 `domains` 列表的连接限制.
-
-## --disable-http-cache
-
-禁用 HTTP 请求的 磁盘缓存.
-
-## --remote-debugging-port=`port`
-
-在指定的 `端口` 通过 HTTP 开启远程调试.
-
-## --js-flags=`flags`
-
-Specifies the flags passed to JS engine. It has to be passed when starting
-Electron if you want to enable the `flags` in the main process.
-
-```bash
-$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
-```
-
-## --proxy-server=`address:port`
-
-Use a specified proxy server, which overrides the system setting. This switch
-only affects requests with HTTP protocol, including HTTPS and WebSocket
-requests. It is also noteworthy that not all proxy servers support HTTPS and
-WebSocket requests.
-
-## --proxy-bypass-list=`hosts`
-
-Instructs Electron to bypass the proxy server for the given semi-colon-separated
-list of hosts. This flag has an effect only if used in tandem with
-`--proxy-server`.
-
-For example:
-
-```javascript
-app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com;1.2.3.4:5678')
-```
-
-Will use the proxy server for all hosts except for local addresses (`localhost`,
-`127.0.0.1` etc.), `google.com` subdomains, hosts that contain the suffix
-`foo.com` and anything at `1.2.3.4:5678`.
-
-## --proxy-pac-url=`url`
-
-Uses the PAC script at the specified `url`.
-
-## --no-proxy-server
-
-Don't use a proxy server and always make direct connections. Overrides any other
-proxy server flags that are passed.
-
-## --host-rules=`rules`
-
-A comma-separated list of `rules` that control how hostnames are mapped.
-
-For example:
-
-* `MAP * 127.0.0.1` Forces all hostnames to be mapped to 127.0.0.1
-* `MAP *.google.com proxy` Forces all google.com subdomains to be resolved to
- "proxy".
-* `MAP test.com [::1]:77` Forces "test.com" to resolve to IPv6 loopback. Will
- also force the port of the resulting socket address to be 77.
-* `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for
- "www.google.com".
-
-These mappings apply to the endpoint host in a net request (the TCP connect
-and host resolver in a direct connection, and the `CONNECT` in an HTTP proxy
-connection, and the endpoint host in a `SOCKS` proxy connection).
-
-## --host-resolver-rules=`rules`
-
-Like `--host-rules` but these `rules` only apply to the host resolver.
-
-## --ignore-certificate-errors
-
-Ignores certificate related errors.
-
-## --ppapi-flash-path=`path`
-
-Sets the `path` of the pepper flash plugin.
-
-## --ppapi-flash-version=`version`
-
-Sets the `version` of the pepper flash plugin.
-
-## --log-net-log=`path`
-
-Enables net log events to be saved and writes them to `path`.
-
-## --ssl-version-fallback-min=`version`
-
-Sets the minimum SSL/TLS version ("tls1", "tls1.1" or "tls1.2") that TLS
-fallback will accept.
-
-## --cipher-suite-blacklist=`cipher_suites`
-
-Specifies comma-separated list of SSL cipher suites to disable.
-
-## --disable-renderer-backgrounding
-
-Prevents Chromium from lowering the priority of invisible pages' renderer
-processes.
-
-This flag is global to all renderer processes, if you only want to disable
-throttling in one window, you can take the hack of
-[playing silent audio][play-silent-audio].
-
-## --enable-logging
-
-Prints Chromium's logging into console.
-
-This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
-earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
-environment variable to achieve the same effect.
-
-## --v=`log_level`
-
-Gives the default maximal active V-logging level; 0 is the default. Normally
-positive values are used for V-logging levels.
-
-This switch only works when `--enable-logging` is also passed.
-
-## --vmodule=`pattern`
-
-Gives the per-module maximal V-logging levels to override the value given by
-`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in
-source files `my_module.*` and `foo*.*`.
-
-Any pattern containing a forward or backward slash will be tested against the
-whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the
-logging level for all code in the source files under a `foo/bar` directory.
-
-This switch only works when `--enable-logging` is also passed.
-
-[app]: app.md
-[append-switch]: app.md#appcommandlineappendswitchswitch-value
-[ready]: app.md#event-ready
-[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
\ No newline at end of file
From c8a2246952eb25eac7aaad43af862cc3303bb9d9 Mon Sep 17 00:00:00 2001
From: heyunjiang <598119677@qq.com>
Date: Tue, 8 Mar 2016 20:40:54 +0800
Subject: [PATCH 4/4] complete command line switch && add enviroment variables
---
.../zh-CN/api/chrome-command-line-switches.md | 12 ++---
.../zh-CN/api/environment-variables.md | 53 +++++++++++++++++++
2 files changed, 57 insertions(+), 8 deletions(-)
create mode 100644 docs-translations/zh-CN/api/environment-variables.md
diff --git a/docs-translations/zh-CN/api/chrome-command-line-switches.md b/docs-translations/zh-CN/api/chrome-command-line-switches.md
index 234f3c63b1ec..e197626302bf 100644
--- a/docs-translations/zh-CN/api/chrome-command-line-switches.md
+++ b/docs-translations/zh-CN/api/chrome-command-line-switches.md
@@ -124,19 +124,15 @@ app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com
设置默认最大活跃 V-logging 标准; 默认为 0.通常 V-logging 标准值为肯定值.
-This switch only works when `--enable-logging` is also passed.
+这个开关只有在 `--enable-logging` 开启时有效.
## --vmodule=`pattern`
-Gives the per-module maximal V-logging levels to override the value given by
-`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in
-source files `my_module.*` and `foo*.*`.
+赋予每个模块最大的 V-logging levels 来覆盖 `--v` 给的值.E.g. `my_module=2,foo*=3` 会改变所有源文件 `my_module.*` and `foo*.*` 的代码中的 logging level .
-Any pattern containing a forward or backward slash will be tested against the
-whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the
-logging level for all code in the source files under a `foo/bar` directory.
+任何包含向前的(forward slash)或者向后的(backward slash)模式将被测试用于阻止整个路径名,并且不仅是E.g模块.`*/foo/bar/*=2` 将会改变所有在 `foo/bar` 下的源文件代码中的 logging level .
-This switch only works when `--enable-logging` is also passed.
+这个开关只有在 `--enable-logging` 开启时有效.
[app]: app.md
[append-switch]: app.md#appcommandlineappendswitchswitch-value
diff --git a/docs-translations/zh-CN/api/environment-variables.md b/docs-translations/zh-CN/api/environment-variables.md
new file mode 100644
index 000000000000..0a35eb59dfdb
--- /dev/null
+++ b/docs-translations/zh-CN/api/environment-variables.md
@@ -0,0 +1,53 @@
+# 环境变量
+
+一些 Electron 的行为受到环境变量的控制,因为他们的初始化比命令行和应用代码更早.
+
+POSIX shells 的例子:
+
+```bash
+$ export ELECTRON_ENABLE_LOGGING=true
+$ electron
+```
+
+Windows 控制台:
+
+```powershell
+> set ELECTRON_ENABLE_LOGGING=true
+> electron
+```
+
+## `ELECTRON_RUN_AS_NODE`
+
+类似node.js普通进程启动方式.
+
+## `ELECTRON_ENABLE_LOGGING`
+
+打印 Chrome 的内部日志到控制台.
+
+## `ELECTRON_LOG_ASAR_READS`
+
+当 Electron 读取 ASA 文档,把 read offset 和文档路径做日志记录到系统 `tmpdir`.结果文件将提供给 ASAR 模块来优化文档组织.
+
+## `ELECTRON_ENABLE_STACK_DUMPING`
+
+当 Electron 崩溃的时候,打印堆栈记录到控制台.
+
+如果 `crashReporter` 已经启动那么这个环境变量实效.
+
+## `ELECTRON_DEFAULT_ERROR_MODE` _Windows_
+
+当 Electron 崩溃的时候,显示windows的崩溃对话框.
+
+如果 `crashReporter` 已经启动那么这个环境变量实效.
+
+## `ELECTRON_NO_ATTACH_CONSOLE` _Windows_
+
+不可使用当前控制台.
+
+## `ELECTRON_FORCE_WINDOW_MENU_BAR` _Linux_
+
+不可再 Linux 上使用全局菜单栏.
+
+## `ELECTRON_HIDE_INTERNAL_MODULES`
+
+关闭旧的内置模块如 `require('ipc')` 的通用模块.
\ No newline at end of file