diff --git a/docs-translations/ko-KR/README.md b/docs-translations/ko-KR/README.md index 63c8716e4fc..629c3ec8c21 100644 --- a/docs-translations/ko-KR/README.md +++ b/docs-translations/ko-KR/README.md @@ -20,6 +20,7 @@ Electron에 대해 자주 묻는 질문이 있습니다. 이슈를 생성하기 ## 개발 가이드 * [지원하는 플랫폼](tutorial/supported-platforms.md) +* [보안](tutorial/security.md) * [어플리케이션 배포](tutorial/application-distribution.md) * [Mac 앱스토어 어플리케이션 제출 가이드](tutorial/mac-app-store-submission-guide.md) * [어플리케이션 패키징](tutorial/application-packaging.md) diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index 1d6140435e7..52a7baa308e 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -5,8 +5,8 @@ 밑의 예시는 마지막 윈도우가 종료되었을 때, 어플리케이션을 종료시키는 예시입니다: ```javascript -const app = require('electron').app; -app.on('window-all-closed', function() { +const {app} = require('electron'); +app.on('window-all-closed', () => { app.quit(); }); ``` @@ -41,7 +41,7 @@ Electron은 먼저 모든 윈도우의 종료를 시도하고 `will-quit` 이벤 않습니다. **역주:** 이 이벤트는 말 그대로 현재 어플리케이션에서 윈도우만 완전히 종료됬을 때 -발생하는 이벤트 입니다. 따라서 어플리케이션을 완전히 종료하려면 이 이벤트에서 +발생하는 이벤트입니다. 따라서 어플리케이션을 완전히 종료하려면 이 이벤트에서 `app.quit()`를 호출해 주어야 합니다. ### Event: 'before-quit' @@ -60,7 +60,7 @@ Returns: * `event` Event -모든 윈도우들이 종료되고 어플리케이션이 종료되기 시작할 때 발생하는 이벤트 입니다. +모든 윈도우들이 종료되고 어플리케이션이 종료되기 시작할 때 발생하는 이벤트입니다. `event.preventDefault()` 호출을 통해 어플리케이션의 종료를 방지할 수 있습니다. `will-quit` 와 `window-all-closed` 이벤트의 차이점을 확인하려면 `window-all-close` @@ -114,8 +114,26 @@ Returns: * `event` Event * `hasVisibleWindows` Boolean -어플리케이션이 활성화 되었을 때 발생하는 이벤트 입니다. -이 이벤트는 어플리케이션의 dock 아이콘을 클릭했을 때 주로 발생합니다. +어플리케이션이 활성화 되었을 때 발생하는 이벤트입니다. 이 이벤트는 사용자가 +어플리케이션의 dock 아이콘을 클릭했을 때 주로 발생합니다. + +### Event: 'continue-activity' _OS X_ + +Returns: + +* `event` Event +* `type` String - Activity를 식별하는 문자열. + [`NSUserActivity.activityType`][activity-type]을 맵핑합니다. +* `userInfo` Object - 다른 기기의 activity에서 저장된 앱-특정 상태를 포함합니다. + +다른 기기에서 받아온 activity를 재개하려고 할 때 [Handoff][handoff] 하는 동안 +발생하는 이벤트입니다. 이 이벤트를 처리하려면 반드시 `event.preventDefault()`를 +호출해야 합니다. + +사용자 activity는 activity의 소스 어플리케이션과 같은 개발자 팀 ID를 가지는 +어플리케이션 안에서만 재개될 수 있고, activity의 타입을 지원합니다. 지원하는 +activity의 타입은 어플리케이션 `Info.plist`의 `NSUserActivityTypes` 키에 열거되어 +있습니다. ### Event: 'browser-window-blur' @@ -124,7 +142,7 @@ Returns: * `event` Event * `window` BrowserWindow -[browserWindow](browser-window.md)에 대한 포커스가 사라졌을 때 발생하는 이벤트 입니다. +[browserWindow](browser-window.md)에 대한 포커스가 사라졌을 때 발생하는 이벤트입니다. ### Event: 'browser-window-focus' @@ -133,7 +151,7 @@ Returns: * `event` Event * `window` BrowserWindow -[browserWindow](browser-window.md)에 대한 포커스가 발생했을 때 발생하는 이벤트 입니다. +[browserWindow](browser-window.md)에 대한 포커스가 발생했을 때 발생하는 이벤트입니다. **역주:** _포커스_ 는 창을 클릭해서 활성화 시켰을 때를 말합니다. @@ -144,7 +162,7 @@ Returns: * `event` Event * `window` BrowserWindow -새로운 [browserWindow](browser-window.md)가 생성되었을 때 발생하는 이벤트 입니다. +새로운 [browserWindow](browser-window.md)가 생성되었을 때 발생하는 이벤트입니다. ### Event: 'certificate-error' @@ -164,9 +182,9 @@ Returns: 기본 동작을 방지하고 인증을 승인할 수 있습니다. ```javascript -app.on('certificate-error', function(event, webContents, url, error, certificate, callback) { - if (url == "https://github.com") { - // Verification logic. +app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { + if (url === 'https://github.com') { + // 확인 로직. event.preventDefault(); callback(true); } else { @@ -187,7 +205,7 @@ Returns: * `issuerName` String - 발급자의 공통 이름 * `callback` Function -클라이언트 인증이 요청되었을 때 발생하는 이벤트 입니다. +클라이언트 인증이 요청되었을 때 발생하는 이벤트입니다. `url`은 클라이언트 인증서를 요청하는 탐색 항목에 해당합니다. 그리고 `callback`은 목록에서 필터링된 항목과 함께 호출될 필요가 있습니다. @@ -195,10 +213,10 @@ Returns: 것을 막습니다. ```javascript -app.on('select-client-certificate', function(event, webContents, url, list, callback) { +app.on('select-client-certificate', (event, webContents, url, list, callback) => { event.preventDefault(); callback(list[0]); -}) +}); ``` ### Event: 'login' @@ -226,10 +244,10 @@ Returns: `callback(username, password)` 형태의 콜백을 호출하여 인증을 처리해야 합니다. ```javascript -app.on('login', function(event, webContents, request, authInfo, callback) { +app.on('login', (event, webContents, request, authInfo, callback) => { event.preventDefault(); callback('username', 'secret'); -}) +}); ``` ### Event: 'gpu-process-crashed' @@ -383,15 +401,13 @@ npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드 이 API는 내부적으로 Windows 레지스트리와 LSSetDefaultHandlerForURLScheme를 사용합니다. -### `app.removeAsDefaultProtocolClient(protocol)` _Windows_ +### `app.removeAsDefaultProtocolClient(protocol)` _OS X_ _Windows_ * `protocol` String - 프로토콜의 이름, `://` 제외. 이 메서드는 현재 실행파일이 지정한 프로토콜(URI scheme)에 대해 기본 핸들러인지를 확인합니다. 만약 그렇다면, 이 메서드는 앱을 기본 핸들러에서 제거합니다. -**참고:** OS X에서는 앱을 제거하면 자동으로 기본 프로토콜 핸들러에서 제거됩니다. - ### `app.isDefaultProtocolClient(protocol)` _OS X_ _Windows_ * `protocol` String - `://`를 제외한 프로토콜의 이름. @@ -418,7 +434,7 @@ Windows에서 사용할 수 있는 JumpList의 [Tasks][tasks] 카테고리에 `t `Task` Object: * `program` String - 실행할 프로그램의 경로. 보통 현재 작동중인 어플리케이션의 경로인 `process.execPath`를 지정합니다. -* `arguments` String - `program`이 실행될 때 사용될 명령줄 인자. +* `arguments` String - `program`이 실행될 때 사용될 명령줄 인수. * `title` String - JumpList에 표시할 문자열. * `description` String - 이 작업에 대한 설명. * `iconPath` String - JumpList에 표시될 아이콘의 절대 경로. @@ -470,9 +486,9 @@ OS X에선 사용자가 Finder에서 어플리케이션의 두 번째 인스턴 인스턴스의 윈도우를 활성화 시키는 예시입니다: ```javascript -var myWindow = null; +let myWindow = null; -var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) { +const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { // 어플리케이션을 중복 실행했습니다. 주 어플리케이션 인스턴스를 활성화 합니다. if (myWindow) { if (myWindow.isMinimized()) myWindow.restore(); @@ -487,10 +503,23 @@ if (shouldQuit) { } // 윈도우를 생성하고 각종 리소스를 로드하고 작업합니다. -app.on('ready', function() { +app.on('ready', () => { }); ``` +### `app.setUserActivity(type, userInfo)` _OS X_ + +* `type` String - 고유하게 activity를 식별합니다. + [`NSUserActivity.activityType`][activity-type]을 맵핑합니다. +* `userInfo` Object - 다른 기기에서 사용하기 위해 저장할 앱-특정 상태. + +`NSUserActivity`를 만들고 현재 activity에 설정합니다. 이 activity는 이후 다른 기기와 +[Handoff][handoff]할 때 자격으로 사용됩니다. + +### `app.getCurrentActivityType()` _OS X_ + +현재 작동중인 activity의 타입을 반환합니다. + ### `app.setAppUserModelId(id)` _Windows_ * `id` String @@ -577,3 +606,5 @@ dock 아이콘의 `image`를 설정합니다. [app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx [CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115 [LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme +[handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html +[activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType diff --git a/docs-translations/ko-KR/api/browser-window.md b/docs-translations/ko-KR/api/browser-window.md index 76257c8463b..ee77a9bbd43 100644 --- a/docs-translations/ko-KR/api/browser-window.md +++ b/docs-translations/ko-KR/api/browser-window.md @@ -6,13 +6,13 @@ ```javascript // 메인 프로세스에서 -const BrowserWindow = require('electron').BrowserWindow; +const {BrowserWindow} = require('electron'); // 또는 렌더러 프로세스에서 -const BrowserWindow = require('electron').remote.BrowserWindow; +const {BrowserWindow} = require('electron').remote; -var win = new BrowserWindow({ width: 800, height: 600, show: false }); -win.on('closed', function() { +let win = new BrowserWindow({width: 800, height: 600, show: false}); +win.on('closed', () => { win = null; }); @@ -97,6 +97,10 @@ win.show(); * `webPreferences` Object - 웹 페이지 기능을 설정합니다. 사용할 수 있는 속성은 아래를 참고하세요. +`minWidth`/`maxWidth`/`minHeight`/`maxHeight`를 통해 최소 또는 최대 윈도우 크기를 +지정한 경우, 이는 사용자만을 제약하며, `setBounds`/`setSize` 또는 `BrowserWindow`의 +생성자에서 크기 제약을 따르지 않는 윈도우 크기를 전달하는 것은 막을 수 없습니다. + `type` 속성에서 사용할 수 있는 값과 동작은 다음과 같으며, 플랫폼에 따라 다릅니다: * Linux의 경우, `desktop`, `dock`, `toolbar`, `splash`, `notification` 종류를 @@ -161,6 +165,8 @@ win.show(); 활성화합니다. 기본값은 `false`입니다. * `directWrite` Boolean - Windows에서 폰트 렌더링을 위해 DirectWrite를 사용하는지를 지정합니다. 기본값은 `true`입니다. +* `scrollBounce` Boolean - OS X에서 스크롤 튕기기 효과 (탄성 밴딩)를 활성화 합니다. + 기본값은 `false`입니다. * `blinkFeatures` String - `CSSVariables,KeyboardEventKey`같은 `,`로 구분된 기능 문자열들의 리스트입니다. 지원하는 전체 기능 문자열들은 [setFeatureEnabledFromString][blink-feature-string] 함수에서 찾을 수 있습니다. @@ -188,7 +194,7 @@ Returns: * `event` Event -문서의 제목이 변경될 때 발생하는 이벤트 입니다. `event.preventDefault()`를 호출하여 +문서의 제목이 변경될 때 발생하는 이벤트입니다. `event.preventDefault()`를 호출하여 네이티브 윈도우의 제목이 변경되는 것을 방지할 수 있습니다. ### Event: 'close' @@ -208,7 +214,7 @@ Electron에선 빈 문자열 또는 `false`를 전달할 경우 윈도우 종료 예시는 다음과 같습니다: ```javascript -window.onbeforeunload = function(e) { +window.onbeforeunload = (e) => { console.log('I do not want to be closed'); // 반드시 문자열을 반환해야 하고 사용자에게 페이지 언로드에 대한 확인 창을 보여주는 @@ -312,7 +318,7 @@ Returns: e.g. `APPCOMMAND_BROWSER_BACKWARD` 는 `browser-backward`와 같이 반환됩니다. ```javascript -someWindow.on('app-command', function(e, cmd) { +someWindow.on('app-command', (e, cmd) => { // 마우스의 뒤로가기 버튼을 눌렀을 때 뒤로가기 탐색을 실행합니다 if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) { someWindow.webContents.goBack(); @@ -384,7 +390,7 @@ ID에 해당하는 윈도우를 찾습니다. ```javascript // `win`은 BrowserWindow의 인스턴스입니다 -var win = new BrowserWindow({ width: 800, height: 600 }); +let win = new BrowserWindow({width: 800, height: 600}); ``` ### `win.webContents` @@ -677,7 +683,7 @@ Mac OS X에서 시트를 부착할 위치를 지정합니다. 기본적으로 표시하기 위해 사용할 것입니다: ```javascript -var toolbarRect = document.getElementById('toolbar').getBoundingClientRect(); +let toolbarRect = document.getElementById('toolbar').getBoundingClientRect(); win.setSheetOffset(toolbarRect.height); ``` diff --git a/docs-translations/ko-KR/api/chrome-command-line-switches.md b/docs-translations/ko-KR/api/chrome-command-line-switches.md index 7f1f4ced616..810d9c77e94 100644 --- a/docs-translations/ko-KR/api/chrome-command-line-switches.md +++ b/docs-translations/ko-KR/api/chrome-command-line-switches.md @@ -7,11 +7,11 @@ 명령줄 옵션을 추가로 지정할 수 있습니다: ```javascript -const app = require('electron').app; +const {app} = require('electron'); app.commandLine.appendSwitch('remote-debugging-port', '8315'); app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); -app.on('ready', function() { +app.on('ready', () => { // Your code here }); ``` @@ -109,8 +109,7 @@ Net log 이벤트를 활성화하고 `path`에 로그를 기록합니다. ## --ssl-version-fallback-min=`version` -TLS fallback에서 사용할 SSL/TLS 최소 버전을 지정합니다. ("tls1", "tls1.1", -"tls1.2") +TLS fallback에서 사용할 SSL/TLS 최소 버전을 지정합니다. (`tls1`, `tls1.1`, `tls1.2`) ## --cipher-suite-blacklist=`cipher_suites` diff --git a/docs-translations/ko-KR/api/clipboard.md b/docs-translations/ko-KR/api/clipboard.md index 83775dfa78b..8b027d2d58e 100644 --- a/docs-translations/ko-KR/api/clipboard.md +++ b/docs-translations/ko-KR/api/clipboard.md @@ -2,12 +2,14 @@ > 시스템 클립보드에 복사와 붙여넣기를 수행합니다. +다음 예시는 클립보드에 문자열을 쓰는 방법을 보여줍니다: + ```javascript -const clipboard = require('electron').clipboard; +const {clipboard} = require('electron'); clipboard.writeText('Example String'); ``` -X Window 시스템에선 selection 클립보드도 존재합니다. 이를 사용하려면 인자 뒤에 +X Window 시스템에선 selection 클립보드도 존재합니다. 이를 사용하려면 인수 뒤에 `selection` 문자열을 같이 지정해주어야 합니다: ```javascript @@ -111,7 +113,7 @@ console.log(clipboard.has('

