From df0bda058fd3d367fd8968ead27b928391aac500 Mon Sep 17 00:00:00 2001 From: Arus Date: Fri, 30 Sep 2016 00:52:40 +0900 Subject: [PATCH] Update korean docs, according to most recent changes and other missing. (#7400) * Apply changes * Apply changes * Apply changes * Apply changes * Fix all JS standard syntax errors * Apply of recent changes, #7374 --- docs-translations/ko-KR/api/app.md | 382 +++++++++++++++------ docs-translations/ko-KR/api/auto-updater.md | 2 +- docs-translations/ko-KR/api/browser-window.md | 187 ++++++---- .../ko-KR/api/chrome-command-line-switches.md | 12 +- docs-translations/ko-KR/api/clipboard.md | 35 +- docs-translations/ko-KR/api/content-tracing.md | 16 +- docs-translations/ko-KR/api/crash-reporter.md | 14 +- docs-translations/ko-KR/api/dialog.md | 18 +- docs-translations/ko-KR/api/download-item.md | 24 +- docs-translations/ko-KR/api/global-shortcut.md | 22 +- docs-translations/ko-KR/api/ipc-main.md | 26 +- docs-translations/ko-KR/api/menu.md | 6 +- docs-translations/ko-KR/api/native-image.md | 31 +- docs-translations/ko-KR/api/power-monitor.md | 10 +- docs-translations/ko-KR/api/power-save-blocker.md | 24 +- docs-translations/ko-KR/api/process.md | 24 +- docs-translations/ko-KR/api/protocol.md | 47 +-- docs-translations/ko-KR/api/remote.md | 41 +-- docs-translations/ko-KR/api/screen.md | 18 +- docs-translations/ko-KR/api/session.md | 97 +++--- docs-translations/ko-KR/api/shell.md | 41 ++- docs-translations/ko-KR/api/synopsis.md | 10 +- docs-translations/ko-KR/api/system-preferences.md | 24 +- docs-translations/ko-KR/api/tray.md | 18 +- docs-translations/ko-KR/api/web-contents.md | 130 ++++--- docs-translations/ko-KR/api/web-frame.md | 55 ++- docs-translations/ko-KR/api/web-view-tag.md | 76 ++-- docs-translations/ko-KR/faq.md | 20 +- docs-translations/ko-KR/styleguide.md | 17 +- .../ko-KR/tutorial/application-packaging.md | 32 +- .../tutorial/desktop-environment-integration.md | 63 ++-- .../tutorial/mac-app-store-submission-guide.md | 21 +- .../ko-KR/tutorial/online-offline-events.md | 49 ++- docs-translations/ko-KR/tutorial/quick-start.md | 30 +- .../ko-KR/tutorial/using-pepper-flash-plugin.md | 4 +- .../ko-KR/tutorial/using-selenium-and-webdriver.md | 34 +- .../ko-KR/tutorial/using-widevine-cdm-plugin.md | 10 +- 37 files changed, 1014 insertions(+), 656 deletions(-) diff --git a/docs-translations/ko-KR/api/app.md b/docs-translations/ko-KR/api/app.md index 6820945..de6acc9 100644 --- a/docs-translations/ko-KR/api/app.md +++ b/docs-translations/ko-KR/api/app.md @@ -5,10 +5,10 @@ 밑의 예시는 마지막 윈도우가 종료되었을 때, 애플리케이션을 종료시키는 예시입니다: ```javascript -const {app} = require('electron'); +const {app} = require('electron') app.on('window-all-closed', () => { - app.quit(); -}); + app.quit() +}) ``` ## Events @@ -28,6 +28,10 @@ Windows, Linux 운영체제에서의 `will-finish-launching` 이벤트는 `ready ### Event: 'ready' +Returns: + +* `launchInfo` Object _macOS_ + Electron이 초기화를 끝냈을 때 발생하는 이벤트입니다. ### Event: 'window-all-closed' @@ -103,7 +107,6 @@ Returns: * `url` String 유저가 애플리케이션을 통해 URL을 열고자 할 때 발생하는 이벤트입니다. - 애플리케이션에서 URL을 열기 위해 반드시 URL 스킴이 등록되어 있어야 합니다. 이 이벤트를 처리할 땐 반드시 `event.preventDefault()`를 호출해야 합니다. @@ -197,15 +200,17 @@ Returns: 기본 동작을 방지하고 인증을 승인할 수 있습니다. ```javascript +const {app} = require('electron') + app.on('certificate-error', (event, webContents, url, error, certificate, callback) => { if (url === 'https://github.com') { // 확인 로직. - event.preventDefault(); - callback(true); + event.preventDefault() + callback(true) } else { - callback(false); + callback(false) } -}); +}) ``` ### Event: 'select-client-certificate' @@ -233,10 +238,12 @@ Returns: 것을 막습니다. ```javascript +const {app} = require('electron') + app.on('select-client-certificate', (event, webContents, url, list, callback) => { - event.preventDefault(); - callback(list[0]); -}); + event.preventDefault() + callback(list[0]) +}) ``` ### Event: 'login' @@ -264,10 +271,12 @@ Returns: `callback(username, password)` 형태의 콜백을 호출하여 인증을 처리해야 합니다. ```javascript +const {app} = require('electron') + app.on('login', (event, webContents, request, authInfo, callback) => { - event.preventDefault(); - callback('username', 'secret'); -}); + event.preventDefault() + callback('username', 'secret') +}) ``` ### Event: 'gpu-process-crashed' @@ -320,7 +329,7 @@ Chrome의 접근성 지원이 변경될 때 발생하는 이벤트입니다. 이 ### `app.relaunch([options])` * `options` Object (optional) - * `args` Array (optional) + * `args` String[] (optional) * `execPath` String (optional) 현재 인스턴스가 종료되면 애플리케이션을 재시작합니다. @@ -339,10 +348,16 @@ Chrome의 접근성 지원이 변경될 때 발생하는 이벤트입니다. 이 인스턴스의 애플리케이션을 실행하는 예시입니다: ```javascript -app.relaunch({args: process.argv.slice(1) + ['--relaunch']}) +const {app} = require('electron') + +app.relaunch({args: process.argv.slice(1).concat(['--relaunch'])}) app.exit(0) ``` +### `app.isReady()` + +Returns `Boolean` - Electron 이 초기화를 마쳤으면 `true`, 아니면 `false`. + ### `app.focus()` Linux에선, 첫 번째로 보여지는 윈도우가 포커스됩니다. macOS에선, 애플리케이션을 활성화 @@ -358,14 +373,14 @@ Linux에선, 첫 번째로 보여지는 윈도우가 포커스됩니다. macOS ### `app.getAppPath()` -현재 애플리케이션의 디렉터리를 반환합니다. +Returns `String` - 현재 애플리케이션 디렉토리. ### `app.getPath(name)` * `name` String -`name`에 관련한 특정 디렉터리 또는 파일의 경로를 반환합니다. -경로를 가져오는 데 실패할 경우 `Error`를 반환합니다. +Returns `String` -`name` 에 관련한 특정 디렉터리 또는 파일의 경로. 실패시 +`Error` 발생. **역자주:** 이 메서드는 운영체제에서 지정한 특수 디렉터리를 가져오는데 사용할 수 있습니다. @@ -379,7 +394,6 @@ Linux에선, 첫 번째로 보여지는 윈도우가 포커스됩니다. macOS * `userData` - 애플리케이션의 설정을 저장하는 디렉터리. 이 디렉터리는 기본적으로 `appData`에 애플리케이션 이름으로 생성된 폴더가 지정됩니다. * `temp` - 임시 폴더 디렉터리. -* `userDesktop` - 현재 사용자의 데스트탑 디렉터리. * `exe` - 현재 실행중인 Electron 바이너리 파일. * `module` - `libchromiumcontent` 라이브러리. * `desktop` - 사용자의 데스크탑 디렉터리. @@ -407,14 +421,13 @@ Linux에선, 첫 번째로 보여지는 윈도우가 포커스됩니다. macOS ### `app.getVersion()` -로드된 애플리케이션의 버전을 반환합니다. - -만약 `package.json` 파일에서 애플리케이션의 버전을 찾을 수 없는 경우, 현재 번들 또는 -실행 파일의 버전을 반환합니다. +Returns `String` - 로드된 애플리케이션의 버전. 만약 `package.json` 파일에서 +애플리케이션의 버전을 찾을 수 없는 경우, 현재 번들 또는 실행 파일의 버전을 +반환합니다. ### `app.getName()` -`package.json`에서 기술된 현재 애플리케이션의 이름을 반환합니다. +Returns `String` - `package.json` 에 기술된 현재 애플리케이션의 이름. npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드는 소문자 이름을 사용합니다. 하지만 Electron은 `name`대신 `productName` 필드를 주로 사용하기 때문에 @@ -429,8 +442,9 @@ npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드 ### `app.getLocale()` -현재 애플리케이션의 [로케일](https://ko.wikipedia.org/wiki/%EB%A1%9C%EC%BC%80%EC%9D%BC)을 -반환합니다. 반환될 수 있는 값은 [여기](locales.md)에서 찾아볼 수 있습니다. +Returns `String` - 현재 애플리케이션의 +[로케일](https://ko.wikipedia.org/wiki/%EB%A1%9C%EC%BC%80%EC%9D%BC). 반환될 수 +있는 값은 [여기](locales.md)에서 찾아볼 수 있습니다. **참고:** 패키징된 앱을 배포할 때, `locales` 폴더도 같이 배포해야 합니다. @@ -454,7 +468,9 @@ npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드 * `protocol` String - 프로토콜의 이름, `://` 제외. 만약 앱을 통해 `electron://`과 같은 링크를 처리하고 싶다면, 이 메서드에 `electron` 인수를 담아 호출하면 됩니다. * `path` String (optional) _Windows_ - 기본값은 `process.execPath`입니다. -* `args` Array (optional) _Windows_ - 기본값은 빈 배열입니다. +* `args` String[] (optional) _Windows_ - 기본값은 빈 배열입니다. + +Returns `Boolean` - 호출 성공 여부. 이 메서드는 지정한 프로토콜(URI scheme)에 대해 현재 실행파일을 기본 핸들러로 등록합니다. 이를 통해 운영체제와 더 가깝게 통합할 수 있습니다. 한 번 등록되면, @@ -464,8 +480,6 @@ npm 모듈 규칙에 따라 대부분의 경우 `package.json`의 `name` 필드 Windows에선 실행시에 선택적 매개변수를 통해 경로, 실행 파일, 인수, 실행 파일로 전달될 인수의 배열을 제공할 수 있습니다. -호출에 성공하면 `true`를 반환하고 그렇지 않다면 `false`를 반환합니다. - **참고:** macOS에선, 애플리케이션의 `info.plist`에 등록해둔 프로토콜만 사용할 수 있습니다. 이는 런타임에서 변경될 수 없습니다. 이 파일은 간단히 텍스트 에디터를 사용하거나, 애플리케이션을 빌드할 때 스크립트가 생성되도록 할 수 있습니다. 자세한 @@ -478,22 +492,24 @@ Windows에선 실행시에 선택적 매개변수를 통해 경로, 실행 파 ### `app.removeAsDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_ * `protocol` String - 프로토콜의 이름, `://` 제외. -* `path` String (optional) _Windows_ - Defaults to `process.execPath` -* `args` Array (optional) _Windows_ - Defaults to an empty array +* `path` String (optional) _Windows_ - 기본값은 `process.execPath` +* `args` String[] (optional) _Windows_ - 기본값은 빈 배열 + +Returns `Boolean` - 호출 성공 여부. 이 메서드는 현재 실행파일이 지정한 프로토콜(URI scheme)에 대해 기본 핸들러인지를 확인합니다. 만약 그렇다면, 이 메서드는 앱을 기본 핸들러에서 제거합니다. -호출에 성공하면 `true`를 반환하고 그렇지 않다면 `false`를 반환합니다. - ### `app.isDefaultProtocolClient(protocol[, path, args])` _macOS_ _Windows_ * `protocol` String - `://`를 제외한 프로토콜의 이름. +* `path` String (optional) _Windows_ - 기본값은 `process.execPath` +* `args` String[] (optional) _Windows_ - 기본값은 빈 배열 -이 메서드는 현재 실행 파일이 지정한 프로토콜에 대해 기본 동작인지 확인합니다. (URI -스킴) 만약 그렇다면 `true`를 반환하고 아닌 경우 `false`를 반환합니다. -* `path` String (optional) _Windows_ - Defaults to `process.execPath` -* `args` Array (optional) _Windows_ - Defaults to an empty array +Returns `Boolean` + +이 메서드는 현재 실행 파일이 지정한 프로토콜에 대해 기본 동작인지 확인합니다. +(URI 스킴) 만약 그렇다면 `true`를 반환하고 아닌 경우 `false`를 반환합니다. **참고:** macOS에선, 응용 프로그램이 프로토콜에 대한 기본 프로토콜 동작으로 등록되었는지를 확인하기 위해 이 메서드를 사용할 수 있습니다. 또한 macOS에서 @@ -512,71 +528,205 @@ Windows에서 사용할 수 있는 JumpList의 [Tasks][tasks] 카테고리에 `t `tasks`는 다음과 같은 구조를 가지는 `Task` 객체의 배열입니다: `Task` Object: + * `program` String - 실행할 프로그램의 경로. 보통 현재 작동중인 애플리케이션의 경로인 `process.execPath`를 지정합니다. * `arguments` String - `program`이 실행될 때 사용될 명령줄 인수. * `title` String - JumpList에 표시할 문자열. * `description` String - 이 작업에 대한 설명. -* `iconPath` String - JumpList에 표시될 아이콘의 절대 경로. - 아이콘을 포함하고 있는 임의의 리소스 파일을 사용할 수 있습니다. - 보통 애플리케이션의 아이콘을 그대로 사용하기 위해 `process.execPath`를 지정합니다. +* `iconPath` String - JumpList에 표시될 아이콘의 절대 경로. 아이콘을 포함하고 + 있는 임의의 리소스 파일을 사용할 수 있습니다. 보통 애플리케이션의 아이콘을 + 그대로 사용하기 위해 `process.execPath`를 지정합니다. * `iconIndex` Integer - 아이콘 파일의 인덱스. 만약 아이콘 파일이 두 개 이상의 - 아이콘을 가지고 있을 경우, 사용할 아이콘의 인덱스를 이 옵션으로 지정해 주어야 합니다. - 단, 아이콘을 하나만 포함하고 있는 경우 0을 지정하면 됩니다. + 아이콘을 가지고 있을 경우, 사용할 아이콘의 인덱스를 이 옵션으로 지정해 주어야 + 합니다. 단, 아이콘을 하나만 포함하고 있는 경우 0을 지정하면 됩니다. + +Returns `Boolean` - 호출 성공 여부. + +**참고:** 점프 목록을 커스터마이징 하려면 대신 `app.setJumpList(categories)` 를 +사용하세요. + +### `app.getJumpListSettings()` _Windows_ + +Returns `Object`: +* `minItems` Integer - 점프 목록에서 보여질 항목의 최소 수 (이 값에 대한 자세한 + 설명은 [MSDN 문서][JumpListBeginListMSDN])를 보세요. +* `removedItems` Array - 점프 목록의 사용자 정의 카테고리에서 사용자가 삭제한 + 항목에 해당하는 `JumpListItem` 객체 배열. 이 항목들은 **다음** + `app.setJumpList()` 호출로 다시 추가하면 안됩니다. 윈도우는 삭제된 항목을 + 포함하는 카테고리를 표시하지 않을 것 입니다. + +### `app.setJumpList(categories)` _Windows_ + +* `categories` Array or `null` - `JumpListCategory` 객체의 배열. + +애플리케이션에 사용자 정의 점프 목록을 설정하거나 삭제하고 다음 문자열 중 하나를 +반환: + +* `ok` - 잘못된 것이 없음. +* `error` - 하나 이상의 에러 발생. 가능성 높은 원인을 파악하기 위해 런타임 로그 + 활성화하세요. +* `invalidSeparatorError` - 점프 목록의 사용자 정의 카테고리에서 구분자 추가 + 시도. 구분자는 표준 `Tasks` 카테고리에서만 가능 합니다. +* `fileTypeRegistrationError` - 앱이 등록하지 않은 파일 유형을 점프 목록에 + 추가하려고 시도함. +* `customCategoryAccessDeniedError` - 사용자 개인 정보 보호와 그룹 정책 설정에 + 따라 점프 목록에 사용자 정의 카테고리 추가가 불가능 합니다. + +만약 `categories` 가 `null` 이면 이전 사용자 점프 목록 설정은 앱을 위한 표준 +점프 목록으로 대체됩니다 (윈도우에 의해 관리됨). + +`JumpListCategory` 객체는 다음 속성을 가져야 합니다: + +* `type` String - 다음 중 하나: + * `tasks` - 이 카테고리의 항목은 표준 `Tasks` 카테고리에 위치할 것 입니다. + 이 카테고리는 하나만 존재하며, 항상 점프 목록의 하단에 보여집니다. + * `frequent` - 앱에 의해 자주 열린 파일의 목록을 보여줍니다. 카테고리의 + 이름과 항목들은 윈도우에 읳해 설정 됩니다. + * `recent` - 앱에 의해 최근에 열린 파일의 목록을 보여줍니다. 카테고리의 + 이름과 항목들은 윈도우에 의해 설정 됩니다. `app.addRecentDocument(path)` 을 + 사용하면 간접적으로 이 카테고리에 항목이 추가될 것 입니다. + * `custom` - 작업 또는 파일 링크를 보여주며, 앱에 의해 `name` 설정되어야 합니다. +* `name` String - `type` 이 `custom` 이면 꼭 설정되어야 하고, 그 외는 생략합니다. +* `items` Array - `type` 이 `taks` 면 `JumpListItem` 객체의 배열, 그 외는 + 생략합니다. + +**참고:** `JumpListCategory` 객체가 `type`, `name` 솏속성 둘 다 없다면 `type` 은 +`tasks` 로 가정합니다. `name` 속성이 설정되었지만 `type` 속성이 생략된 경우 +`type` 은 `custom` 으로 가정합니다. + +**참고:** 사용자는 사용자 카테고리에서 항목을 삭제할 수 있습니다. 그리고 윈도우는 +`app.setJumpList(categories)` 의 다음 성공적인 호출 이후까지 삭제된 항목을 다시 +추가하는 것을 금지할 것 입니다. 그 이전에 커스텀 카테고리에 삭제된 항목을 다시 +추가하려 한다면 커스텀 카테고리가 전부 점프 목록에서 빠질 것 입니다. 제거된 항목 +목록은 `app.getJumpListSettings()` 를 사용해 얻을 수 있습니다. + +`JumpListItem` 객체는 다음 속성을 가져야 합니다: + +* `type` String - 다음 중 하나: + * `task` - 특정 인수로 앱을 실행시킬 작업. + * `separator` - 표준 `Tasks` 카테고리에서 항목을 구분할 수 있습니다. + * `file` - 점프 목록을 만든 앱을 사용하여 파일을 열 파일 링크. 이것이 + 동작하려면 그 파일 형식을 앱이 처리할 수 있게 등록되있어야 한다. (하지만, + 그것이 기본 처리기일 필요는 없습니다.). +* `path` String - 파일을 열기 위한 경로. `type` 이 `file` 경우에만 설정되어야 + 한다. +* `program` String - 실행하기 위한 프로그램의 경로. 일반적으로 현재 프로그램을 + 열기 위해 `process.execPath` 를 지정해야 합니다. +* `args` String - `program` 이 실행됐을 때의 커맨드 라인 인수. `type` 이 + `task` 일 경우만 설정되어야 한다. +* `title` String - 점프 목록에서 항목에 표시될 글자. `type` 이 `task` 일 경우만 + 설정되어야 한다. +* `description` String - 작업의 설명 (툴팁으로 표시된다). `type` 이 `task` 일 + 경우만 설정되어야 한다. +* `iconPath` String - The absolute path to an icon to be displayed in a + Jump List, which can be an arbitrary resource file that contains an icon + (e.g. `.ico`, `.exe`, `.dll`). You can usually specify `process.execPath` to + show the program icon. +* `iconIndex` Integer - 리소스 파일의 아이콘 인덱스. 리소스 파일이 여러 아이콘을 + 포함하고 있다면 이 작업을 위해 표시되어야 할 아이콘의 0 기준 인덱스를 명시할 + 수 있다. 리소스 파일이 하나의 아이콘만 가지고 있다면 이 속성은 0 이어야 한다. + +사용자 점프 목록을 생성하는 간단한 예제 입니다: -호출에 성공하면 `true`를 반환하고 그렇지 않다면 `false`를 반환합니다. +```javascript +const {app} = require('electron') + +app.setJumpList([ + { + type: 'custom', + name: 'Recent Projects', + items: [ + { type: 'file', path: 'C:\\Projects\\project1.proj' }, + { type: 'file', path: 'C:\\Projects\\project2.proj' } + ] + }, + { // has a name so `type` is assumed to be "custom" + name: 'Tools', + items: [ + { + 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, + description: 'Runs Tool B' + } + ] + }, + { type: 'frequent' }, + { // 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', + description: 'Create a new project.' + }, + { type: 'separator' }, + { + type: 'task', title: 'Recover Project', + program: process.execPath, args: '--recover-project', + description: 'Recover Project' + } + ] + } +]) +``` ### `app.makeSingleInstance(callback)` * `callback` Function -현재 애플리케이션을 **Single Instance Application** 으로 만들어줍니다. -이 메서드는 애플리케이션이 여러 번 실행됐을 때 다중 인스턴스가 생성되는 대신 한 개의 -주 인스턴스만 유지되도록 만들 수 있습니다. 이때 중복 생성된 인스턴스는 주 인스턴스에 +현재 애플리케이션을 단일 인스턴스 애플리케이션으로 만들어줍니다. 이 메서드는 +애플리케이션이 여러 번 실행됐을 때 다중 인스턴스가 생성되는 대신 한 개의 주 +인스턴스만 유지되도록 만들 수 있습니다. 이때 중복 생성된 인스턴스는 주 인스턴스에 신호를 보내고 종료됩니다. `callback`은 주 인스턴스가 생성된 이후 또 다른 인스턴스가 생성됐을 때 -`callback(argv, workingDirectory)` 형식으로 호출됩니다. `argv`는 두 번째 인스턴스의 -명령줄 인수이며 `workingDirectory`는 현재 작업중인 디렉터리입니다. 보통 대부분의 -애플리케이션은 이러한 콜백이 호출될 때 주 윈도우를 포커스하고 최소화되어있으면 창 -복구를 실행합니다. +`callback(argv, workingDirectory)` 형식으로 호출됩니다. `argv`는 두 번째 +인스턴스의 명령줄 인수이며 `workingDirectory`는 현재 작업중인 디렉터리입니다. +보통 대부분의 애플리케이션은 이러한 콜백이 호출될 때 주 윈도우를 포커스하고 +최소화되어있으면 창 복구를 실행합니다. `callback`은 `app`의 `ready` 이벤트가 발생한 후 실행됨을 보장합니다. 이 메서드는 현재 실행된 애플리케이션이 주 인스턴스인 경우 `false`를 반환하고 -애플리케이션의 로드가 계속 진행 되도록 합니다. 그리고 두 번째 중복된 인스턴스 생성인 -경우 `true`를 반환합니다. (다른 인스턴스에 인수가 전달됬을 때) 이 불리언 값을 통해 -중복 생성된 인스턴스는 즉시 종료시켜야 합니다. +애플리케이션의 로드가 계속 진행 되도록 합니다. 그리고 두 번째 중복된 인스턴스 +생성인 경우 `true`를 반환합니다. (다른 인스턴스에 인수가 전달됬을 때) 이 불리언 +값을 통해 중복 생성된 인스턴스는 즉시 종료시켜야 합니다. -macOS에선 사용자가 Finder에서 애플리케이션의 두 번째 인스턴스를 열려고 했을 때 자동으로 -**Single Instance** 화 하고 `open-file`과 `open-url` 이벤트를 발생시킵니다. 그러나 -사용자가 애플리케이션을 CLI 터미널에서 실행하면 운영체제 시스템의 싱글 인스턴스 -메커니즘이 무시되며 그대로 중복 실행됩니다. 따라서 macOS에서도 이 메서드를 통해 확실히 -중복 실행을 방지하는 것이 좋습니다. +macOS에선 사용자가 Finder에서 애플리케이션의 두 번째 인스턴스를 열려고 했을 때 +자동으로 단일 인스턴스화 하고 `open-file`과 `open-url` 이벤트를 발생시킵니다. +그러나 사용자가 애플리케이션을 CLI 터미널에서 실행하면 운영체제 시스템의 싱글 +인스턴스 메커니즘이 무시되며 그대로 중복 실행됩니다. 따라서 macOS에서도 이 +메서드를 통해 확실히 중복 실행을 방지하는 것이 좋습니다. -다음 예시는 두 번째 인스턴스가 생성되었을 때 중복된 인스턴스를 종료하고 주 애플리케이션 -인스턴스의 윈도우를 활성화 시키는 예시입니다: +다음 예시는 두 번째 인스턴스가 생성되었을 때 중복된 인스턴스를 종료하고 주 +애플리케이션 인스턴스의 윈도우를 활성화 시키는 예시입니다: ```javascript -let myWindow = null; +const {app} = require('electron') +let myWindow = null const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { // 애플리케이션을 중복 실행했습니다. 주 애플리케이션 인스턴스를 활성화 합니다. if (myWindow) { - if (myWindow.isMinimized()) myWindow.restore(); - myWindow.focus(); + if (myWindow.isMinimized()) myWindow.restore() + myWindow.focus() } - return true; -}); +}) if (shouldQuit) { - app.quit(); - return; + app.quit() } // 윈도우를 생성하고 각종 리소스를 로드하고 작업합니다. app.on('ready', () => { -}); +}) ``` ### `app.releaseSingleInstance()` @@ -592,12 +742,12 @@ app.on('ready', () => { * `webpageURL` String - 적당한 앱이 기기에 설치되지 않았을 때 브라우저에서 로드할 웹 페이지. 스킴은 반드시 `http` 또는 `https`가 되어야 합니다. -`NSUserActivity`를 만들고 현재 activity에 설정합니다. 이 activity는 이후 다른 기기와 -[Handoff][handoff]할 때 자격으로 사용됩니다. +`NSUserActivity`를 만들고 현재 activity에 설정합니다. 이 activity는 이후 다른 +기기와 [Handoff][handoff]할 때 자격으로 사용됩니다. ### `app.getCurrentActivityType()` _macOS_ -현재 작동중인 activity의 타입을 반환합니다. +Returns `String` - 현재 작동중인 activity의 타입. ### `app.setAppUserModelId(id)` _Windows_ @@ -628,8 +778,10 @@ pkcs12 형식으로된 인증서를 플랫폼 인증서 저장소로 가져옵 * `count` Integer -현재 앱에 대해 카운터 뱃지를 설정합니다. count를 `0`으로 설정하면 뱃지를 숨깁니다. -호출이 성공적으로 끝나면 `true`를 반환하고 아닌 경우 `false`를 반환합니다. +Returns `Boolean` - 호출 성공 여부. + +현재 앱에 대해 카운터 뱃지를 설정합니다. count 를 `0`으로 설정하면 뱃지를 +숨깁니다. macOS에선 독 아이콘에 표시됩니다. Linux에선 Unity 런처에서만 작동합니다. @@ -638,17 +790,51 @@ macOS에선 독 아이콘에 표시됩니다. Linux에선 Unity 런처에서만 ### `app.getBadgeCount()` _Linux_ _macOS_ -현재 카운터 뱃지에 표시중인 값을 반환합니다. +Returns `Integer` - 현재 카운터 뱃지에 표시중인 값. ### `app.isUnityRunning()` _Linux_ -현재 데스크톱 환경이 Unity인지 여부를 반환합니다. +Returns `Boolean` - 현재 데스크톱 환경이 Unity 인지 여부. + +### `app.getLoginItemSettings()` _macOS_ _Windows_ + +Returns `Object`: +* `openAtLogin` Boolean - 앱이 로그인시 열리도록 설정되어있는 경우 `true`를 반환. +* `openAsHidden` Boolean - 앱이 로구인시 숨겨진 채로 열리도록 설정되어있는 경우 + `true`를 반환. 이 설정은 macOS에서만 지원됩니다. +* `wasOpenedAtLogin` Boolean - 자동으로 로그인할 때 애플리케이션이 열려있었는지 + 여부. 이 설정은 macOS에서만 지원됩니다. +* `wasOpenedAsHidden` Boolean - 앱이 숨겨진 로그인 항목처럼 열려있었는지 여부. + 이는 앱이 시작시 어떤 윈도우도 열지 않을 것을 표시합니다. 이 설정은 macOS에서만 + 지원됩니다. +* `restoreState` Boolean - 앱이 이전 세션에서 상태를 복원하여 로그인 항목처럼 + 열려있었는지 여부. 이는 앱이 마지막으로 종료되었던 때에 열려있었던 윈도우를 + 복원하는 것을 표시합니다. 이 설정은 macOS에서만 지원됩니다. + +**참고:** 이 API 는 [MAS 빌드](docs/tutorial/mac-app-store-submission-guide.md) +에 영향을 주지 않습니다. + +### `app.setLoginItemSettings(settings)` _macOS_ _Windows_ + +* `settings` Object + * `openAtLogin` Boolean - `true`로 지정하면 로그인시 애플리케이션을 열도록 하며 + `false`로 지정시 로그인 항목에서 삭제합니다. + * `openAsHidden` Boolean - `true`로 지정하면 애플리케이션을 숨겨진 채로 열도록 + 합니다. 기본값은 `false`입니다. 사용자가 시스템 설정에서 이 설정을 변경할 수 + 있으며 앱이 열렸을 때 현재 값을 확인하려면 + `app.getLoginItemStatus().wasOpenedAsHidden`을 확인해야 합니다. 이 설정은 + macOS에서만 지원됩니다. + +앱의 로그인 항목 설정을 지정합니다. + +**참고:** 이 API 는 [MAS 빌드](docs/tutorial/mac-app-store-submission-guide.md) +에 영향을 주지 않습니다. ### `app.isAccessibilitySupportEnabled()` _macOS_ _Windows_ -`Boolean` 값을 반환하며 Chrome의 접근성 지원이 활성화되어있으면 `true`를 그렇지 -않다면 `false`를 반환합니다. 이 API는 사용할 수 있는 스크린 리더와 같은 접근성 기술이 -감지되었을 때 `true`를 반환합니다. 자세한 내용은 +Returns `Boolean` - Chrome의 접근성 지원이 활성화되어있으면 `true`를 그렇지 +않다면 `false`를 반환합니다. 이 API는 사용할 수 있는 스크린 리더와 같은 접근성 +기술이 감지되었을 때 `true`를 반환합니다. 자세한 내용은 https://www.chromium.org/developers/design-documents/accessibility 를 참고하세요. ### `app.commandLine.appendSwitch(switch[, value])` @@ -674,8 +860,8 @@ Chrominum의 명령줄에 인수를 추가합니다. 인수는 올바르게 인 * `type` String (optional) - `critical` 또는 `informational`을 지정할 수 있습니다. 기본값은 `informational` 입니다. -`critical`이 전달되면 dock 아이콘이 애플리케이션이 활성화되거나 요청이 중지되기 전까지 -통통 튀는 바운스 효과를 적용합니다. +`critical`이 전달되면 dock 아이콘이 애플리케이션이 활성화되거나 요청이 중지되기 +전까지 통통 튀는 바운스 효과를 적용합니다. `informational`이 전달되면 dock 아이콘이 1초만 통통 튑니다. 하지만 애플리케이션이 활성화되거나 요청이 중지되기 전까지 요청은 계속 활성화로 유지 됩니다. @@ -702,7 +888,7 @@ dock의 badge에 표시할 문자열을 설정합니다. ### `app.dock.getBadge()` _macOS_ -dock의 badge에 설정된 문자열을 반환합니다. +Returns `String` - dock의 badge에 설정된 문자열. ### `app.dock.hide()` _macOS_ @@ -714,7 +900,7 @@ dock 아이콘을 표시합니다. ### `app.dock.isVisible()` _macOS_ -dock 아이콘이 보이는 상태인지 여부를 반환합니다. `app.dock.show()` 호출은 +Returns `Boolean` - dock 아이콘이 보이는 상태인지 여부. `app.dock.show()` 호출은 비동기이므로 해당 메서드를 호출한 후 바로 이 메서드를 호출하면 `true`를 반환하지 않을 수 있습니다. @@ -730,35 +916,6 @@ dock 아이콘이 보이는 상태인지 여부를 반환합니다. `app.dock.sh dock 아이콘의 `image`를 설정합니다. -### `app.getLoginItemSettings()` _macOS_ _Windows_ - -앱의 로그인 항목 설정을 객체로 반환합니다. - -* `openAtLogin` Boolean - 앱이 로그인시 열리도록 설정되어있는 경우 `true`를 반환. -* `openAsHidden` Boolean - 앱이 로구인시 숨겨진 채로 열리도록 설정되어있는 경우 - `true`를 반환. 이 설정은 macOS에서만 지원됩니다. -* `wasOpenedAtLogin` Boolean - 자동으로 로그인할 때 애플리케이션이 열려있었는지 여부. - 이 설정은 macOS에서만 지원됩니다. -* `wasOpenedAsHidden` Boolean - 앱이 숨겨진 로그인 항목처럼 열려있었는지 여부. - 이는 앱이 시작시 어떤 윈도우도 열지 않을 것을 표시합니다. 이 설정은 macOS에서만 - 지원됩니다. -* `restoreState` Boolean - 앱이 이전 세션에서 상태를 복원하여 로그인 항목처럼 - 열려있었는지 여부. 이는 앱이 마지막으로 종료되었던 때에 열려있었던 윈도우를 복원하는 - 것을 표시합니다. 이 설정은 macOS에서만 지원됩니다. - -### `app.setLoginItemSettings(settings)` _macOS_ _Windows_ - -* `settings` Object - * `openAtLogin` Boolean - `true`로 지정하면 로그인시 애플리케이션을 열도록 하며 - `false`로 지정시 로그인 항목에서 삭제합니다. - * `openAsHidden` Boolean - `true`로 지정하면 애플리케이션을 숨겨진 채로 열도록 - 합니다. 기본값은 `false`입니다. 사용자가 시스템 설정에서 이 설정을 변경할 수 - 있으며 앱이 열렸을 때 현재 값을 확인하려면 - `app.getLoginItemStatus().wasOpenedAsHidden`을 확인해야 합니다. 이 설정은 - macOS에서만 지원됩니다. - -앱의 로그인 항목 설정을 지정합니다. - [dock-menu]:https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/customizing_docktile/concepts/dockconcepts.html#//apple_ref/doc/uid/TP30000986-CH2-TPXREF103 [tasks]:http://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks [app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx @@ -767,3 +924,4 @@ dock 아이콘의 `image`를 설정합니다. [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 [unity-requiremnt]: ../tutorial/desktop-environment-integration.md#unity-launcher-shortcuts-linux +[JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx diff --git a/docs-translations/ko-KR/api/auto-updater.md b/docs-translations/ko-KR/api/auto-updater.md index 06ff1fa..02e8eae 100644 --- a/docs-translations/ko-KR/api/auto-updater.md +++ b/docs-translations/ko-KR/api/auto-updater.md @@ -106,7 +106,7 @@ Returns: ### `autoUpdater.getFeedURL()` -현재 업데이트 피드 URL을 반환합니다. +Returns `String` - 현재 업데이트 피드 URL. ### `autoUpdater.checkForUpdates()` diff --git a/docs-translations/ko-KR/api/browser-window.md b/docs-translations/ko-KR/api/browser-window.md index 0f0b672..9cc8509 100644 --- a/docs-translations/ko-KR/api/browser-window.md +++ b/docs-translations/ko-KR/api/browser-window.md @@ -2,18 +2,16 @@ > 브라우저 윈도우를 생성하고 제어합니다. -다음 예시는 윈도우를 생성합니다: - ```javascript // 메인 프로세스에서 const {BrowserWindow} = require('electron') // 또는 렌더러 프로세스에서 -const {BrowserWindow} = require('electron').remote +// const {BrowserWindow} = require('electron').remote let win = new BrowserWindow({width: 800, height: 600}) win.on('closed', () => { - win = null; + win = null }) // 원격 URL 로드 @@ -41,6 +39,7 @@ Frameless 윈도우를 만들거나 일정한 모양의 투명한 윈도우를 수 있습니다. ```javascript +const {BrowserWindow} = require('electron') let win = new BrowserWindow({show: false}) win.once('ready-to-show', () => { win.show() @@ -59,6 +58,8 @@ win.once('ready-to-show', () => { 통해 설정합니다: ```javascript +const {BrowserWindow} = require('electron') + let win = new BrowserWindow({backgroundColor: '#2e2c29'}) win.loadURL('https://github.com') ``` @@ -71,8 +72,12 @@ win.loadURL('https://github.com') `parent` 옵션을 사용하면 자식 윈도우를 만들 수 있습니다: ```javascript +const {BrowserWindow} = require('electron') + let top = new BrowserWindow() let child = new BrowserWindow({parent: top}) +child.show() +top.show() ``` `child` 윈도우는 언제나 `top` 윈도우의 상위에 표시됩니다. @@ -82,6 +87,8 @@ let child = new BrowserWindow({parent: top}) 모달 윈도우는 부모 윈도우를 비활성화 시키는 자식 윈도우입니다. 모달 윈도우를 만드려면 `parent`, `modal` 옵션을 동시에 설정해야 합니다: ```javascript +const {BrowserWindow} = require('electron') + let child = new BrowserWindow({parent: top, modal: true, show: false}) child.loadURL('https://github.com') child.once('ready-to-show', () => { @@ -315,14 +322,14 @@ Electron에선 `undefined`가 아닌 이외의 값을 전달할 경우 윈도우 ```javascript window.onbeforeunload = (e) => { - console.log('I do not want to be closed'); + console.log('I do not want to be closed') // 일반적인 브라우저와는 달리 사용자에게 확인 창을 보여주지 않고, non-void 값을 반환하면 // 조용히 닫기를 취소합니다. // Dialog API를 통해 사용자가 애플리케이션을 종료할지 정할 수 있도록 확인 창을 표시하는 것을 // 추천합니다. - e.returnValue = false; -}; + e.returnValue = false +} ``` #### Event: 'closed' @@ -422,12 +429,14 @@ Returns: e.g. `APPCOMMAND_BROWSER_BACKWARD` 는 `browser-backward`와 같이 반환됩니다. ```javascript -someWindow.on('app-command', (e, cmd) => { - // 마우스의 뒤로가기 버튼을 눌렀을 때 뒤로가기 탐색을 실행합니다 - if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) { - someWindow.webContents.goBack(); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() +win.on('app-command', (e, cmd) => { + // Navigate the window back when the user hits their mouse back button + if (cmd === 'browser-backward' && win.webContents.canGoBack()) { + win.webContents.goBack() } -}); +}) ``` #### Event: 'scroll-touch-begin' _macOS_ @@ -458,24 +467,23 @@ Returns: #### `BrowserWindow.getAllWindows()` -열려있는 모든 브라우저 윈도우의 배열을 반환합니다. +Returns `BrowserWindow[]` - 열려있는 모든 브라우저 윈도우의 배열. #### `BrowserWindow.getFocusedWindow()` -애플리케이션에서 포커스된 윈도우를 반환합니다. 포커스된 윈도우가 없을 경우 `null`을 -반환합니다. +Returns `BrowserWindow` - 애플리케이션에서 포커스된 윈도우. 없을 경우 `null`. #### `BrowserWindow.fromWebContents(webContents)` * `webContents` [WebContents](web-contents.md) -`webContents`를 소유하고 있는 윈도우를 찾습니다. +Returns `BrowserWindow` - `webContents` 를 소유한 윈도우. #### `BrowserWindow.fromId(id)` * `id` Integer -ID에 해당하는 윈도우를 찾습니다. +Returns `BrowserWindow` - `id` 에 해당하는 윈도우. #### `BrowserWindow.addDevToolsExtension(path)` @@ -499,13 +507,16 @@ ID에 해당하는 윈도우를 찾습니다. #### `BrowserWindow.getDevToolsExtensions()` -키는 확장 기능 이름을 값은 `name`과 `version` 속성을 포함하는 객체를 가지는 객체를 -반환합니다. +Returns `Object` - 키는 확장 기능 이름을 값은 `name`과 `version` 속성을 포함하는 +객체를 가집니다. 개발자 도구 확장 기능이 설치되었는지 확인하려면 다음과 같이 실행할 수 있습니다: ```javascript +const {BrowserWindow} = require('electron') + let installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron') +console.log(installed) ``` **참고:** 이 API는 `app` 모듈의 `ready` 이벤트가 발생하기 전까지 사용할 수 없습니다. @@ -515,8 +526,10 @@ let installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron') `new BrowserWindow`로 생성한 객체는 다음과 같은 속성을 가지고 있습니다: ```javascript +const {BrowserWindow} = require('electron') // `win`은 BrowserWindow의 인스턴스입니다 -let win = new BrowserWindow({width: 800, height: 600}); +let win = new BrowserWindow({width: 800, height: 600}) +win.loadURL('https://github.com') ``` #### `win.webContents` @@ -529,7 +542,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.id` -윈도우의 유일 ID입니다. +`Integer` 형식의 윈도우 고유 ID 입니다. ### Instance Methods @@ -559,11 +572,11 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isFocused()` -윈도우가 포커스되었는지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 포커스되었는지 여부. #### `win.isDestroyed()` -윈도우가 소멸되었는지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 소멸되었는지 여부. #### `win.show()` @@ -579,11 +592,11 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isVisible()` -윈도우가 사용자에게 표시되고 있는지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 사용자에게 표시되고 있는지 여부. #### `win.isModal()` -현재 윈도우가 모달 윈도우인지 여부를 반환합니다. +Returns `Boolean` - 현재 윈도우가 모달 윈도우인지 여부. #### `win.maximize()` @@ -595,7 +608,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isMaximized()` -윈도우가 최대화 되어있는지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 최대화 되어있는지 여부. #### `win.minimize()` @@ -607,7 +620,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isMinimized()` -윈도우가 최소화되었는지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 최소화되었는지 여부. #### `win.setFullScreen(flag)` @@ -617,7 +630,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isFullScreen()` -윈도우가 전체화면 모드 상태인지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 전체화면 모드인지 여부. #### `win.setAspectRatio(aspectRatio[, extraSize])` _macOS_ @@ -653,10 +666,20 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getBounds()` -윈도우의 width, height, x, y 값을 가지는 객체를 반환합니다. +Returns `Object`: +* `width` Integer +* `height` Integer +* `x` Integer +* `y` Integer #### `win.getContentBounds()` +Returns `Object`: +* `width` Integer +* `height` Integer +* `x` Integer +* `y` Integer + 윈도우의 클라이언트 영역 (웹 페이지)의 너비, 높이, x, y 값을 포함하는 객체를 반환합니다. @@ -670,7 +693,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getSize()` -윈도우의 너비, 높이값을 가지는 배열을 반환합니다. +Returns `Integer[]` - 윈도우의 너비, 높이를 포함. #### `win.setContentSize(width, height[, animate])` @@ -682,7 +705,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getContentSize()` -윈도우 클라이언트 영역의 너비, 높이 크기를 배열로 반환합니다. +Returns `Integer[]` - 윈도우 내부 영역의 너비, 높이를 포함. #### `win.setMinimumSize(width, height)` @@ -693,7 +716,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getMinimumSize()` -윈도우의 최소 너비, 높이 크기를 배열로 반환합니다. +Returns `Integer[]` - 윈도우의 최소 너비, 높이를 포함. #### `win.setMaximumSize(width, height)` @@ -704,7 +727,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getMaximumSize()` -윈도우의 최대 너비, 높이 크기를 배열로 반환합니다. +Returns `Integer[]` - 윈도우의 최대 너비, 높이를 포함. #### `win.setResizable(resizable)` @@ -714,7 +737,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isResizable()` -사용자에 의해 윈도우의 크기가 재조정될 수 있는지 여부를 반환합니다. +Returns `Boolean` - 사용자에 의해 윈도우의 크기가 재조정될 수 있는지 여부. #### `win.setMovable(movable)` _macOS_ _Windows_ @@ -725,8 +748,9 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isMovable()` _macOS_ _Windows_ -사용자에 의해 윈도우를 이동시킬 수 있는지 여부를 반환합니다. Linux에선 항상 `true`를 -반환합니다. +Returns `Boolean` - 사용자에 의해 윈도우를 이동시킬 수 있는지 여부. + +Linux에선 항상 `true`를 반환합니다. #### `win.setMinimizable(minimizable)` _macOS_ _Windows_ @@ -737,8 +761,9 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isMinimizable()` _macOS_ _Windows_ -사용자에 의해 윈도우를 최소화시킬 수 있는지 여부를 반환합니다. Linux에선 항상 `true`를 -반환합니다. +Returns `Boolean` - 사용자에 의해 윈도우를 최소화시킬 수 있는지 여부. + +Linux에선 항상 `true`를 반환합니다. #### `win.setMaximizable(maximizable)` _macOS_ _Windows_ @@ -749,8 +774,9 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isMaximizable()` _macOS_ _Windows_ -사용자에 의해 윈도우를 최대화시킬 수 있는지 여부를 반환합니다. Linux에선 항상 `true`를 -반환합니다. +Returns `Boolean` - 사용자에 의해 윈도우를 최대화시킬 수 있는지 여부. + +Linux에선 항상 `true`를 반환합니다. #### `win.setFullScreenable(fullscreenable)` @@ -761,8 +787,8 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isFullScreenable()` -최대화/줌 버튼이 전체화면 모드 또는 윈도우 최대화를 토글할 수 있게 할지 여부를 -반환합니다. +Returns `Boolean` - 최대화/줌 버튼이 전체화면 모드 또는 윈도우 최대화를 토글할 +수 있는지 여부. #### `win.setClosable(closable)` _macOS_ _Windows_ @@ -773,12 +799,17 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.isClosable()` _macOS_ _Windows_ -사용자에 의해 윈도우가 수동적으로 닫힐 수 있는지 여부를 반환합니다. Linux에선 항상 -`true`를 반환합니다. +Returns `Boolean` - 사용자에 의해 윈도우가 수동적으로 닫힐 수 있는지 여부. + +Linux에선 항상 `true`를 반환합니다. -#### `win.setAlwaysOnTop(flag)` +#### `win.setAlwaysOnTop(flag[, level])` * `flag` Boolean +* `level` String (optional) _macOS_ - 이 값은 `normal`, `floating`, + `torn-off-menu`, `modal-panel`, `main-menu`, `status`, `pop-up-menu`, + `screen-saver`, `dock` 을 포함합니다. 기본값은 `floating` 입니다. 자세한 + 내용은 [macOS 문서][window-levels] 를 보세요. 윈도우가 언제나 다른 윈도우들 위에 표시되는지 여부를 지정합니다. 이 설정을 활성화 하면 윈도우는 포커스 될 수 없는 툴박스 윈도우가 아닌 일반 윈도우로 유지됩니다. @@ -801,7 +832,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getPosition()` -윈도우의 위치를 배열로 반환합니다. +Returns `Integer[]` - 윈도우의 현재 위치. #### `win.setTitle(title)` @@ -811,7 +842,7 @@ let win = new BrowserWindow({width: 800, height: 600}); #### `win.getTitle()` -윈도우의 제목을 반환합니다. +Returns `String` - 네이티브 윈도우의 제목. **참고:** 웹 페이지의 제목과 네이티브 윈도우의 제목은 서로 다를 수 있습니다. @@ -825,8 +856,11 @@ macOS에서 시트를 부착할 위치를 지정합니다. 기본적으로 시 표시하기 위해 사용할 것입니다: ```javascript -let toolbarRect = document.getElementById('toolbar').getBoundingClientRect(); -win.setSheetOffset(toolbarRect.height); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() + +let toolbarRect = document.getElementById('toolbar').getBoundingClientRect() +win.setSheetOffset(toolbarRect.height) ``` #### `win.flashFrame(flag)` @@ -849,11 +883,11 @@ Kiosk(키오스크) 모드를 설정합니다. #### `win.isKiosk()` -현재 윈도우가 kiosk 모드인지 여부를 반환합니다. +Returns `Boolean' - 현재 윈도우가 kiosk 모드인지 여부. #### `win.getNativeWindowHandle()` -`Buffer` 상의 플랫폼에 따른 윈도우 핸들을 반환합니다. +Returns `Buffer` - 플랫폼 별 윈도우의 핸들. 핸들의 타입에 따라 적절히 캐스팅됩니다. Windows의 `HWND`, macOS의 `NSView*`, Linux의 `Window` (`unsigned long`)를 예로 들 수 있습니다. @@ -870,7 +904,7 @@ Windows 메시지 훅을 등록합니다. `callback`은 WndProc에서 메시지 * `message` Integer -지정한 메시지가 후킹됬는지 여부를 반환합니다. +Returns `Boolean` - 지정한 메시지가 후킹됐는지에 따라 `true` 또는 `false`. #### `win.unhookWindowMessage(message)` _Windows_ @@ -890,7 +924,7 @@ Windows 메시지 훅을 등록합니다. `callback`은 WndProc에서 메시지 #### `win.getRepresentedFilename()` _macOS_ -윈도우 대표 파일의 경로명을 반환합니다. +Returns `String` - 윈도우 대표 파일의 경로. #### `win.setDocumentEdited(edited)` _macOS_ @@ -901,7 +935,7 @@ Windows 메시지 훅을 등록합니다. `callback`은 WndProc에서 메시지 #### `win.isDocumentEdited()` _macOS_ -윈도우의 문서가 변경되었는지 여부를 반환합니다. +Returns `Boolean` - 윈도우의 문서가 변경되었는지 여부. #### `win.focusOnWebView()` @@ -995,8 +1029,9 @@ Windows에선 모드를 전달할 수 있습니다. 사용할 수 있는 값은 #### `win.hasShadow()` _macOS_ -윈도우가 그림자를 가지고 있는지 여부를 반환합니다. Windows와 Linux에선 항상 `true`를 -반환합니다. +Returns `Boolean` - 윈도우가 그림자를 가지고 있는지 여부. + +Windows와 Linux에선 항상 `true`를 반환합니다. #### `win.setThumbarButtons(buttons)` _Windows_ @@ -1014,19 +1049,22 @@ Windows에선 모드를 전달할 수 있습니다. 사용할 수 있는 값은 * `Button` 객체 * `icon` [NativeImage](native-image.md) - 미리보기 툴바에 보여질 아이콘. + * `click` Function * `tooltip` String (optional) - 버튼의 툴팁 텍스트. - * `flags` Array (optional) - 버튼의 특정 동작 및 상태 제어. 기본적으로 `enabled`이 - 사용됩니다. 이 속성은 다음 문자열들을 포함할 수 있습니다: - * `enabled` - 사용자가 사용할 수 있도록 버튼이 활성화 됩니다. - * `disabled` - 버튼이 비활성화 됩니다. 버튼은 표시되지만 시각적인 상태는 사용자의 - 동작에 응답하지 않는 비활성화 상태로 표시됩니다. - * `dismissonclick` - 버튼이 클릭되면 작업표시줄 버튼의 미리보기(flyout)가 즉시 - 종료됩니다. - * `nobackground` - 버튼의 테두리를 표시하지 않습니다. 이미지에만 사용할 수 있습니다. - * `hidden` - 버튼을 사용자에게 표시되지 않도록 숨깁니다. - * `noninteractive` - 버튼은 활성화되어 있지만 반응이 제거되며 버튼을 눌러도 - 눌려지지 않은 상태를 유지합니다. 이 값은 버튼을 알림의 용도로 사용하기 위해 - 만들어졌습니다. + * `flags` String[] (optional) - 버튼의 특정 동작 및 상태 제어. 기본적으로 `enabled`이 + 사용됩니다. + +`flags` 는 다음 `String` 들을 포함할 수 있는 배열입니다: +* `enabled` - 사용자가 사용할 수 있도록 버튼이 활성화 됩니다. +* `disabled` - 버튼이 비활성화 됩니다. 버튼은 표시되지만 시각적인 상태는 사용자의 + 동작에 응답하지 않는 비활성화 상태로 표시됩니다. +* `dismissonclick` - 버튼이 클릭되면 작업표시줄 버튼의 미리보기(flyout)가 즉시 + 종료됩니다. +* `nobackground` - 버튼의 테두리를 표시하지 않습니다. 이미지에만 사용할 수 있습니다. +* `hidden` - 버튼을 사용자에게 표시되지 않도록 숨깁니다. +* `noninteractive` - 버튼은 활성화되어 있지만 반응이 제거되며 버튼을 눌러도 + 눌려지지 않은 상태를 유지합니다. 이 값은 버튼을 알림의 용도로 사용하기 위해 + 만들어졌습니다. #### `win.setThumbnailClip(region)` _Windows_ @@ -1068,7 +1106,7 @@ Windows에선 모드를 전달할 수 있습니다. 사용할 수 있는 값은 #### `win.isMenuBarAutoHide()` -메뉴 막대 자동 숨김 상태인지 여부를 반환합니다. +Returns `Boolean` - 메뉴 막대 자동 숨김 상태 여부. #### `win.setMenuBarVisibility(visible)` @@ -1082,7 +1120,7 @@ Windows에선 모드를 전달할 수 있습니다. 사용할 수 있는 값은 #### `win.isMenuBarVisible()` -메뉴 막대가 표시되고 있는지 여부를 반환합니다. +Returns `Boolean` - 메뉴 막대가 표시되고 있는지 여부. #### `win.setVisibleOnAllWorkspaces(visible)` @@ -1094,7 +1132,7 @@ Windows에선 모드를 전달할 수 있습니다. 사용할 수 있는 값은 #### `win.isVisibleOnAllWorkspaces()` -윈도우가 모든 워크스페이스에서 표시될지 여부를 반환합니다. +Returns `Boolean` - 윈도우가 모든 워크스페이스에서 표시될지 여부. **참고:** 이 API는 Windows에서 언제나 false를 반환합니다. @@ -1125,16 +1163,17 @@ Windows에선 `WDA_MONITOR`와 함께 SetWindowDisplayAffinity를 호출합니 #### `win.setParentWindow(parent)` _Linux_ _macOS_ * `parent` BrowserWindow - +` `parent` 인수를 현재 윈도우의 부모 윈도우로 설정합니다. `null`로 설정하면 현재 윈도우를 상위 윈도우로 전환합니다. #### `win.getParentWindow()` -모든 부모 윈도우를 반환합니다. +Returns `BrowserWindow` - 부모 윈도우. #### `win.getChildWindows()` -모든 자식 윈도우를 반환합니다. +Returns `BrowserWindow[]` - 모든 자식 윈도우. [blink-feature-string]: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +[window-levels]: https://developer.apple.com/reference/appkit/nswindow/1664726-window_levels 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 9a30673..526f3e6 100644 --- a/docs-translations/ko-KR/api/chrome-command-line-switches.md +++ b/docs-translations/ko-KR/api/chrome-command-line-switches.md @@ -1,4 +1,4 @@ -# 크롬 명령줄 스위치 지원 +# 크롬 명령줄 스위치 지원 > Electron에서 지원하는 커맨드 명령줄 스위치입니다. @@ -7,13 +7,13 @@ 명령줄 옵션을 추가로 지정할 수 있습니다: ```javascript -const {app} = require('electron'); -app.commandLine.appendSwitch('remote-debugging-port', '8315'); -app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); +const {app} = require('electron') +app.commandLine.appendSwitch('remote-debugging-port', '8315') +app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1') app.on('ready', () => { // Your code here -}); +}) ``` ## --ignore-connections-limit=`domains` @@ -58,7 +58,7 @@ Electron이 세미콜론으로 구분된 호스트 리스트에서 지정한 프 예시: ```javascript -app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com;1.2.3.4:5678'); +app.commandLine.appendSwitch('proxy-bypass-list', ';*.google.com;*foo.com;1.2.3.4:5678') ``` 위 예시는 로컬 주소(`localhost`, `127.0.0.1`, 등)와 `google.com`의 서브도메인, diff --git a/docs-translations/ko-KR/api/clipboard.md b/docs-translations/ko-KR/api/clipboard.md index c94cb7e..46baa71 100644 --- a/docs-translations/ko-KR/api/clipboard.md +++ b/docs-translations/ko-KR/api/clipboard.md @@ -5,16 +5,17 @@ 다음 예시는 클립보드에 문자열을 쓰는 방법을 보여줍니다: ```javascript -const {clipboard} = require('electron'); -clipboard.writeText('Example String'); +const {clipboard} = require('electron') +clipboard.writeText('Example String') ``` X Window 시스템에선 selection 클립보드도 존재합니다. 이를 사용하려면 인수 뒤에 `selection` 문자열을 같이 지정해주어야 합니다: ```javascript -clipboard.writeText('Example String', 'selection'); -console.log(clipboard.readText('selection')); +const {clipboard} = require('electron') +clipboard.writeText('Example String', 'selection') +console.log(clipboard.readText('selection')) ``` ## Methods @@ -28,7 +29,7 @@ console.log(clipboard.readText('selection')); * `type` String (optional) -클립보드 콘텐츠를 `plain text`로 반환합니다. +Returns `String` - 일반 텍스트 형식의 클립보드의 내용. ### `clipboard.writeText(text[, type])` @@ -41,7 +42,7 @@ console.log(clipboard.readText('selection')); * `type` String (optional) -클립보드 콘텐츠를 `markup`으로 반환합니다. +returns `String` - 마크업 형식의 클립보드의 내용. ### `clipboard.writeHTML(markup[, type])` @@ -54,7 +55,7 @@ console.log(clipboard.readText('selection')); * `type` String (optional) -클립보드로부터 [NativeImage](native-image.md)로 이미지를 읽어들입니다. +Returns `NativeImage` - [NativeImage](native-image.md) 형식의 클립보드의 내용. ### `clipboard.writeImage(image[, type])` @@ -67,7 +68,7 @@ console.log(clipboard.readText('selection')); * `type` String (optional) -클립보드로부터 RTF 형식으로 콘텐츠를 읽어옵니다. +Returns `String` - RTF 형식의 클립보드 내용. ### `clipboard.writeRTF(text[, type])` @@ -78,6 +79,10 @@ console.log(clipboard.readText('selection')); ### `clipboard.readBookmark()` _macOS_ _Windows_ +Returns `Object`: +* `title` String +* `url` String + 클립보드로부터 북마크 형식으로 표현된 `title`와 `url` 키를 담은 객체를 반환합니다. `title`과 `url` 값들은 북마크를 사용할 수 없을 때 빈 문자열을 포함합니다. @@ -105,19 +110,20 @@ clipboard.write({ 클립보드에 저장된 모든 콘텐츠를 삭제합니다. -### clipboard.availableFormats([type]) +### `clipboard.availableFormats([type])` -클립보드의 `type`에 해당하는 지원하는 `format`을 문자열로 반환합니다. +Return `String[]` - 클립보드 `type` 에 지원되는 형식의 배열. ### `clipboard.has(data[, type])` * `data` String * `type` String (optional) -클립보드가 지정한 `data`의 형식을 지원하는지 확인합니다. +Returns `Boolean` - 클립보드가 지정한 `data` 의 형식을 지원하는지 여부. ```javascript -console.log(clipboard.has('

selection

')); +const {clipboard} = require('electron') +console.log(clipboard.has('

selection

')) ``` ### `clipboard.read(data[, type])` _Experimental_ @@ -125,7 +131,7 @@ console.log(clipboard.has('

selection

')); * `data` String * `type` String (optional) -클립보드로부터 `data`를 읽어들입니다. +Returns `String` - 클립보드로부터 `data`를 읽습니다. ### `clipboard.write(data[, type])` _Experimental_ @@ -138,7 +144,8 @@ console.log(clipboard.has('

selection

')); * `type` String (optional) ```javascript -clipboard.write({text: 'test', html: 'test'}); +const {clipboard} = require('electron') +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 57ef519..53a7c08 100644 --- a/docs-translations/ko-KR/api/content-tracing.md +++ b/docs-translations/ko-KR/api/content-tracing.md @@ -1,4 +1,4 @@ -# contentTracing +# contentTracing > 성능상의 병목 현상과 느린 작업을 찾기 위해 Chromium의 콘텐츠 모듈에서 추적 데이터를 수집합니다. @@ -7,22 +7,22 @@ `chrome://tracing/` 페이지를 열고 생성된 파일을 로드하면 결과를 볼 수 있습니다. ```javascript -const {contentTracing} = require('electron'); +const {contentTracing} = require('electron') const options = { categoryFilter: '*', traceOptions: 'record-until-full,enable-sampling' -}; +} contentTracing.startRecording(options, () => { - console.log('Tracing started'); + console.log('Tracing started') setTimeout(() => { contentTracing.stopRecording('', (path) => { - console.log('Tracing data recorded to ' + path); - }); - }, 5000); -}); + console.log('Tracing data recorded to ' + path) + }) + }, 5000) +}) ``` ## Methods diff --git a/docs-translations/ko-KR/api/crash-reporter.md b/docs-translations/ko-KR/api/crash-reporter.md index 4f9058a..530f0c5 100644 --- a/docs-translations/ko-KR/api/crash-reporter.md +++ b/docs-translations/ko-KR/api/crash-reporter.md @@ -1,18 +1,18 @@ -# crashReporter +# crashReporter > 원격 서버에 크래시 정보를 보고합니다. 다음 예시는 윈격 서버에 애플리케이션 크래시 정보를 자동으로 보고하는 예시입니다: ```javascript -const {crashReporter} = require('electron'); +const {crashReporter} = require('electron') crashReporter.start({ productName: 'YourName', companyName: 'YourCompany', submitURL: 'https://your-domain.com/url-to-submit', autoSubmit: true -}); +}) ``` 서버가 크래시 리포트를 받을 수 있도록 설정하기 위해 다음과 같은 프로젝트를 사용할 수도 @@ -46,11 +46,19 @@ crashReporter.start({ ### `crashReporter.getLastCrashReport()` +Returns `Object`: +* `date` String +* `ID` Integer + 마지막 크래시 리포트의 날짜와 ID를 반환합니다. 이전 크래시 리포트가 없거나 Crash Reporter가 시작되지 않았을 경우 `null`이 반환됩니다. ### `crashReporter.getUploadedReports()` +Returns `Object[]`: +* `date` String +* `ID` Integer + 모든 업로드된 크래시 리포트를 반환합니다. 각 보고는 날짜와 업로드 ID를 포함하고 있습니다. ## crash-reporter 업로드 형식 diff --git a/docs-translations/ko-KR/api/dialog.md b/docs-translations/ko-KR/api/dialog.md index df7983e..57ed7fb 100644 --- a/docs-translations/ko-KR/api/dialog.md +++ b/docs-translations/ko-KR/api/dialog.md @@ -1,20 +1,20 @@ -# dialog +# dialog > 파일을 열거나 저장하고, 알림을 표시하기 위한 네이티브 시스템 대화 상자를 표시합니다. 다음 예시는 파일과 디렉터리를 다중으로 선택하는 대화 상자를 표시하는 예시입니다: ```javascript -let win = ...; // 대화 상자를 사용할 BrowserWindow 객체 -const {dialog} = require('electron'); -console.log(dialog.showOpenDialog({properties: ['openFile', 'openDirectory', 'multiSelections']})); +const {dialog} = require('electron') +console.log(dialog.showOpenDialog({properties: ['openFile', 'openDirectory', 'multiSelections']})) ``` 대화 상자는 Electron의 메인 스레드에서 열립니다. 만약 렌더러 프로세스에서 대화 상자 객체를 사용하고 싶다면, `remote`를 통해 접근하는 방법을 고려해야 합니다: ```javascript -const {dialog} = require('electron').remote; +const {dialog} = require('electron').remote +console.log(dialog) ``` ## Methods @@ -29,8 +29,8 @@ const {dialog} = require('electron').remote; * `defaultPath` String * `buttonLabel` String - 확인 버튼을 위한 커스텀 라벨이며, 빈칸으로 둘 경우 기본 라벨이 사용됩니다. - * `filters` Array - * `properties` Array - 대화 상자가 사용할 기능(모드)이 담긴 배열입니다. + * `filters` String[] + * `properties` String[] - 대화 상자가 사용할 기능(모드)이 담긴 배열입니다. 다음을 포함할 수 있습니다: `openFile`, `openDirectory`, `multiSelections`, `createDirectory`, `showHiddenFiles`. * `callback` Function (optional) @@ -75,7 +75,7 @@ const {dialog} = require('electron').remote; * `defaultPath` String * `buttonLabel` String - 확인 버튼을 위한 커스텀 라벨이며, 빈칸으로 둘 경우 기본 라벨이 사용됩니다. - * `filters` Array + * `filters` String[] * `callback` Function (optional) 작업에 성공하면 콜백으로 유저가 선택한 파일의 경로를 포함한 배열을 반환합니다. 그 외엔 @@ -94,7 +94,7 @@ const {dialog} = require('electron').remote; * `type` String - `"none"`, `"info"`, `"error"`, `"question"`, `"warning"` 중 하나를 사용할 수 있습니다. Windows에선 따로 `icon`을 설정하지 않은 이상 "question"과 "info"는 같은 아이콘으로 표시됩니다. - * `buttons` Array - 버튼들의 라벨을 포함한 배열입니다. Windows에서 빈 배열로 둘 + * `buttons` String[] - 버튼들의 라벨을 포함한 배열입니다. Windows에서 빈 배열로 둘 경우, "OK" 버튼 하나가 포함됩니다. * `defaultId` Integer - 메시지 박스가 열렸을 때 기본적으로 선택될 버튼 배열의 버튼 인덱스입니다. diff --git a/docs-translations/ko-KR/api/download-item.md b/docs-translations/ko-KR/api/download-item.md index 921a62e..f51aee1 100644 --- a/docs-translations/ko-KR/api/download-item.md +++ b/docs-translations/ko-KR/api/download-item.md @@ -80,7 +80,7 @@ Returns: ### `downloadItem.getSavePath()` -다운로드 아이템의 저장 경로를 반환합니다. 이 경로는 +Returns `String` - 다운로드 아이템의 저장 경로. 이 경로는 `downloadItem.setSavePath(path)`로 설정된 경로나 나타난 저장 대화상자에서 선택한 경로 중 하나가 될 수 있습니다. @@ -90,7 +90,7 @@ Returns: ### `downloadItem.isPaused()` -다운로드가 일시 중지되었는지 여부를 반환합니다. +Returns `Boolean` - 다운로드가 일시 중지되었는지 여부. ### `downloadItem.resume()` @@ -98,7 +98,7 @@ Returns: ### `downloadItem.canResume()` -다운로드를 재개할 수 있는지 여부를 반환합니다. +Returns `Boolean` - 다운로드를 재개할 수 있는지 여부. ### `downloadItem.cancel()` @@ -106,19 +106,19 @@ Returns: ### `downloadItem.getURL()` -다운로드 아이템의 URL을 표현하는 문자열을 반환합니다. +Returns `String` - 아이템을 다운로드 한 URL. ### `downloadItem.getMimeType()` -다우로드 아이템의 MIME 타입을 표현하는 문자열을 반환합니다. +Returns `String` - 파일의 MIME 타입. ### `downloadItem.hasUserGesture()` -현재 다운로드가 유저 제스쳐(작업)로인한 다운로드인지 여부를 반환합니다. +Returns `Boolean` - 유저 제스쳐(작업)로인한 다운로드인지 여부. ### `downloadItem.getFilename()` -다운로드 아이템의 파일 이름을 표현하는 문자열을 반환합니다. +Returns `String` - 다운로드 아이템의 파일 이름. **참고:** 실제 파일 이름과 로컬 디스크에 저장되는 파일의 이름은 서로 다를 수 있습니다. 예를 들어 만약 사용자가 파일을 저장할 때 파일 이름을 바꿨다면 실제 파일 이름과 저장 @@ -126,20 +126,20 @@ Returns: ### `downloadItem.getTotalBytes()` -현재 아이템의 전체 다운로드 크기를 정수로 반환합니다. 크기가 unknown이면 0을 -반환합니다. +Returns `Integer` - 다운로드 아이템의 바이트 단위의 전체 크기. 크기를 알 수 +없으면 0. ### `downloadItem.getReceivedBytes()` -현재 아이템의 다운로드 완료된 바이트 값을 정수로 반환합니다. +Returns `Integer` - 다운로드 아이템의 수신된 바이트. ### `downloadItem.getContentDisposition()` -응답 헤더에서 Content-Disposition 필드를 문자열로 반환합니다. +Return `String` - 응답 헤더의 Content-Disposition 필드. ### `downloadItem.getState()` -현재 상태를 `String` 타입으로 가져옵니다. +Return `String` - 현재 상태. 값은 다음이 될 수 있습니다: diff --git a/docs-translations/ko-KR/api/global-shortcut.md b/docs-translations/ko-KR/api/global-shortcut.md index 0fe84ef..ffd895d 100644 --- a/docs-translations/ko-KR/api/global-shortcut.md +++ b/docs-translations/ko-KR/api/global-shortcut.md @@ -1,4 +1,4 @@ -# globalSortcut +# globalSortcut > 애플리케이션에 키보드 포커스가 없을 때도 키보드 이벤트를 받을 수 있도록 합니다. @@ -11,29 +11,29 @@ 사용할 수 없습니다. ```javascript -const {app, globalShortcut} = require('electron'); +const {app, globalShortcut} = require('electron') app.on('ready', () => { // 'CommandOrControl+X' 단축키를 리스너에 등록합니다. const ret = globalShortcut.register('CommandOrControl+X', () => { - console.log('CommandOrControl+X is pressed'); - }); + console.log('CommandOrControl+X is pressed') + }) if (!ret) { - console.log('registration failed'); + console.log('registration failed') } // 단축키가 등록되었는지 확인합니다. - console.log(globalShortcut.isRegistered('CommandOrControl+X')); -}); + console.log(globalShortcut.isRegistered('CommandOrControl+X')) +}) app.on('will-quit', () => { // 단축키의 등록을 해제합니다. - globalShortcut.unregister('CommandOrControl+X'); + globalShortcut.unregister('CommandOrControl+X') // 모든 단축키의 등록을 해제합니다. - globalShortcut.unregisterAll(); -}); + globalShortcut.unregisterAll() +}) ``` ## Methods @@ -56,7 +56,7 @@ accelerator가 이미 다른 애플리케이션에서 사용 중일 경우, 이 * `accelerator` [Accelerator](accelerator.md) -지정된 `accelerator` 단축키가 등록되었는지 여부를 확인합니다. +Returns `Boolean` - `accelerator` 가 등록되었는지 여부. Accelerator가 이미 다른 애플리케이션에서 사용 중일 경우, 여전히 `false`를 반환합니다. 이러한 동작은 애플리케이션이 전역 키보드 단축키를 가지고 충돌이 일어나지 않도록 하기 diff --git a/docs-translations/ko-KR/api/ipc-main.md b/docs-translations/ko-KR/api/ipc-main.md index f509496..c60a200 100644 --- a/docs-translations/ko-KR/api/ipc-main.md +++ b/docs-translations/ko-KR/api/ipc-main.md @@ -1,4 +1,4 @@ -# ipcMain +# ipcMain > 메인 프로세스에서 렌더러 프로세스로 비동기 통신을 합니다. @@ -20,27 +20,27 @@ ```javascript // 메인 프로세스 -const {ipcMain} = require('electron'); +const {ipcMain} = require('electron') ipcMain.on('asynchronous-message', (event, arg) => { - console.log(arg); // "ping" 출력 - event.sender.send('asynchronous-reply', 'pong'); -}); + console.log(arg) // "ping" 출력 + event.sender.send('asynchronous-reply', 'pong') +}) ipcMain.on('synchronous-message', (event, arg) => { - console.log(arg); // "ping" 출력 - event.returnValue = 'pong'; -}); + console.log(arg) // "ping" 출력 + event.returnValue = 'pong' +}) ``` ```javascript // 렌더러 프로세스 (웹 페이지) -const {ipcRenderer} = require('electron'); -console.log(ipc.sendSync('synchronous-message', 'ping')); // "pong" 출력 +const {ipcRenderer} = require('electron') +console.log(ipc.sendSync('synchronous-message', 'ping')) // "pong" 출력 ipcRenderer.on('asynchronous-reply', (arg) => { - console.log(arg); // "pong" 출력 -}); -ipcRenderer.send('asynchronous-message', 'ping'); + console.log(arg) // "pong" 출력 +}) +ipcRenderer.send('asynchronous-message', 'ping') ``` ## 메시지 리스닝 diff --git a/docs-translations/ko-KR/api/menu.md b/docs-translations/ko-KR/api/menu.md index de6c809..e066ca2 100644 --- a/docs-translations/ko-KR/api/menu.md +++ b/docs-translations/ko-KR/api/menu.md @@ -1,4 +1,4 @@ -# Menu +# Menu > 네이티브 애플리케이션 메뉴와 컨텍스트 메뉴를 생성합니다. @@ -250,7 +250,7 @@ macOS의 네이티브 액션에 대해 자세히 알아보려면 #### `Menu.buildFromTemplate(template)` -* `template` Array +* `template` MenuItem[] 기본적으로 `template`는 [MenuItem](menu-item.md)을 생성할 때 사용하는 `options`의 배열입니다. 사용법은 위에서 설명한 것과 같습니다. @@ -292,7 +292,7 @@ macOS의 네이티브 액션에 대해 자세히 알아보려면 #### `menu.items` -메뉴가 가지고 있는 메뉴 아이템들의 배열입니다. +메뉴 아이템을 포함하는 MenuItem[] 배열. ## macOS 애플리케이션 메뉴에 대해 알아 둬야 할 것들 diff --git a/docs-translations/ko-KR/api/native-image.md b/docs-translations/ko-KR/api/native-image.md index f5b8caa..206aa3f 100644 --- a/docs-translations/ko-KR/api/native-image.md +++ b/docs-translations/ko-KR/api/native-image.md @@ -105,12 +105,16 @@ let appIcon = new Tray('/Users/somebody/images/icon.png') ### `nativeImage.createEmpty()` +Returns `NativeImage` + 빈 `NativeImage` 인스턴스를 만듭니다. ### `nativeImage.createFromPath(path)` * `path` String +Returns `NativeImage` + `path`로부터 이미지를 로드하여 새로운 `NativeImage` 인스턴스를 만듭니다. `path` 가 존재하지 않거나, 읽을 수 없거나, 유효한 이미지가 아니면 빈 이미지를 반환한다. @@ -125,6 +129,8 @@ let image = nativeImage.createFromPath('/Users/somebody/images/icon.png') * `buffer` [Buffer][buffer] * `scaleFactor` Double (optional) +Returns `NativeImage` + `buffer`로부터 이미지를 로드하여 새로운 `NativeImage` 인스턴스를 만듭니다. `scaleFactor`의 기본값은 1.0 입니다. @@ -144,34 +150,35 @@ let image = nativeImage.createFromPath('/Users/somebody/images/icon.png') #### `image.toPNG()` -`PNG` 이미지를 인코딩한 데이터를 [Buffer][buffer]로 반환합니다. +Return `Buffer` - `PNG` 로 인코딩된 데이터가 있는 [Buffer][buffer]. #### `image.toJPEG(quality)` * `quality` Integer (**required**) 0 - 100 사이의 값 -`JPEG` 이미지를 인코딩한 데이터를 [Buffer][buffer]로 반환합니다. +Return `Buffer` - `JPEG` 로 인코딩된 데이터가 있는 [Buffer][buffer]. ##### `image.toBitmap()` -이미지의 raw 비트맵 픽셀 데이터를 가지는 [Buffer][buffer]의 복사본을 반환합니다. +Return `Buffer` - 이미지의 raw 비트맵 픽셀 데이터가 있는 [Buffer][buffer]의 +복사본. #### `image.toDataURL()` -이미지를 data URL로 반환합니다. +Returns `String` - 이미지의 data URL. #### `image.getBitmap()` -이미지의 raw 비트맵 픽셀 데이터를 가지는 [Buffer][buffer]를 반환합니다. +Returns `Buffer` - 이미지의 raw 비트맵 픽셀 데이터가 있는 [Buffer][buffer]. `getBitmap()`과 `toBitmap()`의 차이는 `getBitmap()`은 비트맵 데이터를 복사하지 -않습니다. 그래서 버퍼를 현재 이벤트 루프 틱에 바로 반환해야 할 경우 유용하게 사용할 수 -있습니다. 그렇지 않은 경우 데이터가 변경되거나 소멸될 수 있습니다. +않습니다. 그래서 버퍼를 현재 이벤트 루프 틱에 바로 반환해야 할 경우 유용하게 +사용할 수 있습니다. 그렇지 않은 경우 데이터가 변경되거나 소멸될 수 있습니다. #### `image.getNativeHandle()` _macOS_ -이미지의 네이티브 핸들 밑에 있는 C 포인터를 담은 [Buffer][buffer]을 반환합니다. -macOS에선, `NSImage` 인스턴스가 반환됩니다. +Returns `Buffer` - 이미지의 네이티브 핸들의 C 포인터를 담은 [Buffer][buffer]. +macOS에선, `NSImage` 인스턴스의 포인터가 반환됩니다. 참고로 반환된 포인터는 복사본이 아닌 네이티브 이미지의 밑에 있는 약한 포인터이며, 따라서 반드시 관련된 `nativeImage` 인스턴스가 확실하게 유지되고 있는지를 인지해야 @@ -179,11 +186,11 @@ macOS에선, `NSImage` 인스턴스가 반환됩니다. #### `image.isEmpty()` -이미지가 비었는지 확인합니다. +Returns `Boolean` - 이미지가 비었는지 여부. #### `image.getSize()` -이미지의 사이즈를 반환합니다. +Returns `Integer[]` - 이미지의 크기. #### `image.setTemplateImage(option)` @@ -193,6 +200,6 @@ macOS에선, `NSImage` 인스턴스가 반환됩니다. #### `image.isTemplateImage()` -이미지가 템플릿 이미지인지 확인합니다. +Returns `Boolean` - 이미지가 템플릿 이미지인지 여부. [buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer diff --git a/docs-translations/ko-KR/api/power-monitor.md b/docs-translations/ko-KR/api/power-monitor.md index 2858a14..ad1a7c7 100644 --- a/docs-translations/ko-KR/api/power-monitor.md +++ b/docs-translations/ko-KR/api/power-monitor.md @@ -8,14 +8,14 @@ 예시: ```javascript -const electron = require('electron'); -const {app} = electron; +const electron = require('electron') +const {app} = electron app.on('ready', () => { electron.powerMonitor.on('suspend', () => { - console.log('절전모드로 진입합니다!'); - }); -}); + console.log('절전모드로 진입합니다!') + }) +}) ``` ## Events diff --git a/docs-translations/ko-KR/api/power-save-blocker.md b/docs-translations/ko-KR/api/power-save-blocker.md index 3e4049a..4a414de 100644 --- a/docs-translations/ko-KR/api/power-save-blocker.md +++ b/docs-translations/ko-KR/api/power-save-blocker.md @@ -1,16 +1,16 @@ -# powerSaveBlocker +# powerSaveBlocker > 시스템이 저전력 (슬립) 모드로 진입하는 것을 막습니다. 예시: ```javascript -const {powerSaveBlocker} = require('electron'); +const {powerSaveBlocker} = require('electron') -const id = powerSaveBlocker.start('prevent-display-sleep'); -console.log(powerSaveBlocker.isStarted(id)); +const id = powerSaveBlocker.start('prevent-display-sleep') +console.log(powerSaveBlocker.isStarted(id)) -powerSaveBlocker.stop(id); +powerSaveBlocker.stop(id) ``` ## Methods @@ -21,17 +21,17 @@ powerSaveBlocker.stop(id); * `type` String - Power save blocker 종류 * `prevent-app-suspension` - 저전력 모드 등으로 인한 애플리케이션 작동 중단을 - 방지합니다. 시스템을 항시 활성화 상태로 만듭니다. 하지만 화면은 자동으로 꺼질 수 - 있습니다. 사용 예시: 파일 다운로드, 음악 재생 등. + 방지합니다. 시스템을 항시 활성화 상태로 만듭니다. 하지만 화면은 자동으로 꺼질 + 수 있습니다. 사용 예시: 파일 다운로드, 음악 재생 등. * `prevent-display-sleep` - 슬립 모드 등으로 인한 애플리케이션의 작동 중단을 - 방지합니다. 시스템을 항시 활성화 상태로 만들고 슬립 모드(화면 꺼짐)를 방지합니다. - 사용 예시: 비디오 재생 등. + 방지합니다. 시스템을 항시 활성화 상태로 만들고 슬립 모드(화면 꺼짐)를 + 방지합니다. 사용 예시: 비디오 재생 등. 시스템이 저전력 모드(슬립)로 진입하는 것을 막기 시작합니다. 정수로 된 식별 ID를 반환합니다. -**참고:** `prevent-display-sleep` 모드는 `prevent-app-suspension` 보다 우선 순위가 -높습니다. 두 모드 중 가장 높은 우선 순위의 모드만 작동합니다. 다시 말해 +**참고:** `prevent-display-sleep` 모드는 `prevent-app-suspension` 보다 우선 +순위가 높습니다. 두 모드 중 가장 높은 우선 순위의 모드만 작동합니다. 다시 말해 `prevent-display-sleep` 모드는 언제나 `prevent-app-suspension` 모드의 효과를 덮어씌웁니다. @@ -52,4 +52,4 @@ ID. * `id` Integer - `powerSaveBlocker.start`로부터 반환되는 power save blocker 식별 ID. -지정한 id의 `powerSaveBlocker`가 실행 중인지 확인합니다. +Returns `Boolean` - 지정한 id의 `powerSaveBlocker`가 실행 중인지 여부. diff --git a/docs-translations/ko-KR/api/process.md b/docs-translations/ko-KR/api/process.md index 70733b9..8dcf948 100644 --- a/docs-translations/ko-KR/api/process.md +++ b/docs-translations/ko-KR/api/process.md @@ -16,12 +16,12 @@ Electron 내부 초기화 스크립트의 로드가 완료되고, 웹 페이지 ```javascript // preload.js -const _setImmediate = setImmediate; -const _clearImmediate = clearImmediate; +const _setImmediate = setImmediate +const _clearImmediate = clearImmediate process.once('loaded', () => { - global.setImmediate = _setImmediate; - global.clearImmediate = _clearImmediate; -}); + global.setImmediate = _setImmediate + global.clearImmediate = _clearImmediate +}) ``` ## Properties @@ -83,9 +83,7 @@ Mac App Store 빌드에선 이 속성이 `true`가 됩니다. 다른 빌드에 ### `process.getProcessMemoryInfo()` -현재 프로세스의 메모리 사용량에 대한 정보를 객체 형태로 반환합니다. 참고로 모든 사용량은 -킬로바이트로 표기됩니다. - +Returns `Object`: * `workingSetSize` Integer - 현재 실제 물리적 RAM에 예약된 메모리의 양. * `peakWorkingSetSize` Integer - 물리적 RAM에 예약된 메모리의 최대 사용량. * `privateBytes` Integer - 다른 프로세스에 공유되지 않은 JS 힙 또는 HTML 콘텐츠와 @@ -93,11 +91,12 @@ Mac App Store 빌드에선 이 속성이 `true`가 됩니다. 다른 빌드에 * `sharedBytes` Integer - 다른 프로세스와 공유된, 일반적으로 Electron 코드 자체에서 사용하는 메모리의 양. -### `process.getSystemMemoryInfo()` - -전체 시스템의 메모리 사용량에 대한 정보를 객체 형태로 반환합니다. 참고로 모든 사용량은 +현재 프로세스의 메모리 사용량에 대한 정보를 객체 형태로 반환합니다. 참고로 모든 사용량은 킬로바이트로 표기됩니다. +### `process.getSystemMemoryInfo()` + +Returns `Object`: * `total` Integer - 시스템에서 사용할 수 있는 킬로바이트 단위의 전체 물리적 메모리의 양. * `free` Integer - 애플리케이션이나 디스크 캐시로 사용되지 않은 메모리의 양. @@ -105,3 +104,6 @@ Mac App Store 빌드에선 이 속성이 `true`가 됩니다. 다른 빌드에 전체 양. _Windows_ _Linux_ * `swapFree` Integer - 시스템에서 사용할 수 있는 킬로 바이트 단위의 사용되지 않은 스왑 메모리의 양. _Windows_ _Linux_ + +전체 시스템의 메모리 사용량에 대한 정보를 객체 형태로 반환합니다. 참고로 모든 사용량은 +킬로바이트로 표기됩니다. diff --git a/docs-translations/ko-KR/api/protocol.md b/docs-translations/ko-KR/api/protocol.md index 50ee2ec..354f58e 100644 --- a/docs-translations/ko-KR/api/protocol.md +++ b/docs-translations/ko-KR/api/protocol.md @@ -5,18 +5,17 @@ 다음 예시는 `file://` 프로토콜과 비슷한 일을 하는 커스텀 프로토콜을 설정합니다: ```javascript -const {app, protocol} = require('electron'); -const path = require('path'); +const {app, protocol} = require('electron') +const path = require('path') app.on('ready', () => { - protocol.registerFileProtocol('atom', function (request, callback) { - const url = request.url.substr(7); - callback({path: path.normalize(__dirname + '/' + url)}); + protocol.registerFileProtocol('atom', (request, callback) => { + const url = request.url.substr(7) + callback({path: path.normalize(`${__dirname}/${url}`)}) }, function (error) { - if (error) - console.error('Failed to register protocol'); - }); -}); + if (error) console.error('프로토콜 등록 실패') + }) +}) ``` **참고:** 모든 메서드는 따로 표기하지 않는 한 `app` 모듈의 `ready` 이벤트가 발생한 @@ -28,7 +27,7 @@ app.on('ready', () => { ### `protocol.registerStandardSchemes(schemes)` -* `schemes` Array - 표준 스킴으로 등록할 커스텀 스킴 리스트 +* `schemes` String[] - 표준 스킴으로 등록할 커스텀 스킴 리스트 표준 스킴의 형식은 RFC 3986 [일반 URI 문법](https://tools.ietf.org/html/rfc3986#section-3) 표준을 따릅니다. 예를 들어 `http`와 `https` 같은 표준 스킴과 `file`과 같은 표준이 @@ -49,15 +48,20 @@ app.on('ready', () => { ``` 표준 스킴으로 등록하는 것은 [파일 시스템 API][file-system-api]를 통해 파일에 접근하는 -것을 허용할 것입니다. 그렇지 않은 경우 렌더러는 해당 스킴에 대해 보안 에러를 throw할 -것입니다. 일반적인 경우 `http` 프로토콜을 대체하는 커스텀 프로토콜을 등록하고 싶다면, -표준 스킴으로 등록해야 합니다: +것을 허용할 것입니다. 그렇지 않은 경우 렌더러는 해당 스킴에 대해 보안 에러를 발생 할 +것입니다. + +표준 스킴에는 기본적으로 저장 API (localStorage, sessionStorage, webSQL, +indexedDB, cookies) 가 비활성화 되어있습니다. 일반적으로 `http` 프로토콜을 +대체하는 커스텀 프로토콜을 등록하고 싶다면, 표준 스킴으로 등록해야 합니다: ```javascript -protocol.registerStandardSchemes(['atom']); +const {app, protocol} = require('electron') + +protocol.registerStandardSchemes(['atom']) app.on('ready', () => { - protocol.registerHttpProtocol('atom', ...); -}); + protocol.registerHttpProtocol('atom', '...') +}) ``` **참고:** 이 메서드는 `app` 모듈의 `ready` 이벤트가 발생하기 이전에만 사용할 수 @@ -65,7 +69,7 @@ app.on('ready', () => { ### `protocol.registerServiceWorkerSchemes(schemes)` -* `schemes` Array - 서비스 워커를 제어하기 위해 등록될 커스텀 스킴. +* `schemes` String[] - 서비스 워커를 제어하기 위해 등록될 커스텀 스킴. ### `protocol.registerFileProtocol(scheme, handler[, completion])` @@ -121,12 +125,13 @@ app.on('ready', () => { 예시: ```javascript +const {protocol} = require('electron') + protocol.registerBufferProtocol('atom', (request, callback) => { - callback({mimeType: 'text/html', data: new Buffer('
Response
')}); + callback({mimeType: 'text/html', data: new Buffer('
Response
')}) }, (error) => { - if (error) - console.error('Failed to register protocol'); -}); + if (error) console.error('Failed to register protocol') +}) ``` ### `protocol.registerStringProtocol(scheme, handler[, completion])` diff --git a/docs-translations/ko-KR/api/remote.md b/docs-translations/ko-KR/api/remote.md index 1734287..868158e 100644 --- a/docs-translations/ko-KR/api/remote.md +++ b/docs-translations/ko-KR/api/remote.md @@ -14,10 +14,10 @@ inter-process 통신을 하지 않고도 간단한 API를 통해 직접 메인 다음 예시는 렌더러 프로세스에서 브라우저 창을 만드는 예시입니다: ```javascript -const {BrowserWindow} = require('electron').remote; +const {BrowserWindow} = require('electron').remote -let win = new BrowserWindow({width: 800, height: 600}); -win.loadURL('https://github.com'); +let win = new BrowserWindow({width: 800, height: 600}) +win.loadURL('https://github.com') ``` **참고:** 반대로 메인 프로세스에서 렌더러 프로세스에 접근 하려면 [webContents.executeJavascript](web-contents.md#webcontentsexecutejavascriptcode-usergesture-callback) @@ -69,23 +69,23 @@ Remote 객체가 GC 되려면 대응하는 메인 프로세스 내부 객체의 ```javascript // mapNumbers.js 메인 프로세스 exports.withRendererCallback = (mapper) => { - return [1,2,3].map(mapper); -; + return [1, 2, 3].map(mapper) +} exports.withLocalCallback = () => { - return [1,2,3].map(x => x + 1); -}; + return [1, 2, 3].map(x => x + 1) +} ``` ```javascript // 렌더러 프로세스 -const mapNumbers = require('electron').remote.require('./mapNumbers'); +const mapNumbers = require('electron').remote.require('./mapNumbers') -const withRendererCb = mapNumbers.withRendererCallback(x => x + 1); +const withRendererCb = mapNumbers.withRendererCallback(x => x + 1) -const withLocalCb = mapNumbers.withLocalCallback(); +const withLocalCb = mapNumbers.withLocalCallback() -console.log(withRendererCb, withLocalCb); // [undefined, undefined, undefined], [2, 3, 4] +console.log(withRendererCb, withLocalCb) // [undefined, undefined, undefined], [2, 3, 4] ``` 보다시피 동기적인 렌더러 콜백 함수의 반환 값은 예상되지 않은 값입니다. 그리고 메인 @@ -99,11 +99,11 @@ console.log(withRendererCb, withLocalCb); // [undefined, undefined, undefined], 등록합니다: ```javascript -const remote = require('remote'); +const remote = require('remote') remote.getCurrentWindow().on('close', () => { // blabla... -}); +}) ``` 하지만 이 코드와 같이 등록된 이벤트는 명시적으로 제거하지 않는 이상 콜백 함수의 참조가 @@ -125,7 +125,7 @@ remote.getCurrentWindow().on('close', () => { `remote` 모듈을 `electron` 모듈처럼 직접 사용할 수 있습니다. ```javascript -const app = remote.app; +const app = remote.app ``` ## Methods @@ -136,28 +136,29 @@ const app = remote.app; * `module` String -메인 프로세스의 `require(module)` API를 실행한 후 결과 객체를 반환합니다. +Returns `Object` - 메인 프로세스의 `require(module)` 에 의해 반환된 객체. ### `remote.getCurrentWindow()` -현재 웹 페이지가 들어있는 [`BrowserWindow`](browser-window.md) 객체를 반환합니다. +Returns `BrowserWindow` - 현재 웹 페이지가 들어있는 +[`BrowserWindow`](browser-window.md) 객체. ### `remote.getCurrentWebContents()` -현재 웹 페이지의 [`WebContents`](web-contents.md) 객체를 반환합니다. +Returns `WebContents` - 현재 웹 페이지의 [`WebContents`](web-contents.md) 객체. ### `remote.getGlobal(name)` * `name` String -메인 프로세스의 전역 변수(`name`)를 가져옵니다. (예시: `global[name]`) +Returns `any` - 메인 프로세스의 전역 변수 `name` (예시: `global[name]`). ## Properties ### `remote.process` -메인 프로세스의 `process` 객체입니다. `remote.getGlobal('process')`와 -같습니다. 하지만 캐시 됩니다. +메인 프로세스의 `process` 객체입니다. `remote.getGlobal('process')`와 같습니다. +하지만 캐시 됩니다. [rmi]: http://en.wikipedia.org/wiki/Java_remote_method_invocation [enumerable-properties]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties diff --git a/docs-translations/ko-KR/api/screen.md b/docs-translations/ko-KR/api/screen.md index e5822f8..185314d 100644 --- a/docs-translations/ko-KR/api/screen.md +++ b/docs-translations/ko-KR/api/screen.md @@ -23,7 +23,7 @@ let win app.on('ready', () => { const {width, height} = electron.screen.getPrimaryDisplay().workAreaSize win = new BrowserWindow({width, height}) -}); +}) ``` 다음 예시는 확장 디스플레이에 윈도우를 생성합니다: @@ -95,7 +95,7 @@ Returns: * `event` Event * `display` Object -* `changedMetrics` Array +* `changedMetrics` String[] `display`에서 하나 또는 다수의 매트릭스가 변경될 때 발생하는 이벤트입니다. `changedMetrics`는 변경에 대한 정보를 담은 문자열의 배열입니다. @@ -107,15 +107,19 @@ Returns: ### `screen.getCursorScreenPoint()` -현재 마우스 포인터의 절대 위치를 반환합니다. +Returns `Object`: +* `x` Integer +* `y` Integer + +현재 마우스 포인터의 절대 위치. ### `screen.getPrimaryDisplay()` -기본 디스플레이를 반환합니다. +Returns `Display` - 기본 디스플레이. ### `screen.getAllDisplays()` -사용 가능한 모든 디스플레이를 배열로 반환합니다. +Returns `Display[]` - 사용 가능한 모든 디스플레이의 배열. ### `screen.getDisplayNearestPoint(point)` @@ -123,7 +127,7 @@ Returns: * `x` Integer * `y` Integer -지정한 좌표에 가까운 디스플레이를 반환합니다. +Returns `Display` - 지정한 좌표에 가까운 디스플레이. ### `screen.getDisplayMatching(rect)` @@ -133,4 +137,4 @@ Returns: * `width` Integer * `height` Integer -지정한 범위에 가장 가깝게 교차한 디스플레이를 반환합니다. +Returns `Display` - 지정한 범위에 가장 가깝게 교차한 디스플레이. diff --git a/docs-translations/ko-KR/api/session.md b/docs-translations/ko-KR/api/session.md index e10bd71..9059637 100644 --- a/docs-translations/ko-KR/api/session.md +++ b/docs-translations/ko-KR/api/session.md @@ -25,9 +25,9 @@ let ses = win.webContents.session * `options` Object * `cache` Boolean - 캐시를 활성화할지 여부. -`partition` 문자열로부터 `Session` 인스턴스를 만들어 반환합니다. 이미 `partition`에 -해당하는 `Session`이 존재할 경우, 해당 세션이 반환됩니다. 그렇지않은 경우 `Session` -인스턴스가 `options`에 맞춰 새로 생성됩니다. +Returns `Session` - `partition` 문자열로부터 만들어진 `Session` 인스턴스. 이미 +`partition`에 해당하는 `Session`이 존재할 경우, 해당 세션이 반환됩니다. +그렇지않은 경우 `Session` 인스턴스가 `options`에 맞춰 새로 생성됩니다. `partition`이 `persist:`로 시작하면 페이지는 지속성 세션을 사용하며 다른 모든 앱 내의 페이지에서 같은 `partition`을 사용할 수 있습니다. 만약 `persist:` 접두어로 시작하지 @@ -44,7 +44,7 @@ let ses = win.webContents.session ### `session.defaultSession` -애플리케이션의 기본 세션 객체를 반환합니다. +`Session` 객체, 애플리케이션의 기본 세션 객체. ## Class: Session @@ -53,10 +53,10 @@ let ses = win.webContents.session `session` 모듈을 사용하여 `Session` 객체를 생성할 수 있습니다: ```javascript -const session = require('electron').session; - -const ses = session.fromPartition('persist:name'); - ``` +const {session} = require('electron') +const ses = session.fromPartition('persist:name') +console.log(ses.getUserAgent()) +``` ### Instance Events @@ -74,12 +74,13 @@ Electron의 `webContents`에서 `item`을 다운로드할 때 발생하는 이 틱부터 `item`을 사용할 수 없게 됩니다. ```javascript +const {session} = require('electron') session.defaultSession.on('will-download', (event, item, webContents) => { - event.preventDefault(); + event.preventDefault() require('request')(item.getURL(), (data) => { - require('fs').writeFileSync('/somewhere', data); - }); -}); + require('fs').writeFileSync('/somewhere', data) + }) +}) ``` ### Instance Methods @@ -104,10 +105,10 @@ session.defaultSession.on('will-download', (event, item, webContents) => { * `options` Object (optional), proprties: * `origin` String - `scheme://host:port`와 같은 `window.location.origin` 규칙을 따르는 origin 문자열. - * `storages` Array - 비우려는 스토리지의 종류, 다음과 같은 타입을 포함할 수 있습니다: + * `storages` String[] - 비우려는 스토리지의 종류, 다음과 같은 타입을 포함할 수 있습니다: `appcache`, `cookies`, `filesystem`, `indexdb`, `local storage`, `shadercache`, `websql`, `serviceworkers` - * `quotas` Array - 비우려는 할당의 종류, 다음과 같은 타입을 포함할 수 있습니다: + * `quotas` String[] - 비우려는 할당의 종류, 다음과 같은 타입을 포함할 수 있습니다: `temporary`, `persistent`, `syncable`. * `callback` Function (optional) - 작업이 완료되면 호출됩니다. @@ -227,13 +228,13 @@ proxyURL = ["://"][":"] ```javascript // 50kbps의 처리량과 함께 500ms의 레이턴시로 GPRS 연결을 에뮬레이트합니다. window.webContents.session.enableNetworkEmulation({ - latency: 500, - downloadThroughput: 6400, - uploadThroughput: 6400 -}); + latency: 500, + downloadThroughput: 6400, + uploadThroughput: 6400 +}) // 네트워크가 끊긴 상태를 에뮬레이트합니다. -window.webContents.session.enableNetworkEmulation({offline: true}); +window.webContents.session.enableNetworkEmulation({offline: true}) ``` #### `ses.disableNetworkEmulation()` @@ -252,12 +253,12 @@ window.webContents.session.enableNetworkEmulation({offline: true}); `setCertificateVerifyProc(null)`을 호출하면 기본 검증 프로세스로 되돌립니다. ```javascript -myWindow.webContents.session.setCertificateVerifyProc((hostname, cert, callback) => { - if (hostname === 'github.com') - callback(true); - else - callback(false); -}); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() + +win.webContents.session.setCertificateVerifyProc((hostname, cert, callback) => { + callback(hostname === 'github.com') +}) ``` #### `ses.setPermissionRequestHandler(handler)` @@ -272,16 +273,14 @@ myWindow.webContents.session.setCertificateVerifyProc((hostname, cert, callback) 호출하면 권한 제공을 거부합니다. ```javascript -session.fromPartition(partition).setPermissionRequestHandler((webContents, permission, callback) => { - if (webContents.getURL() === host) { - if (permission === 'notifications') { - callback(false); // 거부됨. - return; - } +const {session} = require('electron') +session.fromPartition('some-partition').setPermissionRequestHandler((webContents, permission, callback) => { + if (webContents.getURL() === 'some-host' && permission === 'notifications') { + return callback(false) // 거부됨. } - callback(true); -}); + callback(true) +}) ``` #### `ses.clearHostResolverCache([callback])` @@ -321,7 +320,7 @@ session.defaultSession.allowNTLMCredentialsForDomains('*') #### `ses.getUserAgent()` -현재 세션의 유저 에이전트를 표현하는 `String`을 반환합니다. +Returns `String` - 현재 세션의 유저 에이전트. #### `ses.getBlobData(identifier, callback)` @@ -329,7 +328,7 @@ session.defaultSession.allowNTLMCredentialsForDomains('*') * `callback` Function * `result` Buffer - Blob data. -`identifier` 에 연결된 blob 데이터를 반환합니다. +Returns `Blob` - `identifier` 에 연결된 blob 데이터. ### Instance Properties @@ -337,15 +336,15 @@ session.defaultSession.allowNTLMCredentialsForDomains('*') #### `ses.cookies` -현재 세션의 `Cookies` 클래스 인스턴스를 반환합니다. +현재 세션의 `Cookies` 객체. #### `ses.webRequest` -현재 세션의 `WebRequest` 클래스 인스턴스를 반환합니다. +현재 세션의 `WebRequest` 객체. #### `ses.protocol` -현재 세션의 [protocol](protocol.md) 모듈 인스턴스를 반환합니다. +현재 세션의 Protocol 객체 ([protocol](protocol.md) 모듈의 인스턴스). ```javascript const {app, session} = require('electron') @@ -355,10 +354,9 @@ app.on('ready', function () { const protocol = session.fromPartition(partitionName).protocol protocol.registerFileProtocol('atom', function (request, callback) { var url = request.url.substr(7) - callback({path: path.normalize(__dirname + '/' + url)}) + callback({path: path.normalize(`${__dirname}/${url}`)}) }, function (error) { - if (error) - console.error('Failed to register protocol') + if (error) console.error('Failed to register protocol') }) }) ``` @@ -374,21 +372,20 @@ app.on('ready', function () { ```javascript // 모든 쿠키를 요청합니다. session.defaultSession.cookies.get({}, (error, cookies) => { - console.log(cookies); -}); + console.log(error, cookies) +}) // url에 관련된 쿠키를 모두 가져옵니다. session.defaultSession.cookies.get({url: 'http://www.github.com'}, (error, cookies) => { - console.log(cookies); -}); + console.log(error, cookies) +}) // 지정한 쿠키 데이터를 설정합니다. // 동일한 쿠키가 있으면 해당 쿠키를 덮어씁니다. -const cookie = {url: 'http://www.github.com', name: 'dummy_name', value: 'dummy'}; +const cookie = {url: 'http://www.github.com', name: 'dummy_name', value: 'dummy'} session.defaultSession.cookies.set(cookie, (error) => { - if (error) - console.error(error); -}); + if (error) console.error(error) +}) ``` ### Instance Methods @@ -483,7 +480,7 @@ const filter = { } session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => { - details.requestHeaders['User-Agent'] = "MyAgent" + details.requestHeaders['User-Agent'] = 'MyAgent' callback({cancel: false, requestHeaders: details.requestHeaders}) }) ``` diff --git a/docs-translations/ko-KR/api/shell.md b/docs-translations/ko-KR/api/shell.md index 9324e61..11fb630 100644 --- a/docs-translations/ko-KR/api/shell.md +++ b/docs-translations/ko-KR/api/shell.md @@ -1,4 +1,4 @@ -# shell +# shell > 파일과 URL을 각 기본 애플리케이션을 통해 관리합니다. @@ -7,9 +7,9 @@ 다음 예시는 설정된 URL을 유저의 기본 브라우저로 엽니다: ```javascript -const {shell} = require('electron'); +const {shell} = require('electron') -shell.openExternal('https://github.com'); +shell.openExternal('https://github.com') ``` ## Methods @@ -20,12 +20,16 @@ shell.openExternal('https://github.com'); * `fullPath` String -지정한 파일을 탐색기에서 보여줍니다. 가능한 경우 탐색기 내에서 파일을 선택합니다. +Returns `Boolean` - 아이템 성공적으로 보여졌는지 여부. + +지정한 파일을 파일 매니저에서 보여줍니다. 가능한 경우 파일을 선택합니다. ### `shell.openItem(fullPath)` * `fullPath` String +Returns `Boolean` - 아이템 성공적으로 열렸는지 여부. + 지정한 파일을 데스크톱 기본 프로그램으로 엽니다. ### `shell.openExternal(url[, options])` @@ -35,9 +39,10 @@ shell.openExternal('https://github.com'); * `activate` Boolean - `true`로 설정하면 애플리케이션을 바로 활성화 상태로 실행합니다. 기본값은 `true`입니다. +Returns `Boolean` - 애플리케이션이 URL 을 열 수 있었는지 여부. + 제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를 들어 -mailto: URL은 유저의 기본 이메일 에이전트로 URL을 엽니다.) 애플리케이션이 해당 URL을 -열 수 있을 때 `true`를 반환합니다. 아니라면 `false`를 반환합니다. +mailto: URL은 유저의 기본 이메일 에이전트로 URL을 엽니다). **역자주:** 탐색기로 폴더만 표시하려면 `'file://경로'`와 같이 지정하여 열 수 있습니다. @@ -45,7 +50,9 @@ mailto: URL은 유저의 기본 이메일 에이전트로 URL을 엽니다.) 애 * `fullPath` String -지정한 파일을 휴지통으로 이동합니다. 작업의 성공여부를 boolean 형으로 리턴합니다. +Returns `Boolean` - 아이템이 성공적으로 휴지통으로 이동되었는지 여부. + +지정한 파일을 휴지통으로 이동시키고 작업의 상태를 boolean 형으로 반환합니다. ### `shell.beep()` @@ -74,13 +81,29 @@ mailto: URL은 유저의 기본 이메일 에이전트로 URL을 엽니다.) 애 * `appUserModelId` String (optional) - 애플리케이션 사용자 모델 ID입니다. 기본값은 없습니다. -`shortcutPath`에 바로가기 링크를 생성합니다. 바로가기 생성에 성공하면 `true`를 -반환하고 그렇지 않으면 `false`를 반환합니다. +Returns `Boolean` - 바로가기 생성 여부. + +`shortcutPath`에 바로가기 링크를 생성하거나 갱신합니다. ### `shell.readShortcutLink(shortcutPath)` _Windows_ * `shortcutPath` String +Returns `Object`: +* `target` String - 바로가기로 실행할 대상. +* `cwd` String (optional) - 작업 디렉토리. 기본값은 빈 문자열. +* `args` String (optional) - 바로가기로 실행할 때 `target` 에 적용될 인수. + 기본값은 빈 문자열. +* `description` String (optional) - 바로가기의 설명. 기본값은 빈 문자열. +* `icon` String (optional) - 아이콘의 경로. DLL 이나 EXE 일 수 있다. `icon` 과 + `iconIndex` 는 함께 설정해야 한다. 기본값은 빈 문자열이며, 타겟의 아이콘을 + 사용한다. +* `iconIndex` Integer (optional) - `icon` 이 DLL 이나 EXE 일 경우 아이콘의 + 리소스 ID. 기본값은 0. +* `appUserModelId` String (optional) - 애플리케이션 사용자 모델 ID. 기본값은 빈 + 문자열. + +Resolves the shortcut link at `shortcutPath`. `shortcutPath`에 위치한 바로가기 링크를 해석합니다. `shell.writeShortcutLink` 메서드의 `options`에 묘사된 속성을 포함하는 객체를 반환합니다. diff --git a/docs-translations/ko-KR/api/synopsis.md b/docs-translations/ko-KR/api/synopsis.md index 94c0dfa..6669169 100644 --- a/docs-translations/ko-KR/api/synopsis.md +++ b/docs-translations/ko-KR/api/synopsis.md @@ -18,14 +18,14 @@ node 모듈을 완벽하게 지원합니다. ([네이티브 모듈](../tutorial/ 메인 프로세스 스크립트는 일반 Node.js 스크립트와 비슷합니다: ```javascript -const {app, BrowserWindow} = require('electron'); +const {app, BrowserWindow} = require('electron') -let win = null; +let win = null app.on('ready', () => { - win = new BrowserWindow({width: 800, height: 600}); - win.loadURL('https://github.com'); -}); + win = new BrowserWindow({width: 800, height: 600}) + win.loadURL('https://github.com') +}) ``` 렌더러 프로세스도 예외적인 node module들을 사용할 수 있다는 점을 제외하면 일반 웹 diff --git a/docs-translations/ko-KR/api/system-preferences.md b/docs-translations/ko-KR/api/system-preferences.md index 1f9e6ec..1716773 100644 --- a/docs-translations/ko-KR/api/system-preferences.md +++ b/docs-translations/ko-KR/api/system-preferences.md @@ -3,8 +3,8 @@ > 시스템 설정을 가져옵니다. ```javascript -const {systemPreferences} = require('electron'); -console.log(systemPreferences.isDarkMode()); +const {systemPreferences} = require('electron') +console.log(systemPreferences.isDarkMode()) ``` ## Events @@ -23,13 +23,11 @@ Returns: ### `systemPreferences.isDarkMode()` _macOS_ -이 메서드는 시스템이 어두운 모드 상태인 경우 `true`를 반환하고 아닐 경우 `false` -를 반환합니다. +Returns `Boolean` - 시스템이 어두운 모드인지 여부. ### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_ -이 메서드는 페이지 간의 스와이프가 설정되어있을 때 `true`를 반환하고 그렇지 않은 -경우 `false`를 반환합니다. +Returns `Boolean` - 페이지 간의 스와이프가 설정되어 있는지 여부. ### `systemPreferences.postNotification(event, userInfo)` _macOS_ @@ -115,24 +113,24 @@ macOS에선 API가 `NSUserDefaults`를 읽어들입니다. 유명한 `key`와 `t 예시입니다 (투명한 윈도우는 DWM 컴포지션이 비활성화되어있을 시 작동하지 않습니다): ```javascript -const {BrowserWindow, systemPreferences} = require('electron'); -let browserOptions = {width: 1000, height: 800}; +const {BrowserWindow, systemPreferences} = require('electron') +let browserOptions = {width: 1000, height: 800} // 플랫폼이 지원하는 경우에만 투명 윈도우를 생성. if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { - browserOptions.transparent = true; - browserOptions.frame = false; + browserOptions.transparent = true + browserOptions.frame = false } // 원도우 생성 -let win = new BrowserWindow(browserOptions); +let win = new BrowserWindow(browserOptions) // 페이지 로드. if (browserOptions.transparent) { - win.loadURL('file://' + __dirname + '/index.html'); + win.loadURL(`file://${__dirname}/index.html`) } else { // 투명 윈도우 상태가 아니라면, 기본적인 스타일 사용 - win.loadURL('file://' + __dirname + '/fallback.html'); + win.loadURL(`file://${__dirname}/fallback.html`) } ``` diff --git a/docs-translations/ko-KR/api/tray.md b/docs-translations/ko-KR/api/tray.md index 93a274c..2dddace 100644 --- a/docs-translations/ko-KR/api/tray.md +++ b/docs-translations/ko-KR/api/tray.md @@ -1,4 +1,4 @@ -# Tray +# Tray > 아이콘과 컨텍스트 메뉴를 시스템 알림 영역에 추가합니다. @@ -13,7 +13,7 @@ app.on('ready', () => { {label: 'Item2', type: 'radio'}, {label: 'Item3', type: 'radio', checked: true}, {label: 'Item4', type: 'radio'} - ]); + ]) tray.setToolTip('이것은 나의 애플리케이션 입니다!') tray.setContextMenu(contextMenu) }) @@ -118,7 +118,7 @@ appIcon.setContextMenu(contextMenu) #### Event: 'drop-files' _macOS_ * `event` Event -* `files` Array - 드롭된 파일의 경로 +* `files` String[] - 드롭된 파일의 경로 트레이 아이콘에 파일이 드롭되면 발생하는 이벤트입니다. @@ -232,12 +232,12 @@ win.on('hide', () => { ### `tray.getBounds()` _macOS_ _Windows_ -이 트레이 아이콘의 `bounds`를 `Object` 형식으로 반환합니다. +Returns `Object`: +* `x` Integer +* `y` Integer +* `width` Integer +* `height` Integer -* `bounds` Object - * `x` Integer - * `y` Integer - * `width` Integer - * `height` Integer +이 트레이 아이콘의 `Object` 형식의 `bounds`. [event-emitter]: http://nodejs.org/api/events.html#events_class_events_eventemitter diff --git a/docs-translations/ko-KR/api/web-contents.md b/docs-translations/ko-KR/api/web-contents.md index 347d877..ed2b75f 100644 --- a/docs-translations/ko-KR/api/web-contents.md +++ b/docs-translations/ko-KR/api/web-contents.md @@ -8,12 +8,13 @@ 접근하는 예시입니다: ```javascript -const {BrowserWindow} = require('electron'); +const {BrowserWindow} = require('electron') -let 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') -let contents = win.webContents; +let contents = win.webContents +console.log(contents) ``` ## Methods @@ -21,18 +22,26 @@ let contents = win.webContents; 다음 메서드는 `webContents` 모듈에서 접근할 수 있는 메서드입니다: ```javascript -const {webContents} = require('electron'); +const {webContents} = require('electron') +console.log(webContents) ``` #### `webContents.getAllWebContents()` -모든 `WebContents` 인스턴스의 배열을 반환합니다. 이 배열은 윈도우, 웹뷰, 열린 개발자 -도구 그리고 개발자 도구 확장 기능의 백그라운드 페이지의 모든 웹 콘텐츠를 포함합니다. +Returns `WebContents[]` - 모든 `WebContents` 인스턴스의 배열. 이 배열은 윈도우, +웹뷰, 열린 개발자 도구 그리고 백그라운드 페이지의 개발자 도구 확장 기능의 모든 +웹 콘텐츠를 포함합니다. #### `webContents.getFocusedWebContents()` -이 애플리케이션에서 포커스되어있는 웹 콘텐츠를 반환합니다. 포커스된 웹 콘텐츠가 없을 -경우 `null`을 반환합니다. +Returns `WebContents` - 이 애플리케이션에서 포커스되어있는 웹 콘텐츠. 없을 경우 +`null` 을 반환합니다. + +### `webContents.fromId(id)` + +* `id` Integer + +Returns `WebContents` - ID 에 해당하는 WebContens 인스턴스. ## Class: WebContents @@ -123,7 +132,7 @@ Returns: Returns: * `event` Event -* `favicons` Array - URL 배열 +* `favicons` String[] - URL 배열 페이지가 favicon(파비콘) URL을 받았을 때 발생하는 이벤트입니다. @@ -431,6 +440,7 @@ Returns: 호출되어야 하며, 빈 문자열을 `callback`에 보내면 요청이 취소됩니다. ```javascript +const {app, webContents} = require('electron') app.commandLine.appendSwitch('enable-web-bluetooth') app.on('ready', () => { @@ -487,7 +497,8 @@ win.loadURL('http://github.com') 하는 경우 `pragma` 헤더를 사용할 수 있습니다. ```javascript -const options = {extraHeaders: 'pragma: no-cache\n'}; +const {webContents} = require('electron') +const options = {extraHeaders: 'pragma: no-cache\n'} webContents.loadURL(url, options) ``` @@ -503,10 +514,12 @@ webContents.loadURL(url, options) 현재 웹 페이지의 URL을 반환합니다. ```javascript -let win = new BrowserWindow({width: 800, height: 600}); -win.loadURL('http://github.com'); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow({width: 800, height: 600}) +win.loadURL('http://github.com') -let currentURL = win.webContents.getURL(); +let currentURL = win.webContents.getURL() +console.log(currentURL) ``` #### `contents.getTitle()` @@ -751,12 +764,13 @@ CSS 코드를 현재 웹 페이지에 삽입합니다. 제공된 `action`에 대한 `webContents`의 모든 `findInPage` 요청을 중지합니다. ```javascript +const {webContents} = require('electron') webContents.on('found-in-page', (event, result) => { - if (result.finalUpdate) - webContents.stopFindInPage('clearSelection'); -}); + if (result.finalUpdate) webContents.stopFindInPage('clearSelection') +}) -const requestId = webContents.findInPage('api'); +const requestId = webContents.findInPage('api') +console.log(requestId) ``` #### `contents.capturePage([rect, ]callback)` @@ -834,23 +848,22 @@ Chromium의 미리보기 프린팅 커스텀 설정을 이용하여 윈도우의 다음은 `webContents.printToPDF`의 예시입니다: ```javascript -const {BrowserWindow} = require('electron'); -const fs = require('fs'); +const {BrowserWindow} = require('electron') +const fs = require('fs') -let 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', () => { // 기본 프린트 옵션을 사용합니다 win.webContents.printToPDF({}, (error, data) => { - if (error) throw error; + if (error) throw error fs.writeFile('/tmp/print.pdf', data, (error) => { - if (error) - throw error; - console.log('Write PDF successfully.'); - }); - }); -}); + if (error) throw error + console.log('Write PDF successfully.') + }) + }) +}) ``` #### `contents.addWorkSpace(path)` @@ -861,9 +874,11 @@ win.webContents.on('did-finish-load', () => { 이후에 사용해야 합니다. ```javascript +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() win.webContents.on('devtools-opened', () => { - win.webContents.addWorkSpace(__dirname); -}); + win.webContents.addWorkSpace(__dirname) +}) ``` #### `contents.removeWorkSpace(path)` @@ -925,14 +940,15 @@ win.webContents.on('devtools-opened', () => { ```javascript // In the main process. -let win = null; +const {app, BrowserWindow} = require('electron') +let win = null app.on('ready', () => { - win = new BrowserWindow({width: 800, height: 600}); - win.loadURL('file://' + __dirname + '/index.html'); + win = new BrowserWindow({width: 800, height: 600}) + win.loadURL(`file://${__dirname}/index.html`) win.webContents.on('did-finish-load', () => { - win.webContents.send('ping', 'whoooooooh!'); - }); -}); + win.webContents.send('ping', 'whoooooooh!') + }) +}) ``` ```html @@ -941,7 +957,7 @@ app.on('ready', () => { @@ -990,7 +1006,7 @@ app.on('ready', () => { * `type` String (**required**) - 이벤트의 종류. 다음 값들을 사용할 수 있습니다: `mouseDown`, `mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel`, `mouseMove`, `keyDown`, `keyUp`, `char`. - * `modifiers` Array - 이벤트의 수정자(modifier)들에 대한 배열. 다음 값들을 포함 + * `modifiers` String[] - 이벤트의 수정자(modifier)들에 대한 배열. 다음 값들을 포함 할 수 있습니다: `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`, `leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`, `numLock`, `left`, `right`. @@ -1070,14 +1086,16 @@ Input `event`를 웹 페이지로 전송합니다. 만약 페이지를 저장하는 프로세스가 성공적으로 끝났을 경우 true를 반환합니다. ```javascript -win.loadURL('https://github.com'); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() + +win.loadURL('https://github.com') win.webContents.on('did-finish-load', () => { win.webContents.savePage('/tmp/test.html', 'HTMLComplete', (error) => { - if (!error) - console.log('Save page successfully'); - }); -}); + if (!error) console.log('Save page successfully') + }) +}) ``` #### `contents.showDefinitionForSelection()` _macOS_ @@ -1146,24 +1164,28 @@ win.webContents.on('did-finish-load', () => { > Chrome의 원격 디버깅 프로토콜에 대한 대체 접근자입니다. ```javascript +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() + try { - win.webContents.debugger.attach('1.1'); -} catch(err) { - console.log('Debugger attach failed : ', err); -}; + win.webContents.debugger.attach('1.1') +} catch (err) { + console.log('Debugger attach failed : ', err) +} win.webContents.debugger.on('detach', (event, reason) => { - console.log('Debugger detached due to : ', reason); -}); + console.log('Debugger detached due to : ', reason) +}) win.webContents.debugger.on('message', (event, method, params) => { if (method === 'Network.requestWillBeSent') { - if (params.request.url === 'https://www.github.com') - win.webContents.debugger.detach(); + if (params.request.url === 'https://www.github.com') { + win.webContents.debugger.detach() + } } -}); +}) -win.webContents.debugger.sendCommand('Network.enable'); +win.webContents.debugger.sendCommand('Network.enable') ``` ### Instance Methods diff --git a/docs-translations/ko-KR/api/web-frame.md b/docs-translations/ko-KR/api/web-frame.md index f784124..e876c8d 100644 --- a/docs-translations/ko-KR/api/web-frame.md +++ b/docs-translations/ko-KR/api/web-frame.md @@ -5,9 +5,9 @@ 다음 예시는 현재 페이지를 200% 줌 합니다: ```javascript -const {webFrame} = require('electron'); +const {webFrame} = require('electron') -webFrame.setZoomFactor(2); +webFrame.setZoomFactor(2) ``` ## Methods @@ -23,7 +23,7 @@ webFrame.setZoomFactor(2); ### `webFrame.getZoomFactor()` -현재 줌 값을 반환합니다. +Returns `Number` - 현재 줌 값. ### `webFrame.setZoomLevel(level)` @@ -35,7 +35,7 @@ webFrame.setZoomFactor(2); ### `webFrame.getZoomLevel()` -현재 줌 레벨을 반환합니다. +Returns `Number` - 현재 줌 레벨. ### `webFrame.setZoomLevelLimits(minimumLevel, maximumLevel)` @@ -58,11 +58,12 @@ Input field나 text area에 철자 검사(spell checking) 제공자를 설정합 [node-spellchecker][spellchecker]를 철자 검사 제공자로 사용하는 예시입니다: ```javascript +const {webFrame} = require('electron') webFrame.setSpellCheckProvider('en-US', true, { - spellCheck(text) { - return !(require('spellchecker').isMisspelled(text)); + spellCheck (text) { + return !(require('spellchecker').isMisspelled(text)) } -}); +}) ``` ### `webFrame.registerURLSchemeAsSecure(scheme)` @@ -105,9 +106,47 @@ ServiceWorker의 등록과 fetch API를 사용할 수 있도록 지원합니다. ### `webFrame.getResourceUsage()` +Returns `Object`: +* `images` Object + * `count` Integer + * `size` Integer + * `liveSize` Integer + * `decodedSize` Integer + * `purgedSize` Integer + * `purgeableSize` Integer +* `cssStyleSheets` Object + * `count` Integer + * `size` Integer + * `liveSize` Integer + * `decodedSize` Integer + * `purgedSize` Integer + * `purgeableSize` Integer +* `xslStyleSheets` Object + * `count` Integer + * `size` Integer + * `liveSize` Integer + * `decodedSize` Integer + * `purgedSize` Integer + * `purgeableSize` Integer +* `fonts` Object + * `count` Integer + * `size` Integer + * `liveSize` Integer + * `decodedSize` Integer + * `purgedSize` Integer + * `purgeableSize` Integer +* `other` Object + * `count` Integer + * `size` Integer + * `liveSize` Integer + * `decodedSize` Integer + * `purgedSize` Integer + * `purgeableSize` Integer + Blink의 내부 메모리 캐시 사용 정보를 담고있는 객체를 반환합니다. ```javascript +const {webFrame} = require('electron') console.log(webFrame.getResourceUsage()) ``` @@ -132,7 +171,7 @@ console.log(webFrame.getResourceUsage()) ### `webFrame.clearCache()` -사용하지 않는 메모리 비우기를 시도합니다. (이전 페이지의 이미지 등) +(이전 페이지의 이미지 등) 사용하지 않는 메모리 해제를 시도합니다. 참고로 맹목적으로 이 메서드를 호출하는 것은 이 빈 캐시를 다시 채워야하기 때문에 Electron을 느리게 만듭니다. 따라서 이 메서드는 페이지가 예상했던 것 보다 실질적으로 더 diff --git a/docs-translations/ko-KR/api/web-view-tag.md b/docs-translations/ko-KR/api/web-view-tag.md index c372e5e..b08ca24 100644 --- a/docs-translations/ko-KR/api/web-view-tag.md +++ b/docs-translations/ko-KR/api/web-view-tag.md @@ -32,20 +32,20 @@ ```html ``` @@ -230,9 +230,10 @@ webContents 와 연결합니다. **예시** ```javascript +const webview = document.getElementById('foo') webview.addEventListener('dom-ready', () => { - webview.openDevTools(); -}); + webview.openDevTools() +}) ``` ### `.loadURL(url[, options])` @@ -375,6 +376,16 @@ Webview에 웹 페이지 `url`을 로드합니다. `url`은 `http://`, `file://` Service worker에 대한 개발자 도구를 엽니다. +### `.setAudioMuted(muted)` + +* `muted` Boolean + +게스트 페이지 음소거 설정. + +### `.isAudioMuted()` + +Returns `Boolean` - 게스트 페이지 음소거 여부. + ### `.undo()` 페이지에서 실행 취소 커맨드를 실행합니다. @@ -608,7 +619,7 @@ URL에서 합성(synthesised)된 제목인 경우 false로 표시됩니다. Returns: -* `favicons` Array - URL 배열 +* `favicons` String[] - URL 배열 페이지가 favicon URL을 받았을 때 발생하는 이벤트입니다. @@ -635,9 +646,10 @@ Returns: 콘솔에 다시 로깅하는 예시입니다. ```javascript +const webview = document.getElementById('foo') webview.addEventListener('console-message', (e) => { - console.log('Guest page logged a message:', e.message); -}); + console.log('Guest page logged a message:', e.message) +}) ``` ### Event: 'found-in-page' @@ -655,12 +667,13 @@ Returns: 사용할 수 있을 때 발생하는 이벤트입니다. ```javascript +const webview = document.getElementById('foo') webview.addEventListener('found-in-page', (e) => { - if (e.result.finalUpdate) - webview.stopFindInPage('keepSelection'); -}); + webview.stopFindInPage('keepSelection') +}) -const requestId = webview.findInPage('test'); +const requestId = webview.findInPage('test') +console.log(requestId) ``` ### Event: 'new-window' @@ -678,14 +691,15 @@ Returns: 다음 예시 코드는 새 URL을 시스템의 기본 브라우저로 여는 코드입니다. ```javascript -const {shell} = require('electron'); +const {shell} = require('electron') +const webview = document.getElementById('foo') webview.addEventListener('new-window', (e) => { - const protocol = require('url').parse(e.url).protocol; + const protocol = require('url').parse(e.url).protocol if (protocol === 'http:' || protocol === 'https:') { - shell.openExternal(e.url); + shell.openExternal(e.url) } -}); +}) ``` ### Event: 'will-navigate' @@ -737,9 +751,10 @@ Returns: 이동시키는 예시입니다. ```javascript +const webview = document.getElementById('foo') webview.addEventListener('close', () => { - webview.src = 'about:blank'; -}); + webview.src = 'about:blank' +}) ``` ### Event: 'ipc-message' @@ -756,19 +771,20 @@ Returns: ```javascript // In embedder page. +const webview = document.getElementById('foo') webview.addEventListener('ipc-message', (event) => { - console.log(event.channel); + console.log(event.channel) // Prints "pong" -}); -webview.send('ping'); +}) +webview.send('ping') ``` ```javascript // In guest page. -const {ipcRenderer} = require('electron'); +const {ipcRenderer} = require('electron') ipcRenderer.on('ping', () => { - ipcRenderer.sendToHost('pong'); -}); + ipcRenderer.sendToHost('pong') +}) ``` ### Event: 'crashed' diff --git a/docs-translations/ko-KR/faq.md b/docs-translations/ko-KR/faq.md index e84664b..3790e35 100644 --- a/docs-translations/ko-KR/faq.md +++ b/docs-translations/ko-KR/faq.md @@ -36,17 +36,17 @@ Node.js의 새로운 기능은 보통 V8 업그레이드에서 가져옵니다. // 메인 프로세스에서 global.sharedObject = { someProperty: 'default value' -}; +} ``` ```javascript // 첫 번째 페이지에서 -require('electron').remote.getGlobal('sharedObject').someProperty = 'new value'; +require('electron').remote.getGlobal('sharedObject').someProperty = 'new value' ``` ```javascript // 두 번째 페이지에서 -console.log(require('electron').remote.getGlobal('sharedObject').someProperty); +console.log(require('electron').remote.getGlobal('sharedObject').someProperty) ``` ## 제작한 애플리케이션의 윈도우/트레이가 몇 분 후에나 나타납니다. @@ -63,17 +63,17 @@ console.log(require('electron').remote.getGlobal('sharedObject').someProperty); ```javascript app.on('ready', () => { - const tray = new Tray('/path/to/icon.png'); -}); + const tray = new Tray('/path/to/icon.png') +}) ``` 를 이렇게: ```javascript -let tray = null; +let tray = null app.on('ready', () => { - tray = new Tray('/path/to/icon.png'); -}); + tray = new Tray('/path/to/icon.png') +}) ``` ## Electron에서 jQuery/RequireJS/Meteor/AngularJS를 사용할 수 없습니다. @@ -90,7 +90,7 @@ let win = new BrowserWindow({ webPreferences: { nodeIntegration: false } -}); +}) ``` 하지만 Node.js의 기능과 Electron API를 유지하고 싶다면 페이지에 다른 라이브러리를 @@ -125,7 +125,7 @@ Uncaught TypeError: Cannot read property 'setZoomLevel' of undefined 출력하는 방법이 있습니다: ```javascript -console.log(require.resolve('electron')); +console.log(require.resolve('electron')) ``` 그리고 다음과 같은 경로를 가지는지 점검하면 됩니다: diff --git a/docs-translations/ko-KR/styleguide.md b/docs-translations/ko-KR/styleguide.md index 813ea6d..6366127 100644 --- a/docs-translations/ko-KR/styleguide.md +++ b/docs-translations/ko-KR/styleguide.md @@ -97,12 +97,17 @@ API 참고문서에는 이 규칙에 예외가 있습니다. * API 클래스와 모듈 클래스는 `## Class: TheClassName` 챕터 아래에 표시합니다. * 한 페이지에 여러개의 클래스가 있을 수 있습니다. * 생성자는 `###`-단계의 제목으로 표시합니다. -* [정적 메소드](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static) 는 `### Statis Methods` 챕터 아래에 표시합니다. -* [인스턴스 메소드](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Prototype_methods) 는 `### Instance Methods` 챕터 아래에 표시합니다. -* 반환값이 있는 모든 메소드는 "반환값 `[유형]` - 반환값 설명" 형태의 설명으로 시작해야 합니다. -* 인스턴스 이벤트는 `### 인스턴스 이벤트` 챕터 아래에 표시합니다. -* 인스턴스 속성은 `### 인스턴스 속성` 챕터 아래에 표시합니다. -* 인스턴스 속성은 "[속성 유형]" 으로 시작해야 합니다. +* [정적 메소드](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static) + 는 `### Statis Methods` 챕터 아래에 표시합니다. +* [인스턴스 메소드](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Prototype_methods) + 는 `### Instance Methods` 챕터 아래에 표시합니다. +* 반환값이 있는 모든 메소드는 "반환값 `[유형]` - 반환값 설명" 형태의 설명으로 + 시작해야 합니다. + * 메소드가 `Object` 를 반환한다면, 끝에 콜론을 붙인 뒤 다음줄부터 함수 + 매개변수와 같은 스타일로 순서에 상관없이 그 구조를 명시해야 합니다. +* 인스턴스 이벤트는 `### Instance Events` 챕터 아래에 표시합니다. +* 인스턴스 속성은 `### Instance Properties` 챕터 아래에 표시합니다. + * 인스턴스 속성은 "[속성 유형]" 으로 시작해야 합니다. `Session` 과 `Cookies` 클래스 사용 예시: diff --git a/docs-translations/ko-KR/tutorial/application-packaging.md b/docs-translations/ko-KR/tutorial/application-packaging.md index dd86ab0..a21242c 100644 --- a/docs-translations/ko-KR/tutorial/application-packaging.md +++ b/docs-translations/ko-KR/tutorial/application-packaging.md @@ -1,4 +1,4 @@ -# 애플리케이션 패키징 +# 애플리케이션 패키징 Windows에서 일어나는 긴 경로 이름에 대한 [issues](https://github.com/joyent/node/issues/6960)를 완화하고 `require` 속도를 약간 빠르게 하며 애플리케이션의 리소스와 소스 코드를 좋지 않은 @@ -50,29 +50,29 @@ $ asar list /path/to/example.asar `asar` 아카이브에선 다음과 같이 파일을 읽을 수 있습니다: ```javascript -const fs = require('fs'); -fs.readFileSync('/path/to/example.asar/file.txt'); +const fs = require('fs') +fs.readFileSync('/path/to/example.asar/file.txt') ``` 아카이브 내의 루트 디렉터리를 리스팅합니다: ```javascript -const fs = require('fs'); -fs.readdirSync('/path/to/example.asar'); +const fs = require('fs') +fs.readdirSync('/path/to/example.asar') ``` 아카이브 안의 모듈 사용하기: ```javascript -require('/path/to/example.asar/dir/module.js'); +require('/path/to/example.asar/dir/module.js') ``` `BrowserWindow` 클래스를 이용해 원하는 웹 페이지도 표시할 수 있습니다: ```javascript -const {BrowserWindow} = require('electron'); -let win = new BrowserWindow({width: 800, height: 600}); -win.loadURL('file:///path/to/example.asar/static/index.html'); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow({width: 800, height: 600}) +win.loadURL('file:///path/to/example.asar/static/index.html') ``` ### Web API @@ -84,10 +84,10 @@ win.loadURL('file:///path/to/example.asar/static/index.html'); ```html ``` @@ -99,16 +99,16 @@ $.get('file:///path/to/example.asar/file.txt', (data) => { 읽어들입니다: ```javascript -const originalFs = require('original-fs'); -originalFs.readFileSync('/path/to/example.asar'); +const originalFs = require('original-fs') +originalFs.readFileSync('/path/to/example.asar') ``` 또한 `process.noAsar`를 `true`로 지정하면 `fs` 모듈의 `asar` 지원을 비활성화 시킬 수 있습니다. ```javascript -process.noAsar = true; -fs.readFileSync('/path/to/example.asar'); +process.noAsar = true +fs.readFileSync('/path/to/example.asar') ``` ## Node API의 한계 diff --git a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md index a07817c..dae61a3 100644 --- a/docs-translations/ko-KR/tutorial/desktop-environment-integration.md +++ b/docs-translations/ko-KR/tutorial/desktop-environment-integration.md @@ -19,11 +19,11 @@ Windows, Linux, macOS 운영체제 모두 기본적으로 애플리케이션에 ```javascript let myNotification = new Notification('Title', { body: 'Lorem Ipsum Dolor Sit Amet' -}); +}) myNotification.onclick = () => { - console.log('Notification clicked'); -}; + console.log('Notification clicked') +} ``` 위 코드를 통해 생성한 데스크톱 알림은 각 운영체제 모두 비슷한 사용자 경험을 제공하지만, @@ -73,14 +73,16 @@ __애플리케이션 dock menu:__ 사용할 수 있습니다: ```javascript -app.addRecentDocument('/Users/USERNAME/Desktop/work.type'); +const {app} = require('electron') +app.addRecentDocument('/Users/USERNAME/Desktop/work.type') ``` 그리고 [app.clearRecentDocuments][clearrecentdocuments] API로 최근 문서 리스트를 비울 수 있습니다: ```javascript -app.clearRecentDocuments(); +const {app} = require('electron') +app.clearRecentDocuments() ``` ### Windows에서 주의할 점 @@ -110,18 +112,17 @@ __Terminal.app의 dock menu:__ macOS에서만 사용 가능합니다: ```javascript -const {app, Menu} = require('electron'); +const {app, Menu} = require('electron') const dockMenu = Menu.buildFromTemplate([ - {label: 'New Window', click() { console.log('New Window'); }}, + {label: 'New Window', click () { console.log('New Window') }}, {label: 'New Window with Settings', submenu: [ {label: 'Basic'}, {label: 'Pro'} ]}, {label: 'New Command...'} -]); - -app.dock.setMenu(dockMenu); +]) +app.dock.setMenu(dockMenu) ``` ## 사용자 작업 (Windows) @@ -155,6 +156,7 @@ macOS의 dock menu(진짜 메뉴)와는 달리 Windows의 사용자 작업은 수 있습니다: ```javascript +const {app} = require('electron') app.setUserTasks([ { program: process.execPath, @@ -164,14 +166,15 @@ app.setUserTasks([ title: 'New Window', description: 'Create a new window' } -]); +]) ``` 작업 리스트를 비우려면 간단히 `app.setUserTasks` 메서드의 첫번째 인수에 빈 배열을 넣어 호출하면 됩니다: ```javascript -app.setUserTasks([]); +const {app} = require('electron') +app.setUserTasks([]) ``` @@ -202,34 +205,36 @@ __Windows Media Player의 미리보기 툴바:__ 미리보기 툴바를 설정할 수 있습니다: ```javascript -const {BrowserWindow} = require('electron'); -const path = require('path'); +const {BrowserWindow} = require('electron') +const path = require('path') let win = new BrowserWindow({ width: 800, height: 600 -}); +}) win.setThumbarButtons([ { tooltip: 'button1', icon: path.join(__dirname, 'button1.png'), - click() { console.log('button1 clicked'); } + click () { console.log('button1 clicked') } }, { tooltip: 'button2', icon: path.join(__dirname, 'button2.png'), - flags:['enabled', 'dismissonclick'], - click() { console.log('button2 clicked.'); } + flags: ['enabled', 'dismissonclick'], + click () { console.log('button2 clicked.') } } -]); +]) ``` 미리보기 툴바를 비우려면 간단히 `BrowserWindow.setThumbarButtons` API에 빈 배열을 전달하면 됩니다: ```javascript -win.setThumbarButtons([]); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() +win.setThumbarButtons([]) ``` ## Unity 런처 숏컷 기능 (Linux) @@ -259,8 +264,9 @@ __작업 표시줄 버튼의 프로그레스 바:__ 있습니다: ```javascript -let win = new BrowserWindow({...}); -win.setProgressBar(0.5); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() +win.setProgressBar(0.5) ``` ## 작업 표시줄의 아이콘 오버레이 (Windows) @@ -286,8 +292,9 @@ __작업 표시줄 버튼 위의 오버레이:__ API를 사용할 수 있습니다: ```javascript -let win = new BrowserWindow({...}); -win.setOverlayIcon('path/to/overlay.png', 'Description for overlay'); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() +win.setOverlayIcon('path/to/overlay.png', 'Description for overlay') ``` ## 대표 파일 제시 (macOS) @@ -305,9 +312,10 @@ __대표 파일 팝업 메뉴:__ [BrowserWindow.setDocumentEdited][setdocumentedited]를 사용할 수 있습니다: ```javascript -let win = new BrowserWindow({...}); -win.setRepresentedFilename('/etc/passwd'); -win.setDocumentEdited(true); +const {BrowserWindow} = require('electron') +let win = new BrowserWindow() +win.setRepresentedFilename('/etc/passwd') +win.setDocumentEdited(true) ``` ## 파일을 윈도우 밖으로 드래그할 수 있도록 만들기 @@ -332,6 +340,7 @@ win.setDocumentEdited(true); 메인 프로세스에서: ```javascript +const {ipcMain} = require('electron') ipcMain.on('ondragstart', (event, filePath) => { event.sender.startDrag({ file: filePath, diff --git a/docs-translations/ko-KR/tutorial/mac-app-store-submission-guide.md b/docs-translations/ko-KR/tutorial/mac-app-store-submission-guide.md index 370f31d..816602b 100644 --- a/docs-translations/ko-KR/tutorial/mac-app-store-submission-guide.md +++ b/docs-translations/ko-KR/tutorial/mac-app-store-submission-guide.md @@ -120,7 +120,6 @@ productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RES 문서를 참고하여 기본적인 개념을 이해해야 합니다. 그리고 자격(plist) 파일에 애플리케이션에서 요구하는 권한의 키를 추가합니다. - 그 외에 별로도 [electron-osx-sign][electron-osx-sign] 모듈을 사용하여 직접 서명할 수도 있습니다. @@ -161,6 +160,8 @@ electron-osx-sign YourApp.app YourApp.app/Contents/Resources/app/node_modules/na * 비디오 캡쳐 기능은 몇몇 장치에서 작동하지 않을 수 있습니다. * 특정 접근성 기능이 작동하지 않을 수 있습니다. * 애플리케이션이 DNS의 변경을 감지하지 못할 수 있습니다. +* 로그인할 때 앱을 시작하기 위한 API 는 비활성화 되어있습니다. 다음 문서를 보세요. +https://github.com/electron/electron/issues/7312#issuecomment-249479237 또한 애플리케이션 샌드박스 개념으로 인해 애플리케이션에서 접근할 수 있는 리소스는 엄격하게 제한되어 있습니다. 자세한 내용은 [앱 샌드박싱][app-sandboxing] 문서를 @@ -171,6 +172,24 @@ electron-osx-sign YourApp.app YourApp.app/Contents/Resources/app/node_modules/na Mac 앱 스토어 빌드를 위해 앱에서 사용하는 Electron API에 따라 `parent.plist` 파일에 추가적인 기능에 대한 권한을 추가해야 할 수도 있습니다. +#### 네트워크 접근 + +서버와 연결하기 위한 외부로 나가는 네트워크 연결 허용 활성화: + +```xml +com.apple.security.network.client + +``` + +네트워크 리스닝 소켓을 열기 위한 내부로 들어오는 네트워크 연결 허용 활성화: + +```xml +com.apple.security.network.server + +``` + +자세한 내용은 [네트워크 접근 활성화 문서][network-access] 를 참고하세요. + #### dialog.showOpenDialog ```xml diff --git a/docs-translations/ko-KR/tutorial/online-offline-events.md b/docs-translations/ko-KR/tutorial/online-offline-events.md index de2e10f..653b113 100644 --- a/docs-translations/ko-KR/tutorial/online-offline-events.md +++ b/docs-translations/ko-KR/tutorial/online-offline-events.md @@ -1,4 +1,4 @@ -# 온라인/오프라인 이벤트 감지 +# 온라인/오프라인 이벤트 감지 온라인/오프라인 이벤트는 다음 예시와 같이 렌더러 프로세스에서 표준 HTML5 API를 이용하여 구현할 수 있습니다. @@ -6,14 +6,14 @@ _main.js_ ```javascript -const {app, BrowserWindow} = require('electron'); +const {app, BrowserWindow} = require('electron') -let onlineStatusWindow; +let onlineStatusWindow app.on('ready', () => { - onlineStatusWindow = new BrowserWindow({width: 0, height: 0, show: false}); - onlineStatusWindow.loadURL('file://' + __dirname + '/online-status.html'); -}); + onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }) + onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`) +}) ``` _online-status.html_ @@ -24,13 +24,13 @@ _online-status.html_ @@ -46,18 +46,17 @@ _online-status.html_ _main.js_ ```javascript -const {app, ipcMain, BrowserWindow} = require('electron'); - -let onlineStatusWindow; +const {app, BrowserWindow, ipcMain} = require('electron') +let onlineStatusWindow app.on('ready', () => { - onlineStatusWindow = new BrowserWindow({width: 0, height: 0, show: false}); - onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`); -}); + onlineStatusWindow = new BrowserWindow({ width: 0, height: 0, show: false }) + onlineStatusWindow.loadURL(`file://${__dirname}/online-status.html`) +}) ipcMain.on('online-status-changed', (event, status) => { - console.log(status); -}); + console.log(status) +}) ``` _online-status.html_ @@ -67,15 +66,15 @@ _online-status.html_ diff --git a/docs-translations/ko-KR/tutorial/quick-start.md b/docs-translations/ko-KR/tutorial/quick-start.md index 682ade4..8943ba7 100644 --- a/docs-translations/ko-KR/tutorial/quick-start.md +++ b/docs-translations/ko-KR/tutorial/quick-start.md @@ -1,4 +1,4 @@ -# 시작하기 +# 시작하기 ## 소개 @@ -76,56 +76,56 @@ __알림__: 만약 `main` 필드가 `package.json`에 설정되어 있지 않으 다음과 같이 작성할 수 있습니다: ```javascript -const electron = require('electron'); +const electron = require('electron') // 애플리케이션 생명주기를 조작 하는 모듈. -const {app} = electron; +const {app} = electron // 네이티브 브라우저 창을 만드는 모듈. -const {BrowserWindow} = electron; +const {BrowserWindow} = electron // 윈도우 객체를 전역에 유지합니다. 만약 이렇게 하지 않으면 // 자바스크립트 GC가 일어날 때 창이 멋대로 닫혀버립니다. -let win; +let win function createWindow () { // 새로운 브라우저 창을 생성합니다. - win = new BrowserWindow({width: 800, height: 600}); + win = new BrowserWindow({width: 800, height: 600}) // 그리고 현재 디렉터리의 index.html을 로드합니다. - win.loadURL(`file://${__dirname}/index.html`); + win.loadURL(`file://${__dirname}/index.html`) // 개발자 도구를 엽니다. - win.webContents.openDevTools(); + win.webContents.openDevTools() // 창이 닫히면 호출됩니다. win.on('closed', () => { // 윈도우 객체의 참조를 삭제합니다. 보통 멀티 윈도우 지원을 위해 // 윈도우 객체를 배열에 저장하는 경우가 있는데 이 경우 // 해당하는 모든 윈도우 객체의 참조를 삭제해 주어야 합니다. - win = null; - }); + win = null + }) } // 이 메서드는 Electron의 초기화가 끝나면 실행되며 브라우저 // 윈도우를 생성할 수 있습니다. 몇몇 API는 이 이벤트 이후에만 // 사용할 수 있습니다. -app.on('ready', createWindow); +app.on('ready', createWindow) // 모든 창이 닫히면 애플리케이션 종료. app.on('window-all-closed', () => { // macOS의 대부분의 애플리케이션은 유저가 Cmd + Q 커맨드로 확실하게 // 종료하기 전까지 메뉴바에 남아 계속 실행됩니다. if (process.platform !== 'darwin') { - app.quit(); + app.quit() } -}); +}) app.on('activate', () => { // macOS에선 보통 독 아이콘이 클릭되고 나서도 // 열린 윈도우가 없으면, 새로운 윈도우를 다시 만듭니다. if (win === null) { - createWindow(); + createWindow() } -}); +}) // 이 파일엔 제작할 애플리케이션에 특화된 메인 프로세스 코드를 // 포함할 수 있습니다. 또한 파일을 분리하여 require하는 방법으로 diff --git a/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md b/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md index bfe16a8..7394f1f 100644 --- a/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md +++ b/docs-translations/ko-KR/tutorial/using-pepper-flash-plugin.md @@ -1,4 +1,4 @@ -# Pepper 플래시 플러그인 사용하기 +# Pepper 플래시 플러그인 사용하기 Electron은 Pepper 플래시 플러그인을 지원합니다. Electron에서 Pepper 플래시 플러그인을 사용하려면 Pepper 플래시 플러그인의 위치를 지정한 후 애플리케이션 내에서 @@ -48,7 +48,7 @@ app.on('ready', () => { }) win.loadURL(`file://${__dirname}/index.html`) // 이외의 코드 -}); +}) ``` 직접 플러그인을 삽입하는 대신 시스템의 Pepper Flash 플러그인을 사용할 수도 있습니다. diff --git a/docs-translations/ko-KR/tutorial/using-selenium-and-webdriver.md b/docs-translations/ko-KR/tutorial/using-selenium-and-webdriver.md index fbc9739..e9b2294 100644 --- a/docs-translations/ko-KR/tutorial/using-selenium-and-webdriver.md +++ b/docs-translations/ko-KR/tutorial/using-selenium-and-webdriver.md @@ -1,4 +1,4 @@ -# Selenium 과 WebDriver 사용하기 +# Selenium 과 WebDriver 사용하기 [ChromeDriver - WebDriver for Chrome][chrome-driver]로부터 인용: @@ -79,7 +79,7 @@ $ npm install selenium-webdriver 실행파일의 위치를 전달합니다: ```javascript -const webdriver = require('selenium-webdriver'); +const webdriver = require('selenium-webdriver') const driver = new webdriver.Builder() // 작동하고 있는 크롬 드라이버의 포트 "9515"를 사용합니다. @@ -87,22 +87,22 @@ const driver = new webdriver.Builder() .withCapabilities({ chromeOptions: { // 여기에 사용중인 Electron 바이너리의 경로를 지정하세요. - binary: '/Path-to-Your-App.app/Contents/MacOS/Electron', + binary: '/Path-to-Your-App.app/Contents/MacOS/Electron' } }) .forBrowser('electron') - .build(); + .build() -driver.get('http://www.google.com'); -driver.findElement(webdriver.By.name('q')).sendKeys('webdriver'); -driver.findElement(webdriver.By.name('btnG')).click(); +driver.get('http://www.google.com') +driver.findElement(webdriver.By.name('q')).sendKeys('webdriver') +driver.findElement(webdriver.By.name('btnG')).click() driver.wait(() => { - return driver.getTitle().then((title) => { - return title === 'webdriver - Google Search'; - }); -}, 1000); + return driver.getTitle().then((title) => { + return title === 'webdriver - Google Search' + }) +}, 1000) -driver.quit(); +driver.quit() ``` ## WebdriverIO 설정하기 @@ -131,7 +131,7 @@ $ npm install webdriverio ### 3. 크롬 드라이버에 연결 ```javascript -const webdriverio = require('webdriverio'); +const webdriverio = require('webdriverio') let options = { host: 'localhost', // localhost에서 작동중인 크롬 드라이버 서버를 사용합니다. port: 9515, // 연결할 크롬 드라이버 서버의 포트를 설정합니다. @@ -142,9 +142,9 @@ let options = { args: [/* cli arguments */] // 선택 사항, 'app=' + /path/to/your/app/ } } -}; +} -let client = webdriverio.remote(options); +let client = webdriverio.remote(options) client .init() @@ -152,9 +152,9 @@ client .setValue('#q', 'webdriverio') .click('#btnG') .getTitle().then((title) => { - console.log('Title was: ' + title); + console.log('Title was: ' + title) }) - .end(); + .end() ``` ## 작업 환경 diff --git a/docs-translations/ko-KR/tutorial/using-widevine-cdm-plugin.md b/docs-translations/ko-KR/tutorial/using-widevine-cdm-plugin.md index 3be7f70..0c5a363 100644 --- a/docs-translations/ko-KR/tutorial/using-widevine-cdm-plugin.md +++ b/docs-translations/ko-KR/tutorial/using-widevine-cdm-plugin.md @@ -55,19 +55,19 @@ Linux에선 플러그인 바이너리들이 Chrome 브라우저와 함께 제공 // * macOS에선 `widevinecdmadapter.plugin`로 지정합니다, // * Linux에선 `libwidevinecdmadapter.so`로 지정합니다, // * Windows에선 `widevinecdmadapter.dll`로 지정합니다. -app.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevinecdmadapter.plugin'); +app.commandLine.appendSwitch('widevine-cdm-path', '/path/to/widevinecdmadapter.plugin') // 플러그인의 버전은 크롬의 `chrome://plugins` 페이지에서 취득할 수 있습니다. -app.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866'); +app.commandLine.appendSwitch('widevine-cdm-version', '1.4.8.866') -let win = null; +let win = null app.on('ready', () => { win = new BrowserWindow({ webPreferences: { // `plugins`은 활성화되어야 합니다. plugins: true } - }); -}); + }) +}) ``` ## 플러그인 작동 확인 -- 2.7.4