diff --git a/docs-translations/es/api/process.md b/docs-translations/es/api/process.md
index 77ba017f339c..cc8b4ab2b825 100644
--- a/docs-translations/es/api/process.md
+++ b/docs-translations/es/api/process.md
@@ -19,7 +19,7 @@ está comenzando a cargar la página web o el script principal.
Puede ser usado por el script precargado para añadir de nuevo los símbolos globales
de Node eliminados, al alcance global cuando la integración de Node está apagada:
-```js
+```javascript
// preload.js
var _setImmediate = setImmediate
var _clearImmediate = clearImmediate
diff --git a/docs-translations/es/tutorial/desktop-environment-integration.md b/docs-translations/es/tutorial/desktop-environment-integration.md
index 0dce492ff2de..a0d7a08eb019 100644
--- a/docs-translations/es/tutorial/desktop-environment-integration.md
+++ b/docs-translations/es/tutorial/desktop-environment-integration.md
@@ -63,12 +63,14 @@ Para establecer tu menú dock, puedes utilizar la API `app.dock.setMenu`, la cua
var app = require('app')
var Menu = require('menu')
var dockMenu = Menu.buildFromTemplate([
- { label: 'New Window', click: function () { console.log('New Window') } },
- { label: 'New Window with Settings', submenu: [
- { label: 'Basic' },
- { label: 'Pro'}
- ]},
- { label: 'New Command...'}
+ {label: 'New Window', click: function () { console.log('New Window') }},
+ {label: 'New Window with Settings',
+ submenu: [
+ {label: 'Basic'},
+ {label: 'Pro'}
+ ]
+ },
+ {label: 'New Command...'}
])
app.dock.setMenu(dockMenu)
```
@@ -157,8 +159,8 @@ Para establecer la barra de progreso de una ventana, puedes utilizar
[BrowserWindow.setProgressBar][setprogressbar] API:
```javascript
-var window = new BrowserWindow({...});
-window.setProgressBar(0.5);
+var window = new BrowserWindow()
+window.setProgressBar(0.5)
```
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath
diff --git a/docs-translations/es/tutorial/online-offline-events.md b/docs-translations/es/tutorial/online-offline-events.md
index 27768e7c2a0f..171decbe0483 100644
--- a/docs-translations/es/tutorial/online-offline-events.md
+++ b/docs-translations/es/tutorial/online-offline-events.md
@@ -12,7 +12,7 @@ var onlineStatusWindow
app.on('ready', function () {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
- onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html')
+ onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)
})
```
@@ -50,7 +50,7 @@ var onlineStatusWindow
app.on('ready', function () {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
- onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html')
+ onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)
})
ipc.on('online-status-changed', function (event, status) {
diff --git a/docs-translations/es/tutorial/quick-start.md b/docs-translations/es/tutorial/quick-start.md
index edfd1a9b52c2..112b4157f0d4 100644
--- a/docs-translations/es/tutorial/quick-start.md
+++ b/docs-translations/es/tutorial/quick-start.md
@@ -54,7 +54,7 @@ El formato de `package.json` es exactamente el mismo que cualquier módulo Node,
y el script especificado en el campo `main` será el script de arranque de tu aplicación,
a ser ejecutado por el proceso principal. Un ejemplo de `package.json` podría verse así:
-```json
+```javascripton
{
"name" : "your-app",
"version" : "0.1.0",
@@ -77,7 +77,7 @@ app.on('window-all-closed', function () {
// En macOS es común que las aplicaciones y su barra de menú
// se mantengan activas hasta que el usuario cierre la aplicación
// explícitamente utilizando Cmd + Q
- if (process.platform != 'darwin') {
+ if (process.platform !== 'darwin') {
app.quit()
}
})
@@ -89,7 +89,7 @@ app.on('ready', function () {
mainWindow = new BrowserWindow({width: 800, height: 600})
// cargar el index.html de nuestra aplicación.
- mainWindow.loadURL('file://' + __dirname + '/index.html')
+ mainWindow.loadURL(`file://${__dirname}/index.html`)
// Desplegar devtools.
mainWindow.openDevTools()
diff --git a/docs-translations/es/tutorial/using-pepper-flash-plugin.md b/docs-translations/es/tutorial/using-pepper-flash-plugin.md
index c4786edafbe6..10210550bac0 100644
--- a/docs-translations/es/tutorial/using-pepper-flash-plugin.md
+++ b/docs-translations/es/tutorial/using-pepper-flash-plugin.md
@@ -21,7 +21,7 @@ var mainWindow = null
// Quit when all windows are closed.
app.on('window-all-closed', function () {
- if (process.platform != 'darwin') {
+ if (process.platform !== 'darwin') {
app.quit()
}
})
@@ -43,7 +43,7 @@ app.on('ready', function () {
'plugins': true
}
})
- mainWindow.loadURL('file://' + __dirname + '/index.html')
+ mainWindow.loadURL(`file://${__dirname}/index.html`)
// Something else
})
```
diff --git a/docs-translations/jp/api/app.md b/docs-translations/jp/api/app.md
index 9545722515ec..7d68731fda59 100644
--- a/docs-translations/jp/api/app.md
+++ b/docs-translations/jp/api/app.md
@@ -135,7 +135,7 @@ Windowsでは、ファイルパスを取得するために、 `process.argv` を
```javascript
session.on('certificate-error', function (event, webContents, url, error, certificate, callback) {
- if (url == 'https://github.com') {
+ if (url === 'https://github.com') {
// Verification logic.
event.preventDefault()
callback(true)
@@ -325,26 +325,25 @@ macOSは、ユーザーがFinderで2つ目のアプリインスタンスを開
2つ目のインスタンスを起動するとき、メインのインスタンスのウィンドウをアクティブにする例
-```js
-var myWindow = null;
+```javascript
+var myWindow = null
-var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
+var shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window
if (myWindow) {
- if (myWindow.isMinimized()) myWindow.restore();
- myWindow.focus();
+ if (myWindow.isMinimized()) myWindow.restore()
+ myWindow.focus()
}
- return true;
-});
+ return true
+})
if (shouldQuit) {
- app.quit();
- return;
+ app.quit()
}
-// Create myWindow, load the rest of the app, etc...
-app.on('ready', function() {
-});
+app.on('ready', function () {
+ // Create myWindow, load the rest of the app, etc...
+})
```
### `app.setAppUserModelId(id)` _Windows_
@@ -359,7 +358,7 @@ app.on('ready', function() {
使用例:
-```js
+```javascript
let browserOptions = {width: 1000, height: 800}
// Make the window transparent only if the platform supports it.
@@ -373,10 +372,10 @@ win = new BrowserWindow(browserOptions)
// Navigate.
if (browserOptions.transparent) {
- win.loadURL('file://' + __dirname + '/index.html')
+ win.loadURL(`file://${__dirname}/index.html`)
} else {
// No transparency, so we load a fallback that uses basic styles.
- win.loadURL('file://' + __dirname + '/fallback.html')
+ win.loadURL(`file://${__dirname}/fallback.html`)
}
```
diff --git a/docs-translations/jp/api/desktop-capturer.md b/docs-translations/jp/api/desktop-capturer.md
index fee098fbfb17..4957857dd4f4 100644
--- a/docs-translations/jp/api/desktop-capturer.md
+++ b/docs-translations/jp/api/desktop-capturer.md
@@ -9,7 +9,7 @@ var desktopCapturer = require('electron').desktopCapturer
desktopCapturer.getSources({types: ['window', 'screen']}, function (error, sources) {
if (error) throw error
for (var i = 0; i < sources.length; ++i) {
- if (sources[i].name == 'Electron') {
+ if (sources[i].name === 'Electron') {
navigator.webkitGetUserMedia({
audio: false,
video: {
diff --git a/docs-translations/jp/api/dialog.md b/docs-translations/jp/api/dialog.md
index 48a17225bb58..cb9721b920ce 100644
--- a/docs-translations/jp/api/dialog.md
+++ b/docs-translations/jp/api/dialog.md
@@ -5,9 +5,8 @@
複数のファイルやディレクトリを選択するためのダイアログを表示する例です:
```javascript
-var win = ...; // BrowserWindow in which to show the dialog
-const dialog = require('electron').dialog;
-console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]}));
+const {dialog} = require('electron')
+console.log(dialog.showOpenDialog({properties: ['openFile', 'openDirectory', 'multiSelections']}))
```
**Note for macOS**: シートとしてダイアログを表示したい場合、唯一しなければならないことは、`browserWindow`パラメーターを参照する`BrowserWindow`を提供することです。
diff --git a/docs-translations/jp/api/download-item.md b/docs-translations/jp/api/download-item.md
index 1be61b2f98a5..f646faa4d713 100644
--- a/docs-translations/jp/api/download-item.md
+++ b/docs-translations/jp/api/download-item.md
@@ -4,22 +4,31 @@
```javascript
// In the main process.
-win.webContents.session.on('will-download', function(event, item, webContents) {
+const {BrowserWindow} = require('electron')
+let win = new BrowserWindow()
+win.webContents.session.on('will-download', (event, item, webContents) => {
// Set the save path, making Electron not to prompt a save dialog.
- item.setSavePath('/tmp/save.pdf');
- console.log(item.getMimeType());
- console.log(item.getFilename());
- console.log(item.getTotalBytes());
- item.on('updated', function() {
- console.log('Received bytes: ' + item.getReceivedBytes());
- });
- item.on('done', function(e, state) {
- if (state == "completed") {
- console.log("Download successfully");
- } else {
- console.log("Download is cancelled or interrupted that can't be resumed");
+ item.setSavePath('/tmp/save.pdf')
+
+ item.on('updated', (event, state) => {
+ if (state === 'interrupted') {
+ console.log('Download is interrupted but can be resumed')
+ } else if (state === 'progressing') {
+ if (item.isPaused()) {
+ console.log('Download is paused')
+ } else {
+ console.log(`Received bytes: ${item.getReceivedBytes()}`)
+ }
}
- });
+ })
+ item.once('done', (event, state) => {
+ if (state === 'completed') {
+ console.log('Download successfully')
+ } else {
+ console.log(`Download failed: ${state}`)
+ }
+ })
+})
```
## イベント
diff --git a/docs-translations/jp/api/menu.md b/docs-translations/jp/api/menu.md
index edec8a130dd7..22dd019ed1b2 100644
--- a/docs-translations/jp/api/menu.md
+++ b/docs-translations/jp/api/menu.md
@@ -74,34 +74,35 @@ var template = [
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: function (item, focusedWindow) {
- if (focusedWindow)
- focusedWindow.reload()
+ if (focusedWindow) focusedWindow.reload()
}
},
{
label: 'Toggle Full Screen',
accelerator: (function () {
- if (process.platform == 'darwin')
+ if (process.platform === 'darwin') {
return 'Ctrl+Command+F'
- else
+ } else {
return 'F11'
+ }
})(),
click: function (item, focusedWindow) {
- if (focusedWindow)
+ if (focusedWindow) {
focusedWindow.setFullScreen(!focusedWindow.isFullScreen())
+ }
}
},
{
label: 'Toggle Developer Tools',
accelerator: (function () {
- if (process.platform == 'darwin')
+ if (process.platform === 'darwin') {
return 'Alt+Command+I'
- else
+ } else {
return 'Ctrl+Shift+I'
+ }
})(),
click: function (item, focusedWindow) {
- if (focusedWindow)
- focusedWindow.toggleDevTools()
+ if (focusedWindow) focusedWindow.toggleDevTools()
}
}
]
@@ -134,7 +135,7 @@ var template = [
}
]
-if (process.platform == 'darwin') {
+if (process.platform === 'darwin') {
var name = require('electron').remote.app.getName()
template.unshift({
label: name,
diff --git a/docs-translations/jp/api/process.md b/docs-translations/jp/api/process.md
index d37d1510e0f0..dc4924b4b827 100644
--- a/docs-translations/jp/api/process.md
+++ b/docs-translations/jp/api/process.md
@@ -12,7 +12,7 @@ Electronの`process`オブジェクトは次のようなAPIで拡張されてい
Node統合がオフになっているとき、削除したNodeグローバルシンボルをグローバルスコープへ戻すために、プリロードスクリプトで使用できます。
-```js
+```javascript
// preload.js
var _setImmediate = setImmediate
var _clearImmediate = clearImmediate
diff --git a/docs-translations/jp/api/protocol.md b/docs-translations/jp/api/protocol.md
index f0044d6923bc..ceef3179666c 100644
--- a/docs-translations/jp/api/protocol.md
+++ b/docs-translations/jp/api/protocol.md
@@ -5,18 +5,16 @@
`file://`プロトコルの同様の効果をもつプロトコルを実装した例です。
```javascript
-const electron = require('electron')
-const app = electron.app
+const {app} = require('electron')
const path = require('path')
app.on('ready', function () {
var protocol = electron.protocol
protocol.registerFileProtocol('atom', function (request, callback) {
var url = request.url.substr(7)
- callback({path: path.normalize(__dirname + '/' + url)})
+ callback({path: path.join(__dirname, url)})
}, function (error) {
- if (error)
- console.error('Failed to register protocol')
+ if (error) console.error('Failed to register protocol')
})
})
```
@@ -80,8 +78,7 @@ app.on('ready', function () {
protocol.registerBufferProtocol('atom', function (request, callback) {
callback({mimeType: 'text/html', data: new Buffer('
Response
')})
}, function (error) {
- if (error)
- console.error('Failed to register protocol')
+ if (error) console.error('Failed to register protocol')
})
```
diff --git a/docs-translations/jp/api/screen.md b/docs-translations/jp/api/screen.md
index 02b5f014a0c3..9f5a197a701f 100644
--- a/docs-translations/jp/api/screen.md
+++ b/docs-translations/jp/api/screen.md
@@ -35,7 +35,7 @@ app.on('ready', function () {
var displays = electronScreen.getAllDisplays()
var externalDisplay = null
for (var i in displays) {
- if (displays[i].bounds.x != 0 || displays[i].bounds.y != 0) {
+ if (displays[i].bounds.x !== 0 || displays[i].bounds.y !== 0) {
externalDisplay = displays[i]
break
}
diff --git a/docs-translations/jp/api/session.md b/docs-translations/jp/api/session.md
index 4f8140845735..9a68f23974b8 100644
--- a/docs-translations/jp/api/session.md
+++ b/docs-translations/jp/api/session.md
@@ -77,11 +77,13 @@ session.defaultSession.on('will-download', function (event, item, webContents) {
```javascript
// Query all cookies.
session.defaultSession.cookies.get({}, function (error, cookies) {
+ if (error) console.error(error)
console.log(cookies)
})
// Query all cookies associated with a specific url.
session.defaultSession.cookies.get({ url: 'http://www.github.com' }, function (error, cookies) {
+ if (error) console.error(error)
console.log(cookies)
})
@@ -89,8 +91,7 @@ session.defaultSession.cookies.get({ url: 'http://www.github.com' }, function (e
// may overwrite equivalent cookies if they exist.
var cookie = { url: 'http://www.github.com', name: 'dummy_name', value: 'dummy' }
session.defaultSession.cookies.set(cookie, function (error) {
- if (error)
- console.error(error)
+ if (error) console.error(error)
})
```
@@ -255,10 +256,7 @@ Calling `setCertificateVerifyProc(null)`をコールして、既定の証明書
```javascript
myWindow.webContents.session.setCertificateVerifyProc(function (hostname, cert, callback) {
- if (hostname == 'github.com')
- callback(true)
- else
- callback(false)
+ callback(hostname === 'github.com')
})
```
diff --git a/docs-translations/jp/api/web-view-tag.md b/docs-translations/jp/api/web-view-tag.md
index 707f1f7e3ae5..ece0c3052c7e 100644
--- a/docs-translations/jp/api/web-view-tag.md
+++ b/docs-translations/jp/api/web-view-tag.md
@@ -193,7 +193,7 @@ webview.addEventListener('dom-ready', () => {
* `url` URL
* `options` Object (optional)
- * `httpReferrer` String - リファラURL
+ * `httpReferrer` String - リファラURL
* `userAgent` String - リクエストに使用されるUser agent
* `extraHeaders` String - 追加のヘッダを"\n"で区切って指定します。
@@ -577,8 +577,7 @@ webview.addEventListener('console-message', (e) => {
```javascript
webview.addEventListener('found-in-page', (e) => {
- if (e.result.finalUpdate)
- webview.stopFindInPage('keepSelection')
+ if (e.result.finalUpdate) webview.stopFindInPage('keepSelection')
})
const requestId = webview.findInPage('test')
diff --git a/docs-translations/jp/tutorial/desktop-environment-integration.md b/docs-translations/jp/tutorial/desktop-environment-integration.md
index e8a66ee992ca..5ade1b40c07c 100644
--- a/docs-translations/jp/tutorial/desktop-environment-integration.md
+++ b/docs-translations/jp/tutorial/desktop-environment-integration.md
@@ -87,21 +87,21 @@ __Dock menu of Terminal.app:__
カスタムドックメニューを設定するために、macOSのみに提供されている `app.dock.setMenu` APIを使用できます。
```javascript
-const electron = require('electron')
-const app = electron.app
-const Menu = electron.Menu
+const {app, Menu} = require('electron')
const dockMenu = Menu.buildFromTemplate([
- { label: 'New Window', click () { console.log('New Window') } },
- { label: 'New Window with Settings', submenu: [
- { label: 'Basic' },
- { label: 'Pro'}
+ {label: 'New Window', click () { console.log('New Window') }},
+ {label: 'New Window with Settings',
+ submenu: [
+ {label: 'Basic'},
+ {label: 'Pro'}
]},
- { label: 'New Command...'}
+ {label: 'New Command...'}
])
app.dock.setMenu(dockMenu)
```
+
## ユーザータスク (Windows)
Windowsでは、ジャンプリストの `Tasks` カテゴリでカスタムアクションを指定できます。
@@ -206,8 +206,8 @@ __タスクバーボタン上の進行状況バー:__
ウィンドウに進行状況バーを設定するために、[BrowserWindow.setProgressBar][setprogressbar] APIを使えます:
```javascript
-let win = new BrowserWindow({...});
-win.setProgressBar(0.5);
+let win = new BrowserWindow()
+win.setProgressBar(0.5)
```
## タスクバーでアイコンをオーバーレイする (Windows)
@@ -223,8 +223,8 @@ __タスクバーボタンでのオーバーレイ:__
ウィンドウでオーバーレイアイコンを設定するために、[BrowserWindow.setOverlayIcon][setoverlayicon] APIを使用できます。
```javascript
-let win = new BrowserWindow({...});
-win.setOverlayIcon('path/to/overlay.png', 'Description for overlay');
+let win = new BrowserWindow()
+win.setOverlayIcon('path/to/overlay.png', 'Description for overlay')
```
## Windowのファイル表示 (macOS)
@@ -240,9 +240,9 @@ __Represented file ポップアップメニュー:__
ウィンドウにrepresented fileを設定するために、[BrowserWindow.setRepresentedFilename][setrepresentedfilename] と [BrowserWindow.setDocumentEdited][setdocumentedited] APIsを使えます:
```javascript
-let win = new BrowserWindow({...});
-win.setRepresentedFilename('/etc/passwd');
-win.setDocumentEdited(true);
+let win = new BrowserWindow()
+win.setRepresentedFilename('/etc/passwd')
+win.setDocumentEdited(true)
```
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-os-x-windows
diff --git a/docs-translations/jp/tutorial/quick-start.md b/docs-translations/jp/tutorial/quick-start.md
index 41a810545b61..2d88bef4ef8b 100644
--- a/docs-translations/jp/tutorial/quick-start.md
+++ b/docs-translations/jp/tutorial/quick-start.md
@@ -39,7 +39,7 @@ your-app/
`package.json` の形式は Node モジュールとまったく同じです。 `main` フィールドで指定するスクリプトはアプリの起動スクリプトであり、メインプロセスを実行します。 `package.json` の例は次のようになります:
-```json
+```javascripton
{
"name" : "your-app",
"version" : "0.1.0",
@@ -74,8 +74,8 @@ function createWindow () {
// ウィンドウが閉じられた時に発行される
win.on('closed', () => {
- // ウィンドウオブジェクトを参照から外す。
- // もし何個かウィンドウがあるならば、配列として持っておいて、対応するウィンドウのオブジェクトを消去するべき。
+ // ウィンドウオブジェクトを参照から外す。
+ // もし何個かウィンドウがあるならば、配列として持っておいて、対応するウィンドウのオブジェクトを消去するべき。
win = null
})
}
diff --git a/docs-translations/jp/tutorial/using-pepper-flash-plugin.md b/docs-translations/jp/tutorial/using-pepper-flash-plugin.md
index 228c119f18e7..b6adad4089c3 100644
--- a/docs-translations/jp/tutorial/using-pepper-flash-plugin.md
+++ b/docs-translations/jp/tutorial/using-pepper-flash-plugin.md
@@ -31,7 +31,7 @@ app.on('ready', function () {
'plugins': true
}
})
- mainWindow.loadURL('file://' + __dirname + '/index.html')
+ mainWindow.loadURL(`file://${__dirname}/index.html`)
// Something else
})
```
diff --git a/docs-translations/jp/tutorial/using-selenium-and-webdriver.md b/docs-translations/jp/tutorial/using-selenium-and-webdriver.md
index 4afc199a2d71..e348a0596dd6 100644
--- a/docs-translations/jp/tutorial/using-selenium-and-webdriver.md
+++ b/docs-translations/jp/tutorial/using-selenium-and-webdriver.md
@@ -15,7 +15,7 @@ Electronで `chromedriver` を使用するために、Electronがどこにある
$ npm install --save-dev spectron
```
-```js
+```javascript
// 可視のウィンドウがタイトル付きで開かれているかを調べる簡単なテスト
var Application = require('spectron').Application
var assert = require('assert')
diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md
index 2741c8685583..fd210a35f8a1 100644
--- a/docs-translations/ko-KR/api/app.md
+++ b/docs-translations/ko-KR/api/app.md
@@ -645,15 +645,21 @@ app.setJumpList([
name: 'Tools',
items: [
{
- type: 'task', title: 'Tool A',
- program: process.execPath, args: '--run-tool-a',
- icon: process.execPath, iconIndex: 0,
+ type: 'task',
+ title: 'Tool A',
+ program: process.execPath,
+ args: '--run-tool-a',
+ icon: process.execPath,
+ iconIndex: 0,
description: 'Runs Tool A'
},
{
- type: 'task', title: 'Tool B',
- program: process.execPath, args: '--run-tool-b',
- icon: process.execPath, iconIndex: 0,
+ type: 'task',
+ title: 'Tool B',
+ program: process.execPath,
+ args: '--run-tool-b',
+ icon: process.execPath,
+ iconIndex: 0,
description: 'Runs Tool B'
}
]
@@ -662,14 +668,18 @@ app.setJumpList([
{ // has no name and no type so `type` is assumed to be "tasks"
items: [
{
- type: 'task', title: 'New Project',
- program: process.execPath, args: '--new-project',
+ type: 'task',
+ title: 'New Project',
+ program: process.execPath,
+ args: '--new-project',
description: 'Create a new project.'
},
{ type: 'separator' },
{
- type: 'task', title: 'Recover Project',
- program: process.execPath, args: '--recover-project',
+ type: 'task',
+ title: 'Recover Project',
+ program: process.execPath,
+ args: '--recover-project',
description: 'Recover Project'
}
]
diff --git a/docs-translations/ko-KR/api/clipboard.md b/docs-translations/ko-KR/api/clipboard.md
index 46baa71a533a..0c4fbc6bb5ae 100644
--- a/docs-translations/ko-KR/api/clipboard.md
+++ b/docs-translations/ko-KR/api/clipboard.md
@@ -97,7 +97,7 @@ Returns `Object`:
**참고:** 윈도우의 대부분의 앱은 북마크 붙여넣기를 지원하지 않습니다.
`clipboard.write` 를 통해 북마크와 대체 텍스트를 클립보드에 쓸 수 있습니다.
-```js
+```javascript
clipboard.write({
text: 'http://electron.atom.io',
bookmark: 'Electron Homepage'
diff --git a/docs-translations/ko-KR/api/system-preferences.md b/docs-translations/ko-KR/api/system-preferences.md
index e7f7120f97c6..e32c9843ddf7 100644
--- a/docs-translations/ko-KR/api/system-preferences.md
+++ b/docs-translations/ko-KR/api/system-preferences.md
@@ -147,7 +147,7 @@ if (browserOptions.transparent) {
사용자의 현재 시스템 전체 색상 환경설정을 RGBA 16진 문자열 형태로 반환합니다.
-```js
+```javascript
const color = systemPreferences.getAccentColor() // `"aabbccdd"`
const red = color.substr(0, 2) // "aa"
const green = color.substr(2, 2) // "bb"
diff --git a/docs-translations/ko-KR/tutorial/debugging-main-process-node-inspector.md b/docs-translations/ko-KR/tutorial/debugging-main-process-node-inspector.md
index 5e7fc4689ba4..b4d4ce13f9bf 100644
--- a/docs-translations/ko-KR/tutorial/debugging-main-process-node-inspector.md
+++ b/docs-translations/ko-KR/tutorial/debugging-main-process-node-inspector.md
@@ -9,7 +9,7 @@ $ code electron-quick-start
### 2. 다음 설정으로 `.vscode/launch.json` 파일 추가하기:
-```json
+```javascripton
{
"version": "0.2.0",
"configurations": [
diff --git a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md
index dae61a39aaa7..71cbe0616950 100644
--- a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md
+++ b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md
@@ -116,7 +116,8 @@ const {app, Menu} = require('electron')
const dockMenu = Menu.buildFromTemplate([
{label: 'New Window', click () { console.log('New Window') }},
- {label: 'New Window with Settings', submenu: [
+ {label: 'New Window with Settings',
+ submenu: [
{label: 'Basic'},
{label: 'Pro'}
]},
diff --git a/docs-translations/ko-KR/tutorial/quick-start.md b/docs-translations/ko-KR/tutorial/quick-start.md
index 8943ba717339..ce8560d770f7 100644
--- a/docs-translations/ko-KR/tutorial/quick-start.md
+++ b/docs-translations/ko-KR/tutorial/quick-start.md
@@ -61,7 +61,7 @@ your-app/
파일을 지정하면 메인 프로세스의 엔트리 포인트로 사용합니다. 예를 들어 사용할 수 있는
`package.json`은 다음과 같습니다:
-```json
+```javascripton
{
"name" : "your-app",
"version" : "0.1.0",
diff --git a/docs-translations/pt-BR/api/app.md b/docs-translations/pt-BR/api/app.md
index 37fe071535a4..fb77629a7057 100644
--- a/docs-translations/pt-BR/api/app.md
+++ b/docs-translations/pt-BR/api/app.md
@@ -2,7 +2,7 @@
O módulo `app` é responsável por controlar o ciclo de vida do aplicativo.
-O exemplo a seguir mostra como fechar o aplicativo quando a última janela é fechada:
+O exemplo a seguir mostra como fechar o aplicativo quando a última janela é fechada:
```javascript
const app = require('electron').app
@@ -153,7 +153,7 @@ para confiar no certificado, você deve impedir o comportamento padrão com
```javascript
session.on('certificate-error', function (event, webContents, url, error, certificate, callback) {
- if (url == 'https://github.com') {
+ if (url === 'https://github.com') {
// Lógica de verificação.
event.preventDefault()
callback(true)
@@ -365,26 +365,23 @@ No macOS o sistema enforça instância única automaticamente quando usuários t
Um exemplo de ativação da janela de primeira instância quando uma segunda instância inicializa:
-```js
-var myWindow = null;
+```javascript
+let myWindow = null
-var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
+let shouldQuit = app.makeSingleInstance(function (commandLine, workingDirectory) {
// Alguém tentou rodar uma segunda instância, devemos focar nossa janela
if (myWindow) {
- if (myWindow.isMinimized()) myWindow.restore();
- myWindow.focus();
+ if (myWindow.isMinimized()) myWindow.restore()
+ myWindow.focus()
}
- return true;
-});
+ return true
+})
-if (shouldQuit) {
- app.quit();
- return;
-}
+if (shouldQuit) app.quit()
-// Cria myWindow, carrega o resto do aplicativo, etc...
-app.on('ready', function() {
-});
+app.on('ready', function () {
+ // Cria myWindow, carrega o resto do aplicativo, etc...
+})
```
### `app.setAppUserModelId(id)` _Windows_
diff --git a/docs-translations/pt-BR/api/browser-window.md b/docs-translations/pt-BR/api/browser-window.md
index 1efcb7ee830b..1d992be63271 100644
--- a/docs-translations/pt-BR/api/browser-window.md
+++ b/docs-translations/pt-BR/api/browser-window.md
@@ -191,7 +191,7 @@ Emitido quando a janela sai do estado de tela cheia, ocasionado por uma api de h
Emitido quando um [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx) é invocado. Estes estão tipicamente relacionado às teclas de mídia do teclado, ou comandos do browser, assim como o botão "Voltar" existente em alguns modelos de mouse no Windows.
-```js
+```javascript
someWindow.on('app-command', function (e, cmd) {
// Navega a janela 'para trás' quando o usuário pressiona o botão voltar do mouse
if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) {
diff --git a/docs-translations/pt-BR/api/process.md b/docs-translations/pt-BR/api/process.md
index 0840d97346dc..2240a0b7a91c 100644
--- a/docs-translations/pt-BR/api/process.md
+++ b/docs-translations/pt-BR/api/process.md
@@ -16,7 +16,7 @@ Emitido quando o Electron carregou seu script de inicialização interno e está
Pode ser utilizado pelo script pré-carregamento (preload.js abaixo) para adicionar símbolos globais do Node removidos para o escopo global quando a integração do node é desligada:
-```js
+```javascript
// preload.js
var _setImmediate = setImmediate
var _clearImmediate = clearImmediate
diff --git a/docs-translations/pt-BR/tutorial/desktop-environment-integration.md b/docs-translations/pt-BR/tutorial/desktop-environment-integration.md
index 7e64be38e9d0..73765b8da2de 100644
--- a/docs-translations/pt-BR/tutorial/desktop-environment-integration.md
+++ b/docs-translations/pt-BR/tutorial/desktop-environment-integration.md
@@ -67,15 +67,16 @@ Para criar seu Dock Menu customizado, você pode usar a API `app.dock.setMenu`,
ela está disponível apenas no macOS:
```javascript
-var app = require('app')
-var Menu = require('menu')
-var dockMenu = Menu.buildFromTemplate([
- { label: 'New Window', click: function () { console.log('New Window') } },
- { label: 'New Window with Settings', submenu: [
- { label: 'Basic' },
- { label: 'Pro'}
+const {app, Menu} = require('electron')
+
+const dockMenu = Menu.buildFromTemplate([
+ {label: 'New Window', click () { console.log('New Window') }},
+ {label: 'New Window with Settings',
+ submenu: [
+ {label: 'Basic'},
+ {label: 'Pro'}
]},
- { label: 'New Command...'}
+ {label: 'New Command...'}
])
app.dock.setMenu(dockMenu)
```
@@ -163,26 +164,26 @@ __Miniaturas da barra de tarefas do Windows Media Player:__
Você pode usar [BrowserWindow.setThumbarButtons][setthumbarbuttons] para criar
miniaturas na barra de ferramentas para sua aplicação.
-```
-var BrowserWindow = require('browser-window');
-var path = require('path');
+```javascript
+var BrowserWindow = require('browser-window')
+var path = require('path')
var win = new BrowserWindow({
width: 800,
height: 600
-});
+})
win.setThumbarButtons([
{
- tooltip: "button1",
+ tooltip: 'button1',
icon: path.join(__dirname, 'button1.png'),
- click: function() { console.log("button2 clicked"); }
+ click: function () { console.log('button2 clicked') }
},
{
- tooltip: "button2",
+ tooltip: 'button2',
icon: path.join(__dirname, 'button2.png'),
- flags:['enabled', 'dismissonclick'],
- click: function() { console.log("button2 clicked."); }
+ flags: ['enabled', 'dismissonclick'],
+ click: function () { console.log('button2 clicked.') }
}
-]);
+])
```
Para limpar os botões na miniatura da barra de ferramentas, apenas chame
@@ -222,8 +223,8 @@ Para adicionar uma barra de progresso para uma janela, você pode ver a API:
[BrowserWindow.setProgressBar][setprogressbar]:
```javascript
-var window = new BrowserWindow({...});
-window.setProgressBar(0.5);
+var window = new BrowserWindow()
+window.setProgressBar(0.5)
```
## Representação do arquivo na janela (macOS)
@@ -244,9 +245,9 @@ Para inserir o arquivo de representacão da janela, você pode usar as API
[BrowserWindow.setDocumentEdited][setdocumentedited]:
```javascript
-var window = new BrowserWindow({...});
-window.setRepresentedFilename('/etc/passwd');
-window.setDocumentEdited(true);
+var window = new BrowserWindow()
+window.setRepresentedFilename('/etc/passwd')
+window.setDocumentEdited(true)
```
[addrecentdocument]: ../api/app.md#appaddrecentdocumentpath
diff --git a/docs-translations/pt-BR/tutorial/online-offline-events.md b/docs-translations/pt-BR/tutorial/online-offline-events.md
index 01f810117f68..97eca7acd8bc 100644
--- a/docs-translations/pt-BR/tutorial/online-offline-events.md
+++ b/docs-translations/pt-BR/tutorial/online-offline-events.md
@@ -13,7 +13,7 @@ var onlineStatusWindow
app.on('ready', function () {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
- onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html')
+ onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)
})
```
@@ -53,7 +53,7 @@ var onlineStatusWindow
app.on('ready', function () {
onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false })
- onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html')
+ onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`)
})
ipc.on('online-status-changed', function (event, status) {
@@ -66,18 +66,18 @@ _online-status.html_
```html
-
-
-
+ updateOnlineStatus()
+
+