selection

')); * `type` String (optional) ```javascript -clipboard.write({text: 'test', html: "test"}); +clipboard.write({text: 'test', html: 'test'}); ``` `data`를 클립보드에 씁니다. diff --git a/docs-translations/ko-KR/api/content-tracing.md b/docs-translations/ko-KR/api/content-tracing.md index 484197e2073..57ef5196ddb 100644 --- a/docs-translations/ko-KR/api/content-tracing.md +++ b/docs-translations/ko-KR/api/content-tracing.md @@ -7,18 +7,18 @@ `chrome://tracing/` 페이지를 열고 생성된 파일을 로드하면 결과를 볼 수 있습니다. ```javascript -const contentTracing = require('electron').contentTracing; +const {contentTracing} = require('electron'); const options = { categoryFilter: '*', traceOptions: 'record-until-full,enable-sampling' }; -contentTracing.startRecording(options, function() { +contentTracing.startRecording(options, () => { console.log('Tracing started'); - setTimeout(function() { - contentTracing.stopRecording('', function(path) { + setTimeout(() => { + contentTracing.stopRecording('', (path) => { console.log('Tracing data recorded to ' + path); }); }, 5000); @@ -36,7 +36,7 @@ contentTracing.startRecording(options, function() { 카테고리 그룹 세트를 가져옵니다. 카테고리 그룹은 도달된 코드 경로를 변경할 수 있습니다. 모든 child 프로세스가 `getCategories` 요청을 승인하면 `callback`이 한 번 호출되며 -인자에 카테고리 그룹의 배열이 전달됩니다. +인수에 카테고리 그룹의 배열이 전달됩니다. ### `contentTracing.startRecording(options, callback)` diff --git a/docs-translations/ko-KR/api/crash-reporter.md b/docs-translations/ko-KR/api/crash-reporter.md index 90851f7ee5b..f70d3fb9ed2 100644 --- a/docs-translations/ko-KR/api/crash-reporter.md +++ b/docs-translations/ko-KR/api/crash-reporter.md @@ -5,7 +5,7 @@ 다음 예시는 윈격 서버에 어플리케이션 크래시 정보를 자동으로 보고하는 예시입니다: ```javascript -const crashReporter = require('electron').crashReporter; +const {crashReporter} = require('electron'); crashReporter.start({ productName: 'YourName', diff --git a/docs-translations/ko-KR/api/desktop-capturer.md b/docs-translations/ko-KR/api/desktop-capturer.md index 0ee1b3e1d22..7093ad3b6a5 100644 --- a/docs-translations/ko-KR/api/desktop-capturer.md +++ b/docs-translations/ko-KR/api/desktop-capturer.md @@ -5,12 +5,12 @@ ```javascript // 렌더러 프로세스 내부 -var desktopCapturer = require('electron').desktopCapturer; +const {desktopCapturer} = require('electron'); -desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { +desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => { if (error) throw error; - for (var i = 0; i < sources.length; ++i) { - if (sources[i].name == "Electron") { + for (let i = 0; i < sources.length; ++i) { + if (sources[i].name === 'Electron') { navigator.webkitGetUserMedia({ audio: false, video: { diff --git a/docs-translations/ko-KR/api/dialog.md b/docs-translations/ko-KR/api/dialog.md index 90d76df1669..30132383b5b 100644 --- a/docs-translations/ko-KR/api/dialog.md +++ b/docs-translations/ko-KR/api/dialog.md @@ -5,16 +5,16 @@ 다음 예시는 파일과 디렉터리를 다중으로 선택하는 대화 상자를 표시하는 예시입니다: ```javascript -var win = ...; // 대화 상자를 사용할 BrowserWindow 객체 -const dialog = require('electron').dialog; -console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]})); +let win = ...; // 대화 상자를 사용할 BrowserWindow 객체 +const {dialog} = require('electron'); +console.log(dialog.showOpenDialog({properties: ['openFile', 'openDirectory', 'multiSelections']})); ``` 대화 상자는 Electron의 메인 스레드에서 열립니다. 만약 렌더러 프로세스에서 대화 상자 객체를 사용하고 싶다면, `remote`를 통해 접근하는 방법을 고려해야 합니다: ```javascript -const dialog = require('electron').remote.dialog; +const {dialog} = require('electron').remote; ``` ## Methods @@ -45,10 +45,10 @@ const dialog = require('electron').remote.dialog; ```javascript { filters: [ - { name: 'Images', extensions: ['jpg', 'png', 'gif'] }, - { name: 'Movies', extensions: ['mkv', 'avi', 'mp4'] }, - { name: 'Custom File Type', extensions: ['as'] }, - { name: 'All Files', extensions: ['*'] } + {name: 'Images', extensions: ['jpg', 'png', 'gif']}, + {name: 'Movies', extensions: ['mkv', 'avi', 'mp4']}, + {name: 'Custom File Type', extensions: ['as']}, + {name: 'All Files', extensions: ['*']} ] } ``` @@ -102,10 +102,10 @@ const dialog = require('electron').remote.dialog; 라벨을 가지고 있을 때 해당 버튼의 인덱스를 반환합니다. 따로 두 라벨이 지정되지 않은 경우 0을 반환합니다. OS X와 Windows에선 `cancelId` 지정 여부에 상관없이 "Cancel" 버튼이 언제나 `cancelId`로 지정됩니다. - * `noLink` Boolean - Windows Electron은 "Cancel"이나 "Yes"와 같은 흔히 사용되는 - 버튼을 찾으려고 시도하고 대화 상자 내에서 해당 버튼을 커맨드 링크처럼 만듭니다. - 이 기능으로 앱을 좀 더 Modern Windows 앱처럼 만들 수 있습니다. 이 기능을 원하지 - 않으면 `noLink`를 true로 지정하면 됩니다. + * `noLink` Boolean - Windows에서 Electron은 ("Cancel"이나 "Yes"와 같은) 흔히 + 사용되는 버튼을 찾으려고 시도하고 대화 상자 내에서 해당 버튼을 커맨드 링크처럼 + 만듭니다. 이 기능으로 앱을 좀 더 현대적인 Windows 앱처럼 만들 수 있습니다. 이 + 기능을 원하지 않으면 `noLink`를 true로 지정하면 됩니다. * `callback` Function (optional) 대화 상자를 표시합니다. `browserWindow`를 지정하면 대화 상자가 완전히 닫힐 때까지 @@ -131,7 +131,7 @@ Linux에서 `ready` 이벤트가 발생하기 전에 이 API를 호출할 경우 ## Sheets -Mac OS X에선, `browserWindow` 인자에 `BrowserWindow` 객체 참조를 전달하면 대화 +Mac OS X에선, `browserWindow` 인수에 `BrowserWindow` 객체 참조를 전달하면 대화 상자가 해당 윈도우에 시트처럼 표시되도록 표현할 수 있습니다. 윈도우의 객체 참조가 제공되지 않으면 모달 형태로 표시됩니다. diff --git a/docs-translations/ko-KR/api/download-item.md b/docs-translations/ko-KR/api/download-item.md index 4267a41df71..a7489081bb3 100644 --- a/docs-translations/ko-KR/api/download-item.md +++ b/docs-translations/ko-KR/api/download-item.md @@ -8,20 +8,20 @@ ```javascript // 메인 프로세스 -win.webContents.session.on('will-download', function(event, item, webContents) { +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() { + item.on('updated', () => { console.log('Received bytes: ' + item.getReceivedBytes()); }); - item.on('done', function(e, state) { - if (state == "completed") { - console.log("Download successfully"); + item.on('done', (e, state) => { + if (state === 'completed') { + console.log('Download successfully'); } else { - console.log("Download is cancelled or interrupted that can't be resumed"); + console.log('Download is cancelled or interrupted that can\'t be resumed'); } }); }); diff --git a/docs-translations/ko-KR/api/file-object.md b/docs-translations/ko-KR/api/file-object.md index 6d7519a7ad2..898f7f75b82 100644 --- a/docs-translations/ko-KR/api/file-object.md +++ b/docs-translations/ko-KR/api/file-object.md @@ -14,16 +14,16 @@ API를 사용하여 작업할 때 선택된 파일의 경로를 알 수 있도 @@ -50,15 +48,28 @@ app.on('ready', function() { ## 분리 할당 -만약 CoffeeScript나 Babel을 사용하고 있다면, 빌트인 모듈을 사용할 때 -[분리 할당][destructuring-assignment]을 통해 직관적으로 사용할 수 있습니다: +0.37 버전부터, [분리 할당][destructuring-assignment]을 통해 빌트인 모듈을 더 +직관적으로 사용할 수 있습니다: ```javascript -const {app, BrowserWindow} = require('electron') +const {app, BrowserWindow} = require('electron'); ``` -아직 플레인 자바스크립트를 쓰고 있다면, Chrome이 ES6를 완전히 지원하기 전까지 기다려야 -합니다. +모든 `electron` 모듈이 필요하다면, 먼저 require한 후 각 독립적인 모듈을 +`electron`에서 분리 할당함으로써 모듈을 사용할 수 있습니다. + +```javascript +const electron = require('electron'); +const {app, BrowserWindow} = electron; + ``` + +위 코드는 다음과 같습니다: + +```javascript +const electron = require('electron'); +const app = electron.app; +const BrowserWindow = electron.BrowserWindow; +``` ## 이전 스타일의 빌트인 모듈 비활성화 @@ -76,7 +87,7 @@ process.env.ELECTRON_HIDE_INTERNAL_MODULES = 'true' 또는 `hideInternalModules` API를 사용해도 됩니다: ```javascript -require('electron').hideInternalModules() +require('electron').hideInternalModules(); ``` [gui]: https://en.wikipedia.org/wiki/Graphical_user_interface diff --git a/docs-translations/ko-KR/api/tray.md b/docs-translations/ko-KR/api/tray.md index 6162557e1a7..d208de25020 100644 --- a/docs-translations/ko-KR/api/tray.md +++ b/docs-translations/ko-KR/api/tray.md @@ -3,24 +3,20 @@ > 아이콘과 컨텍스트 메뉴를 시스템 알림 영역에 추가합니다. ```javascript -const electron = require('electron'); -const app = electron.app; -const Menu = electron.Menu; -const Tray = electron.Tray; +const {app, Menu, Tray} = require('electron'); -var appIcon = null; -app.on('ready', function(){ +let appIcon = null; +app.on('ready', () => { appIcon = new Tray('/path/to/my/icon'); // 현재 어플리케이션 디렉터리를 기준으로 하려면 `__dirname + '/images/tray.png'` 형식으로 입력해야 합니다. - var contextMenu = Menu.buildFromTemplate([ - { label: 'Item1', type: 'radio' }, - { label: 'Item2', type: 'radio' }, - { label: 'Item3', type: 'radio', checked: true }, - { label: 'Item4', type: 'radio' } + const contextMenu = Menu.buildFromTemplate([ + {label: 'Item1', type: 'radio'}, + {label: 'Item2', type: 'radio'}, + {label: 'Item3', type: 'radio', checked: true}, + {label: 'Item4', type: 'radio'} ]); appIcon.setToolTip('이것은 나의 어플리케이션 입니다!'); appIcon.setContextMenu(contextMenu); }); - ``` __플랫폼별 한계:__ diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index 3405d5f0266..d0d7bd43b4b 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -10,10 +10,10 @@ ```javascript const BrowserWindow = require('electron').BrowserWindow; -var win = new BrowserWindow({width: 800, height: 1500}); -win.loadURL("http://github.com"); +let win = new BrowserWindow({width: 800, height: 1500}); +win.loadURL('http://github.com'); -var webContents = win.webContents; +let webContents = win.webContents; ``` ## Events @@ -322,7 +322,7 @@ Returns: 하는 경우 `pragma` 헤더를 사용할 수 있습니다. ```javascript -const options = {"extraHeaders" : "pragma: no-cache\n"} +const options = {extraHeaders: 'pragma: no-cache\n'}; webContents.loadURL(url, options) ``` @@ -338,10 +338,10 @@ webContents.loadURL(url, options) 현재 웹 페이지의 URL을 반환합니다. ```javascript -var win = new BrowserWindow({width: 800, height: 600}); -win.loadURL("http://github.com"); +let win = new BrowserWindow({width: 800, height: 600}); +win.loadURL('http://github.com'); -var currentURL = win.webContents.getURL(); +let currentURL = win.webContents.getURL(); ``` ### `webContents.getTitle()` @@ -533,12 +533,12 @@ CSS 코드를 현재 웹 페이지에 삽입합니다. 제공된 `action`에 대한 `webContents`의 모든 `findInPage` 요청을 중지합니다. ```javascript -webContents.on('found-in-page', function(event, result) { +webContents.on('found-in-page', (event, result) => { if (result.finalUpdate) - webContents.stopFindInPage("clearSelection"); + webContents.stopFindInPage('clearSelection'); }); -const requestId = webContents.findInPage("api"); +const requestId = webContents.findInPage('api'); ``` ### `webContents.hasServiceWorker(callback)` @@ -584,7 +584,7 @@ print기능을 사용하지 않는 경우 전체 바이너리 크기를 줄이 * `printSelectionOnly` Boolean - 선택된 영역만 프린트할지 여부를 정합니다. * `landscape` Boolean - landscape을 위해선 `true`를, portrait를 위해선 `false`를 사용합니다. -* `callback` Function - `function(error, data) {}` +* `callback` Function - `(error, data) => {}` Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 웹 페이지를 PDF로 프린트합니다. @@ -607,19 +607,19 @@ Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 const BrowserWindow = require('electron').BrowserWindow; const fs = require('fs'); -var win = new BrowserWindow({width: 800, height: 600}); -win.loadURL("http://github.com"); +let win = new BrowserWindow({width: 800, height: 600}); +win.loadURL('http://github.com'); -win.webContents.on("did-finish-load", function() { +win.webContents.on('did-finish-load', () => { // Use default printing options - win.webContents.printToPDF({}, function(error, data) { + win.webContents.printToPDF({}, (error, data) => { if (error) throw error; - fs.writeFile("/tmp/print.pdf", data, function(error) { + fs.writeFile('/tmp/print.pdf', data, (error) => { if (error) throw error; - console.log("Write PDF successfully."); - }) - }) + console.log('Write PDF successfully.'); + }); + }); }); ``` @@ -631,8 +631,8 @@ win.webContents.on("did-finish-load", function() { 이후에 사용해야 합니다. ```javascript -mainWindow.webContents.on('devtools-opened', function() { - mainWindow.webContents.addWorkSpace(__dirname); +win.webContents.on('devtools-opened', () => { + win.webContents.addWorkSpace(__dirname); }); ``` @@ -696,12 +696,12 @@ mainWindow.webContents.on('devtools-opened', function() { ```javascript // In the main process. -var window = null; -app.on('ready', function() { - window = new BrowserWindow({width: 800, height: 600}); - window.loadURL('file://' + __dirname + '/index.html'); - window.webContents.on('did-finish-load', function() { - window.webContents.send('ping', 'whoooooooh!'); +let win = null; +app.on('ready', () => { + win = new BrowserWindow({width: 800, height: 600}); + win.loadURL('file://' + __dirname + '/index.html'); + win.webContents.on('did-finish-load', () => { + win.webContents.send('ping', 'whoooooooh!'); }); }); ``` @@ -711,7 +711,7 @@ app.on('ready', function() { @@ -820,7 +820,7 @@ Input `event`를 웹 페이지로 전송합니다. * `HTMLOnly` - 페이지의 HTML만 저장합니다. * `HTMLComplete` - 페이지의 완성된 HTML을 저장합니다. * `MHTML` - 페이지의 완성된 HTML을 MHTML로 저장합니다. -* `callback` Function - `function(error) {}`. +* `callback` Function - `(error) => {}`. * `error` Error 만약 페이지를 저장하는 프로세스가 성공적으로 끝났을 경우 true를 반환합니다. @@ -828,10 +828,10 @@ Input `event`를 웹 페이지로 전송합니다. ```javascript win.loadURL('https://github.com'); -win.webContents.on('did-finish-load', function() { - win.webContents.savePage('/tmp/test.html', 'HTMLComplete', function(error) { +win.webContents.on('did-finish-load', () => { + win.webContents.savePage('/tmp/test.html', 'HTMLComplete', (error) => { if (!error) - console.log("Save page successfully"); + console.log('Save page successfully'); }); }); ``` @@ -861,23 +861,23 @@ win.webContents.on('did-finish-load', function() { ```javascript try { - win.webContents.debugger.attach("1.1"); + win.webContents.debugger.attach('1.1'); } catch(err) { - console.log("Debugger attach failed : ", err); + console.log('Debugger attach failed : ', err); }; -win.webContents.debugger.on('detach', function(event, reason) { - console.log("Debugger detached due to : ", reason); +win.webContents.debugger.on('detach', (event, reason) => { + console.log('Debugger detached due to : ', reason); }); -win.webContents.debugger.on('message', function(event, method, params) { - if (method == "Network.requestWillBeSent") { - if (params.request.url == "https://www.github.com") +win.webContents.debugger.on('message', (event, method, params) => { + if (method === 'Network.requestWillBeSent') { + if (params.request.url === 'https://www.github.com') win.webContents.debugger.detach(); } -}) +}); -win.webContents.debugger.sendCommand("Network.enable"); +win.webContents.debugger.sendCommand('Network.enable'); ``` #### `webContents.debugger.attach([protocolVersion])` diff --git a/docs-translations/ko-KR/api/web-frame.md b/docs-translations/ko-KR/api/web-frame.md index 4b9ade4bebe..69e563df3f5 100644 --- a/docs-translations/ko-KR/api/web-frame.md +++ b/docs-translations/ko-KR/api/web-frame.md @@ -5,7 +5,7 @@ 다음 예시는 현재 페이지를 200% 줌 합니다: ```javascript -var webFrame = require('electron').webFrame; +const {webFrame} = require('electron'); webFrame.setZoomFactor(2); ``` @@ -58,8 +58,8 @@ Input field나 text area에 철자 검사(spell checking) 제공자를 설정합 [node-spellchecker][spellchecker]를 철자 검사 제공자로 사용하는 예시입니다: ```javascript -webFrame.setSpellCheckProvider("en-US", true, { - spellCheck: function(text) { +webFrame.setSpellCheckProvider('en-US', true, { + spellCheck(text) { return !(require('spellchecker').isMisspelled(text)); } }); diff --git a/docs-translations/ko-KR/api/web-view-tag.md b/docs-translations/ko-KR/api/web-view-tag.md index ae446975ef2..3191db71331 100644 --- a/docs-translations/ko-KR/api/web-view-tag.md +++ b/docs-translations/ko-KR/api/web-view-tag.md @@ -29,19 +29,21 @@ ```html ``` @@ -205,7 +207,7 @@ API를 사용할 수 있습니다. 이를 지정하면 내부에서 로우레벨 **예시** ```javascript -webview.addEventListener("dom-ready", function() { +webview.addEventListener('dom-ready', () => { webview.openDevTools(); }); ``` @@ -450,7 +452,7 @@ Webview 페이지를 PDF 형식으로 인쇄합니다. * `args` (optional) `channel`을 통해 렌더러 프로세스로 비동기 메시지를 보냅니다. 또한 `args`를 지정하여 -임의의 인자를 보낼 수도 있습니다. 렌더러 프로세스는 `ipcRenderer` 모듈의 `channel` +임의의 인수를 보낼 수도 있습니다. 렌더러 프로세스는 `ipcRenderer` 모듈의 `channel` 이벤트로 이 메시지를 받아 처리할 수 있습니다. 예시는 [webContents.send](web-contents.md#webcontentssendchannel-args)를 참고하세요. @@ -588,7 +590,7 @@ Returns: 콘솔에 다시 로깅하는 예시입니다. ```javascript -webview.addEventListener('console-message', function(e) { +webview.addEventListener('console-message', (e) => { console.log('Guest page logged a message:', e.message); }); ``` @@ -608,12 +610,12 @@ Returns: 사용할 수 있을 때 발생하는 이벤트입니다. ```javascript -webview.addEventListener('found-in-page', function(e) { +webview.addEventListener('found-in-page', (e) => { if (e.result.finalUpdate) - webview.stopFindInPage("keepSelection"); + webview.stopFindInPage('keepSelection'); }); -const rquestId = webview.findInPage("test"); +const rquestId = webview.findInPage('test'); ``` ### Event: 'new-window' @@ -631,10 +633,12 @@ Returns: 다음 예시 코드는 새 URL을 시스템의 기본 브라우저로 여는 코드입니다. ```javascript -webview.addEventListener('new-window', function(e) { - var protocol = require('url').parse(e.url).protocol; +const {shell} = require('electron'); + +webview.addEventListener('new-window', (e) => { + const protocol = require('url').parse(e.url).protocol; if (protocol === 'http:' || protocol === 'https:') { - require('electron').shell.openExternal(e.url); + shell.openExternal(e.url); } }); ``` @@ -687,7 +691,7 @@ Returns: 이동시키는 예시입니다. ```javascript -webview.addEventListener('close', function() { +webview.addEventListener('close', () => { webview.src = 'about:blank'; }); ``` @@ -706,7 +710,7 @@ Returns: ```javascript // In embedder page. -webview.addEventListener('ipc-message', function(event) { +webview.addEventListener('ipc-message', (event) => { console.log(event.channel); // Prints "pong" }); @@ -715,8 +719,8 @@ webview.send('ping'); ```javascript // In guest page. -var ipcRenderer = require('electron').ipcRenderer; -ipcRenderer.on('ping', function() { +const {ipcRenderer} = require('electron'); +ipcRenderer.on('ping', () => { ipcRenderer.sendToHost('pong'); }); ``` diff --git a/docs-translations/ko-KR/api/window-open.md b/docs-translations/ko-KR/api/window-open.md index 259b08dc596..ac291283f54 100644 --- a/docs-translations/ko-KR/api/window-open.md +++ b/docs-translations/ko-KR/api/window-open.md @@ -11,7 +11,7 @@ 합니다. 새롭게 생성된 `BrowserWindow`는 기본적으로 부모 창의 옵션을 상속합니다. 이 옵션을 -변경하려면 새 창을 열 때 `features` 인자를 지정해야 합니다. +변경하려면 새 창을 열 때 `features` 인수를 지정해야 합니다. ### `window.open(url[, frameName][, features])` diff --git a/docs-translations/ko-KR/development/build-instructions-windows.md b/docs-translations/ko-KR/development/build-instructions-windows.md index 7d30635a6a0..e3804a410d3 100644 --- a/docs-translations/ko-KR/development/build-instructions-windows.md +++ b/docs-translations/ko-KR/development/build-instructions-windows.md @@ -61,7 +61,7 @@ $ python script\build.py -c D ## 64비트 빌드 64비트를 타겟으로 빌드 하려면 부트스트랩 스크립트를 실행할 때 `--target_arch=x64` -인자를 같이 넘겨주면 됩니다: +인수를 같이 넘겨주면 됩니다: ```powershell $ python script\bootstrap.py -v --target_arch=x64 diff --git a/docs-translations/ko-KR/development/debug-instructions-windows.md b/docs-translations/ko-KR/development/debug-instructions-windows.md index a0d50e475c7..35c49bc7e70 100644 --- a/docs-translations/ko-KR/development/debug-instructions-windows.md +++ b/docs-translations/ko-KR/development/debug-instructions-windows.md @@ -21,13 +21,13 @@ Electron 소스 코드가 중단점을 통해 순차적으로 쉽게 디버깅 설정해야 합니다. 이 작업은 Visual Studio가 Electron에서 무슨일이 일어나는지 더 잘 이해할 수 있도록 하며 변수를 사람이 읽기 좋은 포맷으로 쉽게 표현할 수 있도록 합니다. -* **ProcMon**: 이 무료 [SysInternals][sys-internals] 툴은 프로세스 인자, 파일 +* **ProcMon**: 이 무료 [SysInternals][sys-internals] 툴은 프로세스 인수, 파일 핸들러 그리고 레지스트리 작업을 탐색할 수 있게 도와줍니다. ## Electron에 디버거 연결하고 디버깅하기 디버깅 작업을 시작하려면, PowerShell/CMD 중 한 가지를 열고 디버그 빌드 상태의 -Electron에 인자로 어플리케이션을 전달하여 실행합니다: +Electron에 인수로 어플리케이션을 전달하여 실행합니다: ```powershell $ ./out/D/electron.exe ~/my-electron-app/ diff --git a/docs-translations/ko-KR/faq/electron-faq.md b/docs-translations/ko-KR/faq/electron-faq.md index a038142c5ae..38235e2d898 100644 --- a/docs-translations/ko-KR/faq/electron-faq.md +++ b/docs-translations/ko-KR/faq/electron-faq.md @@ -3,16 +3,19 @@ ## 언제 Electron이 최신 버전의 Chrome으로 업그레이드 되나요? Electron의 Chrome 버전은 보통 새로운 Chrome 안정 버전이 릴리즈 된 이후 1주 내지 2주 -내로 업데이트됩니다. +내로 업데이트됩니다. 하지만 이러한 업데이트 주기는 보장되지 않으며 업그레이드에 필요한 +작업의 양에 따라 달라집니다. -또한 우리는 크롬의 안정된 채널만을 이용합니다, 만약 중요한 수정이 베타 또는 개발 채널인 -경우, 우리는 해당 버전 대신 이전 버전을 다시 사용합니다. +Electron은 크롬이 사용하는 안정된 채널만을 이용합니다, 만약 중요한 수정이 베타 또는 +개발 채널에 패치된 경우, 이전 버전의 채널로 롤백합니다. + +자세한 내용은 [보안 설명](../tutorial/electron-security.md)을 참고하세요. ## Electron은 언제 최신 버전의 Node.js로 업그레이드 하나요? -새로운 버전의 Node.js가 릴리즈 되면, 우리는 보통 Electron을 업그레이드 하기 전에 한 -달 정도 대기합니다. 이렇게 하면 새로운 Node.js 버전을 업데이트 함으로써 발생하는 -버그들을 피할 수 있습니다. 이러한 상황은 자주 발생합니다. +새로운 버전의 Node.js가 릴리즈 되면, 보통 Electron을 업그레이드 하기 전에 한 달 정도 +대기합니다. 이렇게 하면 새로운 Node.js 버전을 업데이트 함으로써 발생하는 버그들을 +피할 수 있기 때문입니다. 이러한 상황은 자주 발생합니다. Node.js의 새로운 기능은 보통 V8 업그레이드에서 가져옵니다. Electron은 Chrome 브라우저에 탑재된 V8을 사용하고 있습니다. 눈부신 새로운 Node.js 버전의 자바스크립트 @@ -59,18 +62,18 @@ console.log(require('remote').getGlobal('sharedObject').someProperty); 만약 빠르게 고치고 싶다면, 다음과 같이 변수를 전역 변수로 만드는 방법이 있습니다: ```javascript -app.on('ready', function() { - var tray = new Tray('/path/to/icon.png'); -}) +app.on('ready', () => { + const tray = new Tray('/path/to/icon.png'); +}); ``` 를 이렇게: ```javascript -var tray = null; -app.on('ready', function() { +let tray = null; +app.on('ready', () => { tray = new Tray('/path/to/icon.png'); -}) +}); ``` ## Electron에서 jQuery/RequireJS/Meteor/AngularJS를 사용할 수 없습니다. @@ -83,7 +86,7 @@ Node.js가 Electron에 합쳐졌기 때문에, DOM에 `module`, `exports`, `requ ```javascript // 메인 프로세스에서. -var mainWindow = new BrowserWindow({ +let win = new BrowserWindow({ webPreferences: { nodeIntegration: false } diff --git a/docs-translations/ko-KR/styleguide.md b/docs-translations/ko-KR/styleguide.md index 3896f3d21d1..340fa4204a0 100644 --- a/docs-translations/ko-KR/styleguide.md +++ b/docs-translations/ko-KR/styleguide.md @@ -92,7 +92,7 @@ Returns: 다음과 같이 사용할 수 있습니다: ```javascript -Alarm.on('wake-up', function(time) { +Alarm.on('wake-up', (time) => { console.log(time) -}) +}); ``` diff --git a/docs-translations/ko-KR/tutorial/application-packaging.md b/docs-translations/ko-KR/tutorial/application-packaging.md index bc56d824617..8002350b56b 100644 --- a/docs-translations/ko-KR/tutorial/application-packaging.md +++ b/docs-translations/ko-KR/tutorial/application-packaging.md @@ -70,8 +70,8 @@ require('/path/to/example.asar/dir/module.js'); `BrowserWindow` 클래스를 이용해 원하는 웹 페이지도 표시할 수 있습니다: ```javascript -const BrowserWindow = require('electron').BrowserWindow; -var win = new BrowserWindow({width: 800, height: 600}); +const {BrowserWindow} = require('electron'); +let win = new BrowserWindow({width: 800, height: 600}); win.loadURL('file:///path/to/example.asar/static/index.html'); ``` @@ -84,8 +84,8 @@ win.loadURL('file:///path/to/example.asar/static/index.html'); ```html @@ -99,7 +99,7 @@ $.get('file:///path/to/example.asar/file.txt', function(data) { 읽어들입니다: ```javascript -var originalFs = require('original-fs'); +const originalFs = require('original-fs'); originalFs.readFileSync('/path/to/example.asar'); ``` diff --git a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md index 961bfc83076..beece23e3f7 100644 --- a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md +++ b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md @@ -17,13 +17,13 @@ Windows, Linux, OS X 운영체제 모두 기본적으로 어플리케이션에 **참고:** 이 API는 HTML5 API이기 때문에 렌더러 프로세스에서만 사용할 수 있습니다. ```javascript -var myNotification = new Notification('Title', { +let myNotification = new Notification('Title', { body: 'Lorem Ipsum Dolor Sit Amet' }); -myNotification.onclick = function () { - console.log('Notification clicked') -} +myNotification.onclick = () => { + console.log('Notification clicked'); +}; ``` 위 코드를 통해 생성한 데스크톱 알림은 각 운영체제 모두 비슷한 사용자 경험을 제공하지만, @@ -90,7 +90,7 @@ app.clearRecentDocuments(); 않습니다. 어플리케이션 등록에 관련된 API의 모든 내용은 [Application Registration][app-registration]에서 찾아볼 수 있습니다. -유저가 JumpList에서 파일을 클릭할 경우 클릭된 파일의 경로가 커맨드 라인 인자로 추가되어 +유저가 JumpList에서 파일을 클릭할 경우 클릭된 파일의 경로가 커맨드 라인 인수로 추가되어 새로운 인스턴스의 어플리케이션이 실행됩니다. ### OS X에서 주의할 점 @@ -110,18 +110,17 @@ __Terminal.app의 dock menu:__ OS X에서만 사용 가능합니다: ```javascript -const electron = require('electron'); -const app = electron.app; -const Menu = electron.Menu; +const {app, Menu} = require('electron'); -var dockMenu = Menu.buildFromTemplate([ - { label: 'New Window', click: function() { console.log('New Window'); } }, - { label: 'New Window with Settings', submenu: [ - { label: 'Basic' }, - { label: 'Pro'} +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); ``` @@ -149,7 +148,7 @@ __Internet Explorer의 작업:__ ![IE](http://i.msdn.microsoft.com/dynimg/IC420539.png) OS X의 dock menu(진짜 메뉴)와는 달리 Windows의 사용자 작업은 어플리케이션 바로 -가기처럼 작동합니다. 유저가 작업을 클릭할 때 설정한 인자와 함께 새로운 어플리케이션이 +가기처럼 작동합니다. 유저가 작업을 클릭할 때 설정한 인수와 함께 새로운 어플리케이션이 실행됩니다. 사용자 작업을 설정하려면 [app.setUserTasks][setusertaskstasks] 메서드를 통해 구현할 @@ -168,7 +167,7 @@ app.setUserTasks([ ]); ``` -작업 리스트를 비우려면 간단히 `app.setUserTasks` 메서드의 첫번째 인자에 빈 배열을 넣어 +작업 리스트를 비우려면 간단히 `app.setUserTasks` 메서드의 첫번째 인수에 빈 배열을 넣어 호출하면 됩니다: ```javascript @@ -203,24 +202,25 @@ __Windows Media Player의 미리보기 툴바:__ 미리보기 툴바를 설정할 수 있습니다: ```javascript -const BrowserWindow = require('electron').BrowserWindow; +const {BrowserWindow} = require('electron'); const path = require('path'); -var win = new BrowserWindow({ +let 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() { console.log('button2 clicked'); } }, { - tooltip: "button2", + tooltip: 'button2', icon: path.join(__dirname, 'button2.png'), flags:['enabled', 'dismissonclick'], - click: function() { console.log("button2 clicked."); } + click() { console.log('button2 clicked.'); } } ]); ``` @@ -259,8 +259,8 @@ __작업 표시줄 버튼의 프로그래스 바:__ 있습니다: ```javascript -var window = new BrowserWindow({...}); -window.setProgressBar(0.5); +let win = new BrowserWindow({...}); +win.setProgressBar(0.5); ``` ## 작업 표시줄의 아이콘 오버레이 (Windows) @@ -286,8 +286,8 @@ __작업 표시줄 버튼 위의 오버레이:__ API를 사용할 수 있습니다: ```javascript -var window = new BrowserWindow({...}); -window.setOverlayIcon('path/to/overlay.png', 'Description for overlay'); +let win = new BrowserWindow({...}); +win.setOverlayIcon('path/to/overlay.png', 'Description for overlay'); ``` ## 대표 파일 제시 (OS X) @@ -305,9 +305,9 @@ __대표 파일 팝업 메뉴:__ [BrowserWindow.setDocumentEdited][setdocumentedited]를 사용할 수 있습니다: ```javascript -var window = new BrowserWindow({...}); -window.setRepresentedFilename('/etc/passwd'); -window.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/ko-KR/tutorial/online-offline-events.md b/docs-translations/ko-KR/tutorial/online-offline-events.md index 698544e83b6..de2e10f9efe 100644 --- a/docs-translations/ko-KR/tutorial/online-offline-events.md +++ b/docs-translations/ko-KR/tutorial/online-offline-events.md @@ -6,13 +6,12 @@ _main.js_ ```javascript -const electron = require('electron'); -const app = electron.app; -const BrowserWindow = electron.BrowserWindow; +const {app, BrowserWindow} = require('electron'); -var onlineStatusWindow; -app.on('ready', function() { - onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }); +let onlineStatusWindow; + +app.on('ready', () => { + onlineStatusWindow = new BrowserWindow({width: 0, height: 0, show: false}); onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html'); }); ``` @@ -24,7 +23,7 @@ _online-status.html_