From de5bc32d0b4050548934aa52b4162fdbac888e70 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Wed, 8 Jul 2015 12:33:23 +0900 Subject: [PATCH 01/16] Fix typos, update some files --- README-ko.md | 3 +- docs/api/chrome-command-line-switches-ko.md | 40 +++++++++---------- docs/api/frameless-window-ko.md | 18 ++++----- docs/api/native-image-ko.md | 2 +- docs/api/remote-ko.md | 2 +- docs/api/shell-ko.md | 2 +- .../build-instructions-linux-ko.md | 8 ++++ docs/tutorial/application-packaging-ko.md | 4 +- docs/tutorial/devtools-extension-ko.md | 6 ++- docs/tutorial/using-native-node-modules-ko.md | 5 +-- 10 files changed, 47 insertions(+), 43 deletions(-) diff --git a/README-ko.md b/README-ko.md index 824bac66519e..fb38a44794c9 100644 --- a/README-ko.md +++ b/README-ko.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/atom/electron.svg?branch=master)](https://travis-ci.org/atom/electron) [![devDependency Status](https://david-dm.org/atom/electron/dev-status.svg)](https://david-dm.org/atom/electron#info=devDependencies) +[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/) ### [Electron](https://github.com/atom/electron/) 한국어 참조문서 @@ -34,7 +35,7 @@ npm install electron-prebuilt --save-dev ## 참조문서 [docs](https://github.com/atom/electron/tree/master/docs/README-ko.md) 에 프레임워크 사용 가이드와 API 레퍼런스가 있습니다. -추가적으로 Electron을 빌드 하는 방법과 프로젝트에 기여하는 방법도 문서에 포함되어 있으니 참고하기 바랍니다. +추가적으로 Electron을 빌드 하는 방법과 프로젝트에 기여하는 방법이 문서에 포함되어 있으니 참고하시기 바랍니다. ## 커뮤니티 diff --git a/docs/api/chrome-command-line-switches-ko.md b/docs/api/chrome-command-line-switches-ko.md index ca519ec6a2be..35ea805ccd4e 100644 --- a/docs/api/chrome-command-line-switches-ko.md +++ b/docs/api/chrome-command-line-switches-ko.md @@ -1,9 +1,8 @@ # 크롬 Command-Line 스위치 지원 -The following command lines switches in Chrome browser are also supported in -Electron, you can use [app.commandLine.appendSwitch][append-switch] to append -them in your app's main script before the [ready][ready] event of [app][app] -module is emitted: +다음 Command-Line 스위치들은 크롬 브라우저에서 제공되는 추가 옵션이며 Electron에서도 지원합니다. +[app][app]의 [ready][ready]이벤트가 작동하기 전에 [app.commandLine.appendSwitch][append-switch] API를 사용하면 +어플리케이션 내부에서 스위치들을 추가할 수 있습니다: ```javascript var app = require('app'); @@ -17,35 +16,33 @@ app.on('ready', function() { ## --client-certificate=`path` -Sets `path` of client certificate file. +`path`를 클라이언트 인증서로 설정합니다. ## --ignore-connections-limit=`domains` -Ignore the connections limit for `domains` list seperated by `,`. +`domains` 리스트(`,`로 구분)의 연결 제한을 무시합니다. ## --disable-http-cache -Disables the disk cache for HTTP requests. +HTTP 요청 캐시를 비활성화 합니다. ## --remote-debugging-port=`port` -Enables remote debug over HTTP on the specified `port`. +지정한 `port`에 HTTP기반의 리모트 디버거를 활성화 시킵니다. (개발자 콘솔) ## --proxy-server=`address:port` -Uses a specified proxy server, overrides system settings. This switch only -affects HTTP and HTTPS requests. +시스템 설정의 프록시 서버를 무시하고 지정한 서버로 연결합니다. HTTP와 HTTPS 요청에만 적용됩니다. ## --no-proxy-server -Don't use a proxy server, always make direct connections. Overrides any other -proxy server flags that are passed. +프록시 서버를 사용하지 않습니다. 다른 프록시 서버 플래그 및 설정을 무시하고 언제나 직접 연결을 사용합니다. ## --host-rules=`rules` -Comma-separated list of `rules` that control how hostnames are mapped. +Hostname 맵핑 규칙을 설정합니다. (`,`로 분리) -For example: +예시: * `MAP * 127.0.0.1` Forces all hostnames to be mapped to 127.0.0.1 * `MAP *.google.com proxy` Forces all google.com subdomains to be resolved to @@ -61,7 +58,7 @@ connection, and the endpoint host in a `SOCKS` proxy connection). ## --host-resolver-rules=`rules` -Like `--host-rules` but these `rules` only apply to the host resolver. +`--host-rules` 플래그와 비슷하지만 이 플래그는 host resolver에만 적용됩니다. [app]: app-ko.md [append-switch]: app-ko.md#appcommandlineappendswitchswitch-value @@ -69,26 +66,25 @@ Like `--host-rules` but these `rules` only apply to the host resolver. ## --ignore-certificate-errors -Ignores certificate related errors. +인증서 에러를 무시합니다. ## --ppapi-flash-path=`path` -Sets `path` of pepper flash plugin. +Pepper 플래시 플러그인의 위치를 설정합니다. ## --ppapi-flash-version=`version` -Sets `version` of pepper flash plugin. +Pepper 플래시 플러그인의 버전을 설정합니다. ## --log-net-log=`path` -Enables saving net log events and writes them to `path`. +Net log 이벤트를 지정한 `path`에 로그로 기록합니다. ## --v=`log_level` -Gives the default maximal active V-logging level; 0 is the default. Normally -positive values are used for V-logging levels. +기본 V-logging 최대 활성화 레벨을 지정합니다. 기본값은 0입니다. 기본적으로 양수를 레벨로 사용합니다. -Passing `--v=-1` will disable logging. +`--v=-1`를 사용하면 로깅이 비활성화 됩니다. ## --vmodule=`pattern` diff --git a/docs/api/frameless-window-ko.md b/docs/api/frameless-window-ko.md index 31982c07e672..8315f48ec8ee 100644 --- a/docs/api/frameless-window-ko.md +++ b/docs/api/frameless-window-ko.md @@ -1,19 +1,17 @@ # Frameless window -A frameless window is a window that has no chrome. +frameless window는 테두리가 없는 윈도우 창을 말합니다. -## Create a frameless window - -To create a frameless window, you only need to specify `frame` to `false` in -[BrowserWindow](browser-window-ko.md)'s `options`: +## Frameless window 만들기 +Frameless window를 만드려면 [BrowserWindow](browser-window-ko.md) 객체의 `options`에서 `frame` 옵션을 `false`로 지정하기만 하면됩니다: ```javascript var BrowserWindow = require('browser-window'); var win = new BrowserWindow({ width: 800, height: 600, frame: false }); ``` -## Transparent window +## 투명한 윈도우 By setting the `transparent` option to `true`, you can also make the frameless window transparent: @@ -22,7 +20,7 @@ window transparent: var win = new BrowserWindow({ transparent: true, frame: false }); ``` -### Limitations +### API의 한계 * You can not click through the transparent area, we are going to introduce an API to set window shape to solve this, but currently blocked at an @@ -38,7 +36,7 @@ var win = new BrowserWindow({ transparent: true, frame: false }); drivers](https://code.google.com/p/chromium/issues/detail?id=369209) on Linux. * On Mac the native window shadow will not show for transparent window. -## Draggable region +## 드래그 가능 위치 지정 By default, the frameless window is non-draggable. Apps need to specify `-webkit-app-region: drag` in CSS to tell Electron which regions are draggable @@ -67,7 +65,7 @@ button { If you're only using a custom titlebar, you also need to make buttons in titlebar non-draggable. -## Text selection +## 텍스트 선택 One thing on frameless window is that the dragging behaviour may conflict with selecting text, for example, when you drag the titlebar, you may accidentally @@ -81,7 +79,7 @@ selection on dragging area like this: } ``` -## Context menu +## 컨텍스트 메뉴 On some platforms, the draggable area would be treated as non-client frame, so when you right click on it a system menu would be popuped. To make context menu diff --git a/docs/api/native-image-ko.md b/docs/api/native-image-ko.md index 45bef9956f6e..192bbcfb6252 100644 --- a/docs/api/native-image-ko.md +++ b/docs/api/native-image-ko.md @@ -102,7 +102,7 @@ var appIcon = new Tray('/Users/somebody/images/icon.png'); ### NativeImage.toJpeg(quality) -* `quality` Integer +* `quality` Integer (0 - 100 사이의 값) `JPEG` 이미지를 인코딩한 데이터를 [Buffer][buffer]로 반환합니다. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md index c42c60d35d9e..0feb53ece5ee 100644 --- a/docs/api/remote-ko.md +++ b/docs/api/remote-ko.md @@ -142,7 +142,7 @@ Returns the object returned by `require(module)` in the main process. Returns the [BrowserWindow](browser-window-ko.md) object which this web page belongs to. -## remote.getCurrentWebContent() +## remote.getCurrentWebContents() Returns the WebContents object of this web page. diff --git a/docs/api/shell-ko.md b/docs/api/shell-ko.md index 2c312465335a..5811afdcb930 100644 --- a/docs/api/shell-ko.md +++ b/docs/api/shell-ko.md @@ -25,7 +25,7 @@ shell.openExternal('https://github.com'); * `url` String -제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를들어 mailto: URL은 해당 URL을 기본 메일 에이전트로 엽니다.) +제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를 들어 mailto: URL은 해당 URL을 기본 메일 에이전트로 엽니다.) 역자주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) ## shell.moveItemToTrash(fullPath) diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index d70e27967ea6..ec955f3439a7 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -44,6 +44,14 @@ $ cd electron $ ./script/bootstrap.py -v ``` +### 크로스 컴파일 + +크로스 컴파일을 하려면 `bootstrap.py` 스크립트의 `--target_arch` 파라미터에 `arm` 또는 `ia32` 타겟 아키텍쳐를 전달하면 됩니다. + +```bash +$ ./script/bootstrap.py -v --target_arch=arm +``` + ## 빌드 하기 `Release` 와 `Debug` 두 타겟 모두 빌드 합니다: diff --git a/docs/tutorial/application-packaging-ko.md b/docs/tutorial/application-packaging-ko.md index da72a9b2954a..4d00eb8c814a 100644 --- a/docs/tutorial/application-packaging-ko.md +++ b/docs/tutorial/application-packaging-ko.md @@ -31,7 +31,7 @@ Electron은 Node.js로 부터 제공된 Node API와 Chromium으로부터 제공 `fs.readFile` 와 `require` 같은 Node API들을 지원하기 위해 Electron에선 `asar` 아카이브가 가상의 디렉터리 구조를 가지도록 패치했습니다. 그래서 아카이브 내부에서 리소스들을 정상적인 파일 시스템처럼 접근할 수 있습니다. -예를들어 `/path/to`라는 경로에 `example.asar`라는 아카이브가 있다고 가정하면: +예를 들어 `/path/to`라는 경로에 `example.asar`라는 아카이브가 있다고 가정하면: ```bash $ asar list /path/to/example.asar @@ -76,7 +76,7 @@ win.loadUrl('file:///path/to/example.asar/static/index.html'); 웹 페이지 내에선 아카이브 내의 파일을 `file:` 프로토콜을 사용하여 요청할 수 있습니다. 이 또한 Node API와 같이 가상 디렉터리 구조를 가집니다. -예를들어 jQuery의 `$.get`을 사용하여 파일을 가져올 수 있습니다: +예를 들어 jQuery의 `$.get`을 사용하여 파일을 가져올 수 있습니다: ```html ``` -Another example of creating the application menu with the simple template API: +다음 예제는 template API를 활용하여 어플리케이션 메뉴를 만드는 간단한 예제입니다: ```html @@ -167,34 +165,30 @@ Menu.setApplicationMenu(menu); ### new Menu() -Creates a new menu. +새로운 메뉴를 생성합니다. ### Class Method: Menu.setApplicationMenu(menu) * `menu` Menu -Sets `menu` as the application menu on OS X. On Windows and Linux, the `menu` -will be set as each window's top menu. +지정한 `menu`를 이용하여 어플리케이션 메뉴를 만듭니다. OS X에선 상단바에 표시되며 Windows와 Linux에선 각 창의 상단에 표시됩니다. ### Class Method: Menu.sendActionToFirstResponder(action) * `action` String -Sends the `action` to the first responder of application, this is used for -emulating default Cocoa menu behaviors, usually you would just use the -`selector` property of `MenuItem`. +`action`을 어플리케이션의 first responder에 전달합니다. +이 함수는 Cocoa 메뉴 동작을 에뮬레이트 하는데 사용되며 보통 `MenuItem`의 `selector` 속성에 사용됩니다. -**Note:** This method is OS X only. +**알림:** 이 함수는 OS X에서만 사용할 수 있습니다. ### Class Method: Menu.buildFromTemplate(template) * `template` Array -Generally, the `template` is just an array of `options` for constructing -[MenuItem](menu-item-ko.md), the usage can be referenced above. +기본적으로 `template`는 [MenuItem](menu-item-ko.md)을 생성할 때 사용하는 `options`의 배열입니다. 사용법은 위에서 설명한 것과 같습니다. -You can also attach other fields to element of the `template`, and they will -become properties of the constructed menu items. +또한 `template`에는 다른 속성도 추가할 수 있으며 메뉴가 만들어질 때 해당 메뉴 아이템의 프로퍼티로 변환됩니다. ### Menu.popup(browserWindow, [x, y]) @@ -202,86 +196,70 @@ become properties of the constructed menu items. * `x` Number * `y` Number -Popups this menu as a context menu in the `browserWindow`. You can optionally -provide a `(x,y)` coordinate to place the menu at, otherwise it will be placed -at the current mouse cursor position. +메뉴를 `browserWindow` 안에서 팝업으로 표시합니다. +옵션으로 메뉴를 표시할 `(x,y)` 좌표를 임의로 지정할 수 있습니다. 따로 지정하지 않은 경우 마우스 커서 위치에 표시됩니다. ### Menu.append(menuItem) * `menuItem` MenuItem -Appends the `menuItem` to the menu. +메뉴의 리스트 끝에 `menuItem`을 삽입합니다. ### Menu.insert(pos, menuItem) * `pos` Integer * `menuItem` MenuItem -Inserts the `menuItem` to the `pos` position of the menu. +`pos` 위치에 `menuItem`을 삽입합니다. ### Menu.items -Get the array containing the menu's items. +메뉴가 가지고 있는 메뉴 아이템들의 배열입니다. -## Notes on OS X application menu +## OS X 어플리케이션 메뉴에 대해 알아 둬야 할 것들 -OS X has a completely different style of application menu from Windows and -Linux, and here are some notes on making your app's menu more native-like. +OS X에선 Windows, Linux와 달리 완전히 다른 어플리케이션 메뉴 스타일을 가지고 있습니다. +어플리케이션을 네이티브처럼 작동할 수 있도록 하기 위해선 다음의 몇 가지 유의 사항을 숙지해야 합니다. -### Standard menus +### 기본 메뉴 -On OS X there are many system defined standard menus, like the `Services` and -`Windows` menus. To make your menu a standard menu, you can just set your menu's -label to one of followings, and Electron will recognize them and make them -become standard menus: +OS X엔 `Services`나 `Windows`와 같은 많은 시스템 지정 기본 메뉴가 있습니다. +기본 메뉴를 만들려면 다음 중 하나를 메뉴의 라벨로 지정하기만 하면 됩니다. +그러면 Electron이 자동으로 인식하여 해당 메뉴를 기본 메뉴로 만듭니다: * `Window` * `Help` * `Services` -### Standard menu item actions +### 기본 메뉴 아이템 동작 -OS X has provided standard actions for some menu items (which are called -`selector`s), like `About xxx`, `Hide xxx`, and `Hide Others`. To set the action -of a menu item to a standard action, you can set the `selector` attribute of the -menu item. +OS X는 몇몇의 메뉴 아이템에 대해 `About xxx`, `Hide xxx`, `Hide Others`와 같은 기본 동작을 제공하고 있습니다. (`selector`라고 불립니다) +메뉴 아이템의 기본 동작을 지정하려면 메뉴 아이템의 `selector` 속성을 사용하면 됩니다. -### Main menu's name +### 메인 메뉴의 이름 -On OS X the label of application menu's first item is always your app's name, -no matter what label you set. To change it you have to change your app's name -by modifying your app bundle's `Info.plist` file. See -[About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html) -for more. +OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번째 라벨은 언제나 어플리케이션의 이름이 됩니다. +어플리케이션 이름을 변경하려면 앱 번들내의 `Info.plist` 파일을 수정해야합니다. +자세한 내용은 [About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html)을 참고하세요. +## 메뉴 아이템 위치 -## Menu item position +`Menu.buildFromTemplate`로 메뉴를 만들 때 `position`과 `id`를 사용해서 아이템의 위치를 지정할 수 있습니다. -You can make use of `position` and `id` to control how the item would be placed -when building a menu with `Menu.buildFromTemplate`. +`MenuItem`의 `position` 속성은 `[placement]=[id]`와 같은 형식을 가지며 `placement`는 +`before`, `after`, `endof` 속성 중 한가지를 사용할 수 있고 `id`는 메뉴 아이템이 가지는 유일 ID 입니다: -The `position` attribute of `MenuItem` has the form `[placement]=[id]` where -placement is one of `before`, `after`, or `endof` and `id` is the unique ID of -an existing item in the menu: +* `before` - 이 아이템을 지정한 id 이전의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. +* `after` - 이 아이템을 지정한 id 다음의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. +* `endof` - 이 아이템을 id의 논리 그룹에 맞춰서 각 그룹의 항목 뒤에 삽입합니다. (그룹은 분리자 아이템에 의해 만들어집니다) + 만약 참조된 아이템의 분리자 그룹이 존재하지 않을 경우 지정된 id로 새로운 분리자 그룹을 만든 후 해당 그룹의 뒤에 삽입됩니다. -* `before` - Inserts this item before the id referenced item. If the - referenced item doesn't exist the item will be inserted at the end of - the menu. -* `after` - Inserts this item after id referenced item. If the referenced - item doesn't exist the item will be inserted at the end of the menu. -* `endof` - Inserts this item at the end of the logical group containing - the id referenced item. (Groups are created by separator items). If - the referenced item doesn't exist a new separator group is created with - the given id and this item is inserted after that separator. +위치를 지정한 아이템의 뒤에 위치가 지정되지 않은 아이템이 있을 경우 해당 아이템의 위치가 지정되기 전까지 이전에 위치가 지정된 아이템의 위치 지정을 따릅니다. +이에 따라 위치를 이동하고 싶은 특정 그룹의 아이템들이 있을 경우 해당 그룹의 맨 첫번째 메뉴 아이템의 위치만을 지정하면 됩니다. -When an item is positioned following unpositioned items are inserted after -it, until a new item is positioned. So if you want to position a group of -menu items in the same location you only need to specify a position for -the first item. +### 예제 -### Examples - -Template: +메뉴 템플릿: ```javascript [ @@ -293,7 +271,7 @@ Template: ] ``` -Menu: +메뉴: ``` - 1 @@ -303,7 +281,7 @@ Menu: - 5 ``` -Template: +메뉴 템플릿: ```javascript [ @@ -316,7 +294,7 @@ Template: ] ``` -Menu: +메뉴: ``` - --- diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md index 26fc4eb740c4..20243ab95824 100644 --- a/docs/api/protocol-ko.md +++ b/docs/api/protocol-ko.md @@ -19,18 +19,20 @@ app.on('ready', function() { **알림:** 이 모듈은 app의 `ready` 이벤트가 발생한 이후에만 사용할 수 있습니다. -## protocol.registerProtocol(scheme, handler) +## protocol.registerProtocol(scheme, handler, callback) * `scheme` String * `handler` Function +* `callback` Function -지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler` 함수가 호출됩니다. +지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. `handler`는 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler(request)` 형식으로 호출됩니다. -호출된 `handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 할 필요가 있습니다. +`handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 합니다. -## protocol.unregisterProtocol(scheme) +## protocol.unregisterProtocol(scheme, callback) * `scheme` String +* `callback` Function 지정한 `scheme` 프로토콜을 등록 해제합니다. @@ -40,23 +42,27 @@ app.on('ready', function() { 지정한 `value` 배열을 사용하여 미리 지정된 스킴으로 등록합니다. -## protocol.isHandledProtocol(scheme) +## protocol.isHandledProtocol(scheme, callback) * `scheme` String +* `callback` Function 해당 `scheme`에 처리자(handler)가 등록되었는지 확인합니다. +지정한 `callback`에 결과가 boolean 값으로 반환됩니다. -## protocol.interceptProtocol(scheme, handler) +## protocol.interceptProtocol(scheme, handler, callback) * `scheme` String * `handler` Function +* `callback` Function 지정한 `scheme`의 작업을 `handler`로 변경합니다. `handler`에서 `null` 또는 `undefined`를 반환 할 경우 해당 프로토콜의 기본 동작(응답)으로 대체 됩니다. -## protocol.uninterceptProtocol(scheme) +## protocol.uninterceptProtocol(scheme, callback) * `scheme` String +* `callback` Function 변경된 프로토콜의 작업을 해제합니다. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md index 0feb53ece5ee..11d62dd27194 100644 --- a/docs/api/remote-ko.md +++ b/docs/api/remote-ko.md @@ -1,7 +1,6 @@ # remote -The `remote` module provides a simple way to do inter-process communication -between the renderer process and the main process. +`remote` 모듈은 메인 프로세스와 랜더러 프로세스 사이에 inter-process 통신을 하기 위한 가장 간단한 방법입니다. In Electron, only GUI-unrelated modules are available in the renderer process. Without the `remote` module, users who wanted to call a main process API in diff --git a/docs/api/screen-ko.md b/docs/api/screen-ko.md index c554863586cc..6b508991e4f7 100644 --- a/docs/api/screen-ko.md +++ b/docs/api/screen-ko.md @@ -1,13 +1,14 @@ # screen -Gets various info about screen size, displays, cursor position, etc. You should -not use this module until the `ready` event of `app` module gets emitted. +`screen` 모듈은 화면 크기, 디스플레이, 커서 위치 등등의 다양한 정보를 가져옵니다. +이 모듈은 `app` 모듈의 `ready` 이벤트가 발생하기 전까지 사용할 수 없습니다. -`screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). +`screen`은 [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)를 상속 받았습니다. -Make sure to note that in the renderer / DevTools, `window.screen` is a reserved DOM property, so writing `screen = require('screen')` won't work. In our examples below, we use `atomScreen` as the variable name instead. +한가지 주의할 점은 랜더러 / DevTools에선 이 모듈의 이름인 `screen`은 이미 DOM 속성에 `window.screen`로 존재 하므로 `screen = require('screen')`를 +사용할 수 없습니다. 밑의 예제와 같이 `atomScreen`등의 이름으로 변수 이름을 대체하여 사용해야 합니다. -An example of creating a window that fills the whole screen: +다음 예제는 화면 전체를 채우는 윈도우 창을 생성합니다: ```javascript var app = require('app'); @@ -22,7 +23,7 @@ app.on('ready', function() { }); ``` -Another example of creating a window in the external display: +다음 예제는 확장 디스플레이에 윈도우를 생성합니다: ```javascript var app = require('app'); @@ -55,14 +56,14 @@ app.on('ready', function() { * `event` Event * `newDisplay` Object -Emitted when `newDisplay` has been added. +새로운 디스플레이가 추가되면 발생합니다. ## Event: display-removed * `event` Event * `oldDisplay` Object -Emitted when `oldDisplay` has been removed. +기존의 디스플레이가 제거되면 발생합니다. ## Event: display-metrics-changed @@ -70,21 +71,21 @@ Emitted when `oldDisplay` has been removed. * `display` Object * `changedMetrics` Array -Emitted when a `display` has one or more metrics changed, `changedMetrics` is -an array of strings that describe the changes. Possible changes are `bounds`, -`workArea`, `scaleFactor` and `rotation`. +`display`의 하나 또는 다수의 매트릭스가 변경될 경우 발생합니다. +`changedMetrics`는 변경에 대한 정보를 담은 문자열의 배열입니다. +`bounds`, `workArea`, `scaleFactor`, `rotation`등이 변경될 수 있습니다. ## screen.getCursorScreenPoint() -Returns the current absolute position of the mouse pointer. +현재 마우스 포인터의 절대 위치를 반환합니다. ## screen.getPrimaryDisplay() -Returns the primary display. +기본 디스플레이를 반환합니다. ## screen.getAllDisplays() -Returns an array of displays that are currently available. +사용 가능한 모든 디스플레이를 배열로 반환합니다. ## screen.getDisplayNearestPoint(point) @@ -92,7 +93,7 @@ Returns an array of displays that are currently available. * `x` Integer * `y` Integer -Returns the display nearest the specified point. +지정한 좌표에 가까운 디스플레이를 반환합니다. ## screen.getDisplayMatching(rect) @@ -102,4 +103,4 @@ Returns the display nearest the specified point. * `width` Integer * `height` Integer -Returns the display that most closely intersects the provided bounds. +지정한 범위에 가장 가깝게 교차한 디스플레이를 반환합니다. diff --git a/docs/api/shell-ko.md b/docs/api/shell-ko.md index 5811afdcb930..d9ceea106a54 100644 --- a/docs/api/shell-ko.md +++ b/docs/api/shell-ko.md @@ -26,7 +26,7 @@ shell.openExternal('https://github.com'); * `url` String 제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를 들어 mailto: URL은 해당 URL을 기본 메일 에이전트로 엽니다.) -역자주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) +역주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) ## shell.moveItemToTrash(fullPath) diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index ec955f3439a7..3d7f9389f77b 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -89,7 +89,16 @@ $ ./script/clean.py ## 문제 해결 -개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. +개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. + +## libtinfo.so.5 동적 링크 라이브러리를 로드하는 도중 에러가 발생할 경우 + +미리 빌드된 `clang`은 `libtinfo.so.5`로 링크를 시도합니다. +플랫폼에 따라 적당한 `libncurses` symlink를 추가하세요. + +```bash +$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5 +``` ## 테스트 diff --git a/docs/development/build-system-overview-ko.md b/docs/development/build-system-overview-ko.md index 92fd50008529..7198fa831b92 100644 --- a/docs/development/build-system-overview-ko.md +++ b/docs/development/build-system-overview-ko.md @@ -25,9 +25,14 @@ Electron도 상당히 비슷한 접근을 했습니다: ## 부트스트랩 최소화 -모든 사전 빌드 된 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. +Prebuilt된 모든 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. 기본적으로 공유 라이브러리와 정적 라이브러리 모두 다운로드되며 최종 전체 파일 크기는 플랫폼에 따라 800MB에서 2GB까지 차지합니다. +기본적으로 libchromiumcontent는 Amazon Web Service를 통해 다운로드 됩니다. +만약 `LIBCHROMIUMCONTENT_MIRROR` 환경 변수가 설정되어 있으면 부트스트랩은 해당 링크를 사용하여 바이너리를 다운로드 합니다. +[libchromiumcontent-qiniu-mirror](https://github.com/hokein/libchromiumcontent-qiniu-mirror)는 libchromiumcontent의 미러입니다. +만약 AWS에 접근할 수 없다면 `export LIBCHROMIUMCONTENT_MIRROR=http://7xk3d2.dl1.z0.glb.clouddn.com/`를 통해 다운로드 할 수 있습니다. + 만약 빠르게 Electron의 개발 또는 테스트만 하고 싶다면 `--dev` 플래그를 추가하여 공유 라이브러리만 다운로드할 수 있습니다: ```bash diff --git a/docs/tutorial/application-distribution-ko.md b/docs/tutorial/application-distribution-ko.md index a1bb5bc65044..0b6ff631ad70 100644 --- a/docs/tutorial/application-distribution-ko.md +++ b/docs/tutorial/application-distribution-ko.md @@ -99,7 +99,7 @@ MyApp.app/Contents 실행파일 `electron`의 이름을 원하는 대로 바꿀 수 있습니다. 리눅스 어플리케이션의 아이콘은 [.desktop](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) 파일을 사용하여 지정할 수 있습니다. -### 역자주-자동화 +### 역주-자동화 배포시에 Electron의 리소스를 일일이 수정하는 것은 매우 귀찮고 복잡합니다. 하지만 이 작업을 자동화 시킬 수 있는 몇가지 방법이 있습니다: diff --git a/docs/tutorial/quick-start-ko.md b/docs/tutorial/quick-start-ko.md index e5ef8662cd7a..a49b7e017609 100644 --- a/docs/tutorial/quick-start-ko.md +++ b/docs/tutorial/quick-start-ko.md @@ -75,6 +75,8 @@ var mainWindow = null; // 모든 창이 닫히면 어플리케이션 종료. app.on('window-all-closed', function() { + // OSX의 대부분의 어플리케이션에선 유저가 Cmd + Q 커맨드로 확실하게 종료하기 전까지는 + // 어플리케이션이 메뉴바에 남아 계속 실행됩니다. if (process.platform != 'darwin') { app.quit(); } @@ -112,16 +114,16 @@ app.on('ready', function() {

헬로 월드!

- 우리는 io.js 버전과 - Electron 버전을 사용합니다. + 이 어플리케이션은 io.js 과 + Electron 을 사용합니다. ``` ## 앱 실행하기 -앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 -패키징한 앱을 실행해 볼 수 있습니다. 또한 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. +앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 패키징한 앱을 실행할 수 있습니다. +또는 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. Windows의 경우: diff --git a/docs/tutorial/using-native-node-modules-ko.md b/docs/tutorial/using-native-node-modules-ko.md index da68c475ba83..1e67ee25305d 100644 --- a/docs/tutorial/using-native-node-modules-ko.md +++ b/docs/tutorial/using-native-node-modules-ko.md @@ -1,6 +1,6 @@ # 네이티브 node 모듈 사용하기 -__역자주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ +__역주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ Electron에선 node.js 네이티브 모듈이 지원됩니다. 하지만 Electron은 공식 node.js의 V8 엔진과는 달리 다른 V8 버전을 사용합니다. 그런 이유로 네이티브 모듈을 사용하기 위해선 Electron의 V8 버전에 맞춰 네이티브 모듈을 다시 빌드하고 헤더를 변경해야 합니다. @@ -34,11 +34,11 @@ Node 모듈을 `node-gyp`를 사용하여 Electron을 타겟으로 빌드할 땐 ```bash $ cd /path-to-module/ -$ HOME=~/.electron-gyp node-gyp rebuild --target=0.25.0 --arch=ia64 --dist-url=https://atom.io/download/atom-shell +$ HOME=~/.electron-gyp node-gyp rebuild --target=0.29.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell ``` -`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.25.0`은 Electron의 버전입니다. -`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=ia64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. +`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.29.1`은 Electron의 버전입니다. +`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=x64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. ### npm을 이용한 방법 @@ -47,7 +47,7 @@ $ HOME=~/.electron-gyp node-gyp rebuild --target=0.25.0 --arch=ia64 --dist-url=h ```bash export npm_config_disturl=https://atom.io/download/atom-shell -export npm_config_target=0.25.0 +export npm_config_target=0.29.1 export npm_config_arch=x64 HOME=~/.electron-gyp npm install module-name ``` From eb81810a52498e73b224a63dbf241248f6a9daad Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Sun, 12 Jul 2015 12:53:28 +0900 Subject: [PATCH 03/16] Revert "Update APIs, check grammars" This reverts commit d1eb971263f72deae84541d12b3bdd6d5972365a. --- docs/README-ko.md | 5 +- docs/api/app-ko.md | 4 - docs/api/auto-updater-ko.md | 2 +- docs/api/chrome-command-line-switches-ko.md | 20 +-- docs/api/clipboard-ko.md | 15 --- docs/api/content-tracing-ko.md | 6 +- docs/api/crash-reporter-ko.md | 63 +++++----- docs/api/dialog-ko.md | 72 ++++++----- docs/api/frameless-window-ko.md | 68 ++++++----- docs/api/menu-ko.md | 114 +++++++++++------- docs/api/protocol-ko.md | 20 ++- docs/api/remote-ko.md | 3 +- docs/api/screen-ko.md | 33 +++-- docs/api/shell-ko.md | 2 +- .../build-instructions-linux-ko.md | 11 +- docs/development/build-system-overview-ko.md | 7 +- docs/tutorial/application-distribution-ko.md | 2 +- docs/tutorial/quick-start-ko.md | 10 +- docs/tutorial/using-native-node-modules-ko.md | 10 +- 19 files changed, 232 insertions(+), 235 deletions(-) diff --git a/docs/README-ko.md b/docs/README-ko.md index 6e0daa59fd2b..50c4b2c9c9ca 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -67,6 +67,5 @@ * [빌드 설명서 (Linux)](development/build-instructions-linux-ko.md) * [디버거에서 디버그 심볼 서버 설정](development/setting-up-symbol-server-ko.md) -이 참조문서는 [@preco21](https://github.com/preco21)에 의해 번역되었습니다. -문서내에서 오타나 잘못된 번역을 발견하면 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. -원본과는 달리 항시 최신버전을 유지할 수 없으므로 원본을 같이 참고하는 것을 권장합니다. +이 문서는 [@preco21](https://github.com/preco21) 에 의해 번역되었습니다. +문서내에서 오타나 잘못된 번역이 발견될 경우 해당 repo를 fork한 후 수정하여 PR을 올리거나 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. diff --git a/docs/api/app-ko.md b/docs/api/app-ko.md index 434d0620282a..293cfd965a39 100644 --- a/docs/api/app-ko.md +++ b/docs/api/app-ko.md @@ -139,10 +139,6 @@ This method guarantees all `beforeunload` and `unload` handlers are correctly executed. It is possible that a window cancels the quitting by returning `false` in `beforeunload` handler. -## app.getAppPath() - -Returns the current application directory. - ## app.getPath(name) * `name` String diff --git a/docs/api/auto-updater-ko.md b/docs/api/auto-updater-ko.md index bcfc3b562682..0894fc3485fb 100644 --- a/docs/api/auto-updater-ko.md +++ b/docs/api/auto-updater-ko.md @@ -1,6 +1,6 @@ # auto-updater -**이 모듈은 현재 OS X에서만 사용할 수 있습니다.** +**This module has only been implemented for OS X.** Check out [atom/grunt-electron-installer](https://github.com/atom/grunt-electron-installer) for building a Windows installer for your app. diff --git a/docs/api/chrome-command-line-switches-ko.md b/docs/api/chrome-command-line-switches-ko.md index ed8cf55e06ec..35ea805ccd4e 100644 --- a/docs/api/chrome-command-line-switches-ko.md +++ b/docs/api/chrome-command-line-switches-ko.md @@ -51,8 +51,10 @@ Hostname 맵핑 규칙을 설정합니다. (`,`로 분리) also force the port of the resulting socket address to be 77. * `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for "www.google.com". - -이 맵핑은 네트워크 요청시의 endpoint를 지정합니다. (TCP 연결과 직접 연결의 호스트 resolver, http 프록시 연결의 `CONNECT`, `SOCKS` 프록시 연결의 endpoint 호스트) + +These mappings apply to the endpoint host in a net request (the TCP connect +and host resolver in a direct connection, and the `CONNECT` in an http proxy +connection, and the endpoint host in a `SOCKS` proxy connection). ## --host-resolver-rules=`rules` @@ -86,14 +88,16 @@ Net log 이벤트를 지정한 `path`에 로그로 기록합니다. ## --vmodule=`pattern` -`--v` 옵션에 전달된 값을 덮어쓰고 모듈당 최대 V-logging 레벨을 지정합니다. -예를 들어 `my_module=2,foo*=3`는 `my_module.*`, `foo*.*`와 같은 파일 이름 패턴을 가진 모든 소스 코드들의 로깅 레벨을 각각 2와 3으로 설정합니다. +Gives the per-module maximal V-logging levels to override the value given by +`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in +source files `my_module.*` and `foo*.*`. -슬래시(`/`), 백슬래시(`\`)를 포함하는 모든 패턴은 모듈뿐만 아니라 모든 경로명에 대해서도 테스트 됩니다. -예를 들어 `*/foo/bar/*=2` 표현식은 `foo/bar` 디렉터리 안의 모든 소스 코드의 로깅 레벨을 2로 지정합니다. - -모든 크로미움과 관련된 로그를 비활성화하고 어플리케이션의 로그만 활성화 하려면 다음과 같이 코드를 작성하면 됩니다: +Any pattern containing a forward or backward slash will be tested against the +whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the +logging level for all code in source files under a `foo/bar` directory. +To disable all chromium related logs and only enable your application logs you +can do: ```javascript app.commandLine.appendSwitch('v', -1); diff --git a/docs/api/clipboard-ko.md b/docs/api/clipboard-ko.md index bc6c82786cb7..3ee0164e9759 100644 --- a/docs/api/clipboard-ko.md +++ b/docs/api/clipboard-ko.md @@ -86,18 +86,3 @@ console.log(clipboard.has('

selection

')); 클립보드로부터 `data`를 읽어들입니다. **알림:** 이 API는 실험적인 기능이며 차후 최신버전에서 제외될 수 있습니다. - -## clipboard.write(data[, type]) - -* `data` Object - * `text` String - * `html` String - * `image` [NativeImage](native-image.md) -* `type` String - -```javascript -var clipboard = require('clipboard'); -clipboard.write({text: 'test', html: "test"}); -``` - -`data`를 클립보드에 씁니다. diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md index e9fa3158a2fb..a0896c2a7182 100644 --- a/docs/api/content-tracing-ko.md +++ b/docs/api/content-tracing-ko.md @@ -1,7 +1,9 @@ # content-tracing -`content-trace` 모듈은 Chromium 컨텐츠 모듈단에서 생성된 데이터를 수집하고 추적하는데 사용됩니다. -이 모듈은 웹 인터페이스를 포함하고 있지 않으며 크롬 브라우저에서 `chrome://tracing/` 페이지를 열어 생성된 파일을 로드하면 결과를 볼 수 있습니다. +The `content-trace` module is used to collect tracing data generated by the +underlying Chromium content module. This module does not include a web interface +so you need to open `chrome://tracing/` in a Chrome browser and load the generated +file to view the result. ```javascript var tracing = require('content-tracing'); diff --git a/docs/api/crash-reporter-ko.md b/docs/api/crash-reporter-ko.md index b8c076a7ceae..1302d9b457e2 100644 --- a/docs/api/crash-reporter-ko.md +++ b/docs/api/crash-reporter-ko.md @@ -1,6 +1,6 @@ # crash-reporter -다음 예제는 윈격 서버에 어플리케이션 오류 정보를 자동으로 보고하는 예제입니다: +An example of automatically submitting crash reporters to remote server: ```javascript crashReporter = require('crash-reporter'); @@ -15,46 +15,47 @@ crashReporter.start({ ## crashReporter.start(options) * `options` Object - * `productName` String, 기본값: Electron - * `companyName` String, 기본값: GitHub, Inc - * `submitUrl` String, 기본값: http://54.249.141.255:1127/post - * Crash Reporter는 POST 방식으로 해당 URL에 전송됩니다. - * `autoSubmit` Boolean, 기본값: true - * true로 지정할 경우 유저의 승인 없이 자동으로 오류를 보고합니다. - * `ignoreSystemCrashHandler` Boolean, 기본값: false + * `productName` String, default: Electron + * `companyName` String, default: GitHub, Inc + * `submitUrl` String, default: http://54.249.141.255:1127/post + * URL that crash reports would be sent to as POST + * `autoSubmit` Boolean, default: true + * Send the crash report without user interaction + * `ignoreSystemCrashHandler` Boolean, default: false * `extra` Object - * 오류보고 시 같이 보낼 추가 정보를 지정하는 객체입니다. - * 문자열로 된 속성만 정상적으로 보내집니다. - * 중첩 객체는 지원되지 않습니다. (Nested objects are not supported) - -다른 crashReporter API들을 사용하기 전에 이 함수를 먼저 호출해야 합니다. + * An object you can define which content will be send along with the report. + * Only string properties are send correctly. + * Nested objects are not supported. + +Developers are required to call the API before using other crashReporter APIs. -**알림:** OS X에선 Windows와 Linux의 `breakpad`와 달리 새로운 `crashpad` 클라이언트를 사용합니다. -오류 수집 기능을 활성화 시키려면 오류를 수집하고 싶은 메인 프로세스나 랜더러 프로세스에서 -`crashReporter.start` 함수를 호출하여 `crashpad`를 초기화 해야합니다. +**Note:** On OS X, electron uses a new `crashpad` client, which is different +with the `breakpad` on Windows and Linux. To enable crash collection feature, +you are required to call `crashReporter.start` API to initiliaze `crashpad` in +main process, even you only collect crash report in renderer process. ## crashReporter.getLastCrashReport() -마지막 오류보고의 날짜와 ID를 반환합니다. -이전 오류보고가 없거나 Crash Reporter가 시작되지 않았을 경우 `null`이 반환됩니다. +Returns the date and ID of last crash report, when there was no crash report +sent or the crash reporter is not started, `null` will be returned. ## crashReporter.getUploadedReports() -모든 업로드된 오류보고를 반환합니다. 각 보고는 날짜와 업로드 ID를 포함하고 있습니다. +Returns all uploaded crash reports, each report contains date and uploaded ID. -# crash-reporter 오류보고 형식 +# crash-reporter payload -Crash Reporter는 다음과 같은 데이터를 `submitUrl`에 `POST` 방식으로 전송합니다: +The crash reporter will send the following data to the `submitUrl` as `POST`: -* `rept` String - 예시 'electron-crash-service' -* `ver` String - Electron의 버전 -* `platform` String - 예시 'win32' -* `process_type` String - 예시 'renderer' +* `rept` String - e.g. 'electron-crash-service' +* `ver` String - The version of Electron +* `platform` String - e.g. 'win32' +* `process_type` String - e.g. 'renderer' * `ptime` Number -* `_version` String - `package.json`내의 `version` 필드 -* `_productName` String - Crash Reporter의 `options` 객체에서 정의한 제품명. -* `prod` String - 기본 제품의 이름. 이 경우 Electron으로 표시됩니다. -* `_companyName` String - Crash Reporter의 `options` 객체에서 정의한 회사명. -* `upload_file_minidump` File - 오류보고 파일 -* Crash Reporter의 `options` 객체에서 정의한 `extra` 객체의 속성들. +* `_version` String - The version in `package.json` +* `_productName` String - The product name in the crashReporter `options` object +* `prod` String - Name of the underlying product. In this case Electron +* `_companyName` String - The company name in the crashReporter `options` object +* `upload_file_minidump` File - The crashreport as file +* All level one properties of the `extra` object in the crashReporter `options` object diff --git a/docs/api/dialog-ko.md b/docs/api/dialog-ko.md index a16daebb6f3a..25c4abfa7631 100644 --- a/docs/api/dialog-ko.md +++ b/docs/api/dialog-ko.md @@ -1,17 +1,17 @@ # dialog -`dialog` 모듈은 네이티브 시스템의 대화 상자를 조작할 때 사용할 수 있는 API입니다. -웹 어플리케이션에서 일반 네이티브 어플리케이션과 같은 사용자 경험을 제공할 수 있습니다. +The `dialog` module provides APIs to show native system dialogs, so web +applications can deliver the same user experience as native applications. -다음 예제는 파일과 디렉터리를 다중으로 선택하는 대화 상자를 표시하는 예제입니다: +An example of showing a dialog to select multiple files and directories: ```javascript -var win = ...; // 대화 상자를 사용할 창 객체 +var win = ...; // window in which to show the dialog var dialog = require('dialog'); console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]})); ``` -**OS X 주의**: 대화 상자를 시트처럼 보여지게 하려면 `browserWindow` 인자에 `BrowserWindow` 객체의 참조를 제공하면 됩니다. +**Note for OS X**: If you want to present dialogs as sheets, the only thing you have to do is provide a `BrowserWindow` reference in the `browserWindow` parameter. ## dialog.showOpenDialog([browserWindow], [options], [callback]) @@ -20,15 +20,16 @@ console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', ' * `title` String * `defaultPath` String * `filters` Array - * `properties` Array - 대화 상자가 사용할 기능(모드)이 담긴 배열입니다. - 다음을 포함할 수 있습니다: `openFile`, `openDirectory`, `multiSelections`, `createDirectory` + * `properties` Array - Contains which features the dialog should use, can + contain `openFile`, `openDirectory`, `multiSelections` and + `createDirectory` * `callback` Function -사용할 대화 상자의 기능이 담긴 배열입니다. 다음을 포함할 수 있습니다: `openFile`, `openDirectory`, `multiSelections`, `createDirectory` +On success, returns an array of file paths chosen by the user, otherwise +returns `undefined`. -작업에 성공하면 유저가 선택한 파일의 경로를 포함한 배열을 반환합니다. 그 외의 경우엔 `undefined`를 반환합니다. - -`filters`를 지정하면 유저가 선택 가능한 파일 형식을 지정할 수 있습니다. 예제는 다음과 같습니다: +The `filters` specifies an array of file types that can be displayed or +selected, an example is: ```javascript { @@ -40,10 +41,12 @@ console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', ' } ``` -`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(filenames)`을 통해 전달됩니다. +If a `callback` is passed, the API call would be asynchronous and the result +would be passed via `callback(filenames)` -Windows와 Linux에선 파일 선택 모드, 디렉터리 선택 모드를 동시에 사용할 수 없습니다. -그래서 이 두 플랫폼에선 `properties`를 `['openFile', 'openDirectory']`로 설정하면 디렉터리 선택 대화 상자가 표시됩니다. +**Note:** On Windows and Linux, an open dialog can not be both a file selector +and a directory selector, so if you set `properties` to +`['openFile', 'openDirectory']` on these platforms, a directory selector will be shown. ## dialog.showSaveDialog([browserWindow], [options], [callback]) @@ -54,41 +57,36 @@ Windows와 Linux에선 파일 선택 모드, 디렉터리 선택 모드를 동 * `filters` Array * `callback` Function -작업에 성공하면 +On success, returns the path of the file chosen by the user, otherwise returns +`undefined`. -작업에 성공하면 유저가 선택한 파일의 경로를 포함한 배열을 반환합니다. 그 외의 경우엔 `undefined`를 반환합니다. +The `filters` specifies an array of file types that can be displayed, see +`dialog.showOpenDialog` for an example. -`filters`를 지정하면 유저가 저장 가능한 파일 형식을 지정할 수 있습니다. 사용 방법은 `dialog.showOpenDialog`의 `filters` 속성과 같습니다. - -`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(filename)`을 통해 전달됩니다. +If a `callback` is passed, the API call will be asynchronous and the result +will be passed via `callback(filename)` ## dialog.showMessageBox([browserWindow], options, [callback]) * `browserWindow` BrowserWindow * `options` Object - ** `type` String - `"none"`, `"info"`, `"error"`, `"question"`, `"warning"` 중 하나를 사용할 수 있습니다. - * `buttons` Array - 버튼들의 라벨을 포함한 배열입니다. - * `title` String - 메시지 상자의 제목입니다. 몇몇 플랫폼에선 보이지 않을 수 있습니다. - * `message` String - 메시지 상자의 본문 내용입니다. - * `detail` String - 메시지의 추가 정보입니다. + * `type` String - Can be `"none"`, `"info"` or `"warning"` + * `buttons` Array - Array of texts for buttons + * `title` String - Title of the message box, some platforms will not show it + * `message` String - Content of the message box + * `detail` String - Extra information of the message * `icon` [NativeImage](native-image-ko.md) - * `cancelId` Integer - 유저가 대화 상자의 버튼을 클릭하지 않고 대화 상자를 취소했을 때 반환되는 버튼의 index입니다. - 기본적으로 버튼 리스트가 "cancel" 또는 "no" 라벨을 가지고 있을 때 해당 버튼의 index를 반환합니다. 따로 두 라벨이 지정되지 않은 경우 0을 반환합니다. - OS X와 Windows에선 `cancelId` 지정 여부에 상관없이 "Cancel" 버튼이 언제나 `cancelId`로 지정됩니다. * `callback` Function -메시지 상자를 표시합니다. `browserWindow`를 지정하면 메시지 상자가 완전히 닫힐 때까지는 창을 사용할 수 없습니다. -완료시 유저가 선택한 버튼의 index를 반환합니다. +Shows a message box, it will block until the message box is closed. It returns +the index of the clicked button. -역주: 부정을 표현하는 "아니오", "취소"와 같은 한글 단어는 지원되지 않습니다. -만약 OS X 또는 Windows에서 "확인", "취소"와 같은 순서로 버튼을 지정하게 될 때 Alt + f4로 해당 대화 상자를 끄게 되면 "확인"을 누른걸로 판단되어 버립니다. -이를 해결하려면 "Cancel"을 대신 사용하거나 BrowserWindow API를 사용하여 메시지 상자를 직접 구현해야합니다. - -`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(response)`을 통해 전달됩니다. +If a `callback` is passed, the API call will be asynchronous and the result +will be passed via `callback(response)` ## dialog.showErrorBox(title, content) -에러 메시지를 보여주는 모달 대화 상자를 표시합니다. +Runs a modal dialog that shows an error message. -이 API는 `app` 모듈의 `ready` 이벤트가 발생하기 전에 사용할 수 있습니다. -이 메소드는 보통 어플리케이션이 시작되기 전에 특정한 에러를 표시하기 위해 사용됩니다. +This API can be called safely before the `ready` event of `app` module emits, it +is usually used to report errors in early stage of startup. diff --git a/docs/api/frameless-window-ko.md b/docs/api/frameless-window-ko.md index 420b277d9b17..8315f48ec8ee 100644 --- a/docs/api/frameless-window-ko.md +++ b/docs/api/frameless-window-ko.md @@ -1,19 +1,20 @@ -# Frameless 윈도우 +# Frameless window -Frameless 윈도우는 테두리가 없는 윈도우 창을 말합니다. +frameless window는 테두리가 없는 윈도우 창을 말합니다. -## Frameless 윈도우 만들기 +## Frameless window 만들기 -Frameless 윈도우를 만드려면 [BrowserWindow](browser-window-ko.md) 객체의 `options`에서 `frame` 옵션을 `false`로 지정하기만 하면됩니다: +Frameless window를 만드려면 [BrowserWindow](browser-window-ko.md) 객체의 `options`에서 `frame` 옵션을 `false`로 지정하기만 하면됩니다: ```javascript var BrowserWindow = require('browser-window'); var win = new BrowserWindow({ width: 800, height: 600, frame: false }); ``` -## 투명한 창 만들기 +## 투명한 윈도우 -Frameless 윈도우의 창의 배경을 투명하게 만들고 싶다면 `transparent` 옵션을 `true`로 바꿔주기만 하면됩니다: +By setting the `transparent` option to `true`, you can also make the frameless +window transparent: ```javascript var win = new BrowserWindow({ transparent: true, frame: false }); @@ -21,32 +22,39 @@ var win = new BrowserWindow({ transparent: true, frame: false }); ### API의 한계 - - -* 투명한 영역을 통과하여 클릭할 수 없습니다. 우리는 이 문제를 해결하기 위해 API를 제공할 예정이지만 현재로써는 - [upstream 버그](https://code.google.com/p/chromium/issues/detail?id=387234)로 인해 중단된 상태입니다. -* 투명한 창은 크기를 조절할 수 없습니다. `resizable` 속성을 `true`로 할 경우 몇몇 플랫폼에선 윈도우 크래시가 일어납니다. -* `blur` 필터는 웹 페이지에서만 적용됩니다. 윈도우 아래 컨텐츠에는 블러 효과를 적용할 방법이 없습니다. -* Windows에선 DWM(데스크톱 창 관리자)가 비활성화되어 있을 경우 작동하지 않습니다. -* Linux를 사용할 경우 [alpha channel doesn't work on some NVidia drivers](https://code.google.com/p/chromium/issues/detail?id=369209) - upstream 버그가 있으므로 CLI 옵션에 `--enable-transparent-visuals --disable-gpu`을 추가해야 합니다. - 이 옵션은 GPU의 사용을 중단하고 윈도우를 생성하는데 ARGB를 사용할 수 있도록 해줍니다. -* OS X(Mac)에선 네이티브 윈도우의 그림자가 투명한 창에선 보이지 않습니다. +* You can not click through the transparent area, we are going to introduce an + API to set window shape to solve this, but currently blocked at an + [upstream bug](https://code.google.com/p/chromium/issues/detail?id=387234). +* Transparent window is not resizable, setting `resizable` to `true` may make + transparent window stop working on some platforms. +* The `blur` filter only applies to the web page, so there is no way to apply + blur effect to the content below the window. +* On Windows transparent window will not work when DWM is disabled. +* On Linux users have to put `--enable-transparent-visuals --disable-gpu` in + command line to disable GPU and allow ARGB to make transparent window, this is + caused by an upstream bug that [alpha channel doesn't work on some NVidia + drivers](https://code.google.com/p/chromium/issues/detail?id=369209) on Linux. +* On Mac the native window shadow will not show for transparent window. ## 드래그 가능 위치 지정 -기본적으로 Frameless 윈도우는 드래그 할 수 없습니다. -어플리케이션의 CSS에서 특정 범위를 `-webkit-app-region: drag`로 지정하면 OS의 기본 타이틀바 처럼 드래그 되도록 할 수 있습니다. -그리고 `-webkit-app-region: no-drag`를 지정해서 드래그 불가능 영역을 만들 수도 있습니다. 현재 사각형 형태의 범위만 지원합니다. +By default, the frameless window is non-draggable. Apps need to specify +`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable +(like the OS's standard titlebar), and apps can also use +`-webkit-app-region: no-drag` to exclude the non-draggable area from the + draggable region. Note that only rectangular shape is currently supported. -창 전체를 드래그 가능하게 만드려면 `-webkit-app-region: drag`을 `body`의 스타일에 지정하면 됩니다: +To make the whole window draggable, you can add `-webkit-app-region: drag` as +`body`'s style: ```html ``` -참고로 창 전체를 드래그 영역으로 지정할 경우 사용자가 버튼을 클릭할 수 없게 되므로 버튼은 드래그 불가능 영역으로 지정해야 합니다: +And note that if you have made the whole window draggable, you must also mark +buttons as non-draggable, otherwise it would be impossible for users to click on +them: ```css button { @@ -54,13 +62,15 @@ button { } ``` -또한 커스텀 타이틀바를 만들어 사용할 때 타이틀바 내부의 버튼도 드래그 불가능 영역으로 지정해야 합니다. +If you're only using a custom titlebar, you also need to make buttons in +titlebar non-draggable. ## 텍스트 선택 -한가지, Frameless 윈도우에서 텍스트가 선택되는 드래그 동작은 혼란을 야기할 수 있습니다. -예를 들어 타이틀바를 드래그 할 때 타이틀바의 텍스트를 실수로 선택할 수 있습니다. -이를 방지하기 위해선 다음과 같이 드래그 영역의 텍스트 선택 동작을 비활성화해야 할 필요가 있습니다: +One thing on frameless window is that the dragging behaviour may conflict with +selecting text, for example, when you drag the titlebar, you may accidentally +select the text on titlebar. To prevent this, you need to disable text +selection on dragging area like this: ```css .titlebar { @@ -71,5 +81,7 @@ button { ## 컨텍스트 메뉴 -몇몇 플랫폼에선 드래그 가능 영역이 non-client 프레임으로 처리됩니다. 그래서 이 영역에서 오른쪽 클릭을 할 경우 시스템 메뉴가 팝업 됩니다. -그래서 컨텍스트 메뉴 지정이 모든 플랫폼에서 정상적으로 작동하게 하려면 커스텀 컨텍스트 메뉴를 드래그 영역 내에 만들어선 안됩니다. +On some platforms, the draggable area would be treated as non-client frame, so +when you right click on it a system menu would be popuped. To make context menu +behave correctly on all platforms, you should never custom context menu on +draggable areas. diff --git a/docs/api/menu-ko.md b/docs/api/menu-ko.md index 234aad4afeee..3ac62012f675 100644 --- a/docs/api/menu-ko.md +++ b/docs/api/menu-ko.md @@ -1,10 +1,12 @@ # menu -`Menu` 클래스는 어플리케이션 메뉴와 컨텍스트 메뉴를 만들 때 사용할 수 있습니다. -각 메뉴는 여러 개의 메뉴 아이템으로 구성되어 있으며 서브 메뉴를 가질 수도 있습니다. +The `Menu` class is used to create native menus that can be used as +application menus and context menus. Each menu consists of multiple menu +items, and each menu item can have a submenu. -다음 예제는 웹 페이지 내에서 [remote](remote-ko.md) 모듈을 활용하여 동적으로 메뉴를 생성하는 예제입니다. -그리고 이 예제에서 만들어진 메뉴는 유저가 페이지에서 오른쪽 클릭을 할 때 마우스 위치에 팝업으로 표시됩니다: +Below is an example of creating a menu dynamically in a web page by using +the [remote](remote-ko.md) module, and showing it when the user right clicks +the page: ```html @@ -25,7 +27,7 @@ window.addEventListener('contextmenu', function (e) { ``` -다음 예제는 template API를 활용하여 어플리케이션 메뉴를 만드는 간단한 예제입니다: +Another example of creating the application menu with the simple template API: ```html @@ -165,30 +167,34 @@ Menu.setApplicationMenu(menu); ### new Menu() -새로운 메뉴를 생성합니다. +Creates a new menu. ### Class Method: Menu.setApplicationMenu(menu) * `menu` Menu -지정한 `menu`를 이용하여 어플리케이션 메뉴를 만듭니다. OS X에선 상단바에 표시되며 Windows와 Linux에선 각 창의 상단에 표시됩니다. +Sets `menu` as the application menu on OS X. On Windows and Linux, the `menu` +will be set as each window's top menu. ### Class Method: Menu.sendActionToFirstResponder(action) * `action` String -`action`을 어플리케이션의 first responder에 전달합니다. -이 함수는 Cocoa 메뉴 동작을 에뮬레이트 하는데 사용되며 보통 `MenuItem`의 `selector` 속성에 사용됩니다. +Sends the `action` to the first responder of application, this is used for +emulating default Cocoa menu behaviors, usually you would just use the +`selector` property of `MenuItem`. -**알림:** 이 함수는 OS X에서만 사용할 수 있습니다. +**Note:** This method is OS X only. ### Class Method: Menu.buildFromTemplate(template) * `template` Array -기본적으로 `template`는 [MenuItem](menu-item-ko.md)을 생성할 때 사용하는 `options`의 배열입니다. 사용법은 위에서 설명한 것과 같습니다. +Generally, the `template` is just an array of `options` for constructing +[MenuItem](menu-item-ko.md), the usage can be referenced above. -또한 `template`에는 다른 속성도 추가할 수 있으며 메뉴가 만들어질 때 해당 메뉴 아이템의 프로퍼티로 변환됩니다. +You can also attach other fields to element of the `template`, and they will +become properties of the constructed menu items. ### Menu.popup(browserWindow, [x, y]) @@ -196,70 +202,86 @@ Menu.setApplicationMenu(menu); * `x` Number * `y` Number -메뉴를 `browserWindow` 안에서 팝업으로 표시합니다. -옵션으로 메뉴를 표시할 `(x,y)` 좌표를 임의로 지정할 수 있습니다. 따로 지정하지 않은 경우 마우스 커서 위치에 표시됩니다. +Popups this menu as a context menu in the `browserWindow`. You can optionally +provide a `(x,y)` coordinate to place the menu at, otherwise it will be placed +at the current mouse cursor position. ### Menu.append(menuItem) * `menuItem` MenuItem -메뉴의 리스트 끝에 `menuItem`을 삽입합니다. +Appends the `menuItem` to the menu. ### Menu.insert(pos, menuItem) * `pos` Integer * `menuItem` MenuItem -`pos` 위치에 `menuItem`을 삽입합니다. +Inserts the `menuItem` to the `pos` position of the menu. ### Menu.items -메뉴가 가지고 있는 메뉴 아이템들의 배열입니다. +Get the array containing the menu's items. -## OS X 어플리케이션 메뉴에 대해 알아 둬야 할 것들 +## Notes on OS X application menu -OS X에선 Windows, Linux와 달리 완전히 다른 어플리케이션 메뉴 스타일을 가지고 있습니다. -어플리케이션을 네이티브처럼 작동할 수 있도록 하기 위해선 다음의 몇 가지 유의 사항을 숙지해야 합니다. +OS X has a completely different style of application menu from Windows and +Linux, and here are some notes on making your app's menu more native-like. -### 기본 메뉴 +### Standard menus -OS X엔 `Services`나 `Windows`와 같은 많은 시스템 지정 기본 메뉴가 있습니다. -기본 메뉴를 만들려면 다음 중 하나를 메뉴의 라벨로 지정하기만 하면 됩니다. -그러면 Electron이 자동으로 인식하여 해당 메뉴를 기본 메뉴로 만듭니다: +On OS X there are many system defined standard menus, like the `Services` and +`Windows` menus. To make your menu a standard menu, you can just set your menu's +label to one of followings, and Electron will recognize them and make them +become standard menus: * `Window` * `Help` * `Services` -### 기본 메뉴 아이템 동작 +### Standard menu item actions -OS X는 몇몇의 메뉴 아이템에 대해 `About xxx`, `Hide xxx`, `Hide Others`와 같은 기본 동작을 제공하고 있습니다. (`selector`라고 불립니다) -메뉴 아이템의 기본 동작을 지정하려면 메뉴 아이템의 `selector` 속성을 사용하면 됩니다. +OS X has provided standard actions for some menu items (which are called +`selector`s), like `About xxx`, `Hide xxx`, and `Hide Others`. To set the action +of a menu item to a standard action, you can set the `selector` attribute of the +menu item. -### 메인 메뉴의 이름 +### Main menu's name -OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번째 라벨은 언제나 어플리케이션의 이름이 됩니다. -어플리케이션 이름을 변경하려면 앱 번들내의 `Info.plist` 파일을 수정해야합니다. -자세한 내용은 [About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html)을 참고하세요. +On OS X the label of application menu's first item is always your app's name, +no matter what label you set. To change it you have to change your app's name +by modifying your app bundle's `Info.plist` file. See +[About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html) +for more. -## 메뉴 아이템 위치 -`Menu.buildFromTemplate`로 메뉴를 만들 때 `position`과 `id`를 사용해서 아이템의 위치를 지정할 수 있습니다. +## Menu item position -`MenuItem`의 `position` 속성은 `[placement]=[id]`와 같은 형식을 가지며 `placement`는 -`before`, `after`, `endof` 속성 중 한가지를 사용할 수 있고 `id`는 메뉴 아이템이 가지는 유일 ID 입니다: +You can make use of `position` and `id` to control how the item would be placed +when building a menu with `Menu.buildFromTemplate`. -* `before` - 이 아이템을 지정한 id 이전의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. -* `after` - 이 아이템을 지정한 id 다음의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. -* `endof` - 이 아이템을 id의 논리 그룹에 맞춰서 각 그룹의 항목 뒤에 삽입합니다. (그룹은 분리자 아이템에 의해 만들어집니다) - 만약 참조된 아이템의 분리자 그룹이 존재하지 않을 경우 지정된 id로 새로운 분리자 그룹을 만든 후 해당 그룹의 뒤에 삽입됩니다. +The `position` attribute of `MenuItem` has the form `[placement]=[id]` where +placement is one of `before`, `after`, or `endof` and `id` is the unique ID of +an existing item in the menu: -위치를 지정한 아이템의 뒤에 위치가 지정되지 않은 아이템이 있을 경우 해당 아이템의 위치가 지정되기 전까지 이전에 위치가 지정된 아이템의 위치 지정을 따릅니다. -이에 따라 위치를 이동하고 싶은 특정 그룹의 아이템들이 있을 경우 해당 그룹의 맨 첫번째 메뉴 아이템의 위치만을 지정하면 됩니다. +* `before` - Inserts this item before the id referenced item. If the + referenced item doesn't exist the item will be inserted at the end of + the menu. +* `after` - Inserts this item after id referenced item. If the referenced + item doesn't exist the item will be inserted at the end of the menu. +* `endof` - Inserts this item at the end of the logical group containing + the id referenced item. (Groups are created by separator items). If + the referenced item doesn't exist a new separator group is created with + the given id and this item is inserted after that separator. -### 예제 +When an item is positioned following unpositioned items are inserted after +it, until a new item is positioned. So if you want to position a group of +menu items in the same location you only need to specify a position for +the first item. -메뉴 템플릿: +### Examples + +Template: ```javascript [ @@ -271,7 +293,7 @@ OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번 ] ``` -메뉴: +Menu: ``` - 1 @@ -281,7 +303,7 @@ OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번 - 5 ``` -메뉴 템플릿: +Template: ```javascript [ @@ -294,7 +316,7 @@ OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번 ] ``` -메뉴: +Menu: ``` - --- diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md index 20243ab95824..26fc4eb740c4 100644 --- a/docs/api/protocol-ko.md +++ b/docs/api/protocol-ko.md @@ -19,20 +19,18 @@ app.on('ready', function() { **알림:** 이 모듈은 app의 `ready` 이벤트가 발생한 이후에만 사용할 수 있습니다. -## protocol.registerProtocol(scheme, handler, callback) +## protocol.registerProtocol(scheme, handler) * `scheme` String * `handler` Function -* `callback` Function -지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. `handler`는 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler(request)` 형식으로 호출됩니다. +지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler` 함수가 호출됩니다. -`handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 합니다. +호출된 `handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 할 필요가 있습니다. -## protocol.unregisterProtocol(scheme, callback) +## protocol.unregisterProtocol(scheme) * `scheme` String -* `callback` Function 지정한 `scheme` 프로토콜을 등록 해제합니다. @@ -42,27 +40,23 @@ app.on('ready', function() { 지정한 `value` 배열을 사용하여 미리 지정된 스킴으로 등록합니다. -## protocol.isHandledProtocol(scheme, callback) +## protocol.isHandledProtocol(scheme) * `scheme` String -* `callback` Function 해당 `scheme`에 처리자(handler)가 등록되었는지 확인합니다. -지정한 `callback`에 결과가 boolean 값으로 반환됩니다. -## protocol.interceptProtocol(scheme, handler, callback) +## protocol.interceptProtocol(scheme, handler) * `scheme` String * `handler` Function -* `callback` Function 지정한 `scheme`의 작업을 `handler`로 변경합니다. `handler`에서 `null` 또는 `undefined`를 반환 할 경우 해당 프로토콜의 기본 동작(응답)으로 대체 됩니다. -## protocol.uninterceptProtocol(scheme, callback) +## protocol.uninterceptProtocol(scheme) * `scheme` String -* `callback` Function 변경된 프로토콜의 작업을 해제합니다. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md index 11d62dd27194..0feb53ece5ee 100644 --- a/docs/api/remote-ko.md +++ b/docs/api/remote-ko.md @@ -1,6 +1,7 @@ # remote -`remote` 모듈은 메인 프로세스와 랜더러 프로세스 사이에 inter-process 통신을 하기 위한 가장 간단한 방법입니다. +The `remote` module provides a simple way to do inter-process communication +between the renderer process and the main process. In Electron, only GUI-unrelated modules are available in the renderer process. Without the `remote` module, users who wanted to call a main process API in diff --git a/docs/api/screen-ko.md b/docs/api/screen-ko.md index 6b508991e4f7..c554863586cc 100644 --- a/docs/api/screen-ko.md +++ b/docs/api/screen-ko.md @@ -1,14 +1,13 @@ # screen -`screen` 모듈은 화면 크기, 디스플레이, 커서 위치 등등의 다양한 정보를 가져옵니다. -이 모듈은 `app` 모듈의 `ready` 이벤트가 발생하기 전까지 사용할 수 없습니다. +Gets various info about screen size, displays, cursor position, etc. You should +not use this module until the `ready` event of `app` module gets emitted. -`screen`은 [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)를 상속 받았습니다. +`screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). -한가지 주의할 점은 랜더러 / DevTools에선 이 모듈의 이름인 `screen`은 이미 DOM 속성에 `window.screen`로 존재 하므로 `screen = require('screen')`를 -사용할 수 없습니다. 밑의 예제와 같이 `atomScreen`등의 이름으로 변수 이름을 대체하여 사용해야 합니다. +Make sure to note that in the renderer / DevTools, `window.screen` is a reserved DOM property, so writing `screen = require('screen')` won't work. In our examples below, we use `atomScreen` as the variable name instead. -다음 예제는 화면 전체를 채우는 윈도우 창을 생성합니다: +An example of creating a window that fills the whole screen: ```javascript var app = require('app'); @@ -23,7 +22,7 @@ app.on('ready', function() { }); ``` -다음 예제는 확장 디스플레이에 윈도우를 생성합니다: +Another example of creating a window in the external display: ```javascript var app = require('app'); @@ -56,14 +55,14 @@ app.on('ready', function() { * `event` Event * `newDisplay` Object -새로운 디스플레이가 추가되면 발생합니다. +Emitted when `newDisplay` has been added. ## Event: display-removed * `event` Event * `oldDisplay` Object -기존의 디스플레이가 제거되면 발생합니다. +Emitted when `oldDisplay` has been removed. ## Event: display-metrics-changed @@ -71,21 +70,21 @@ app.on('ready', function() { * `display` Object * `changedMetrics` Array -`display`의 하나 또는 다수의 매트릭스가 변경될 경우 발생합니다. -`changedMetrics`는 변경에 대한 정보를 담은 문자열의 배열입니다. -`bounds`, `workArea`, `scaleFactor`, `rotation`등이 변경될 수 있습니다. +Emitted when a `display` has one or more metrics changed, `changedMetrics` is +an array of strings that describe the changes. Possible changes are `bounds`, +`workArea`, `scaleFactor` and `rotation`. ## screen.getCursorScreenPoint() -현재 마우스 포인터의 절대 위치를 반환합니다. +Returns the current absolute position of the mouse pointer. ## screen.getPrimaryDisplay() -기본 디스플레이를 반환합니다. +Returns the primary display. ## screen.getAllDisplays() -사용 가능한 모든 디스플레이를 배열로 반환합니다. +Returns an array of displays that are currently available. ## screen.getDisplayNearestPoint(point) @@ -93,7 +92,7 @@ app.on('ready', function() { * `x` Integer * `y` Integer -지정한 좌표에 가까운 디스플레이를 반환합니다. +Returns the display nearest the specified point. ## screen.getDisplayMatching(rect) @@ -103,4 +102,4 @@ app.on('ready', function() { * `width` Integer * `height` Integer -지정한 범위에 가장 가깝게 교차한 디스플레이를 반환합니다. +Returns the display that most closely intersects the provided bounds. diff --git a/docs/api/shell-ko.md b/docs/api/shell-ko.md index d9ceea106a54..5811afdcb930 100644 --- a/docs/api/shell-ko.md +++ b/docs/api/shell-ko.md @@ -26,7 +26,7 @@ shell.openExternal('https://github.com'); * `url` String 제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를 들어 mailto: URL은 해당 URL을 기본 메일 에이전트로 엽니다.) -역주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) +역자주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) ## shell.moveItemToTrash(fullPath) diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index 3d7f9389f77b..ec955f3439a7 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -89,16 +89,7 @@ $ ./script/clean.py ## 문제 해결 -개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. - -## libtinfo.so.5 동적 링크 라이브러리를 로드하는 도중 에러가 발생할 경우 - -미리 빌드된 `clang`은 `libtinfo.so.5`로 링크를 시도합니다. -플랫폼에 따라 적당한 `libncurses` symlink를 추가하세요. - -```bash -$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5 -``` +개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. ## 테스트 diff --git a/docs/development/build-system-overview-ko.md b/docs/development/build-system-overview-ko.md index 7198fa831b92..92fd50008529 100644 --- a/docs/development/build-system-overview-ko.md +++ b/docs/development/build-system-overview-ko.md @@ -25,14 +25,9 @@ Electron도 상당히 비슷한 접근을 했습니다: ## 부트스트랩 최소화 -Prebuilt된 모든 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. +모든 사전 빌드 된 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. 기본적으로 공유 라이브러리와 정적 라이브러리 모두 다운로드되며 최종 전체 파일 크기는 플랫폼에 따라 800MB에서 2GB까지 차지합니다. -기본적으로 libchromiumcontent는 Amazon Web Service를 통해 다운로드 됩니다. -만약 `LIBCHROMIUMCONTENT_MIRROR` 환경 변수가 설정되어 있으면 부트스트랩은 해당 링크를 사용하여 바이너리를 다운로드 합니다. -[libchromiumcontent-qiniu-mirror](https://github.com/hokein/libchromiumcontent-qiniu-mirror)는 libchromiumcontent의 미러입니다. -만약 AWS에 접근할 수 없다면 `export LIBCHROMIUMCONTENT_MIRROR=http://7xk3d2.dl1.z0.glb.clouddn.com/`를 통해 다운로드 할 수 있습니다. - 만약 빠르게 Electron의 개발 또는 테스트만 하고 싶다면 `--dev` 플래그를 추가하여 공유 라이브러리만 다운로드할 수 있습니다: ```bash diff --git a/docs/tutorial/application-distribution-ko.md b/docs/tutorial/application-distribution-ko.md index 0b6ff631ad70..a1bb5bc65044 100644 --- a/docs/tutorial/application-distribution-ko.md +++ b/docs/tutorial/application-distribution-ko.md @@ -99,7 +99,7 @@ MyApp.app/Contents 실행파일 `electron`의 이름을 원하는 대로 바꿀 수 있습니다. 리눅스 어플리케이션의 아이콘은 [.desktop](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) 파일을 사용하여 지정할 수 있습니다. -### 역주-자동화 +### 역자주-자동화 배포시에 Electron의 리소스를 일일이 수정하는 것은 매우 귀찮고 복잡합니다. 하지만 이 작업을 자동화 시킬 수 있는 몇가지 방법이 있습니다: diff --git a/docs/tutorial/quick-start-ko.md b/docs/tutorial/quick-start-ko.md index a49b7e017609..e5ef8662cd7a 100644 --- a/docs/tutorial/quick-start-ko.md +++ b/docs/tutorial/quick-start-ko.md @@ -75,8 +75,6 @@ var mainWindow = null; // 모든 창이 닫히면 어플리케이션 종료. app.on('window-all-closed', function() { - // OSX의 대부분의 어플리케이션에선 유저가 Cmd + Q 커맨드로 확실하게 종료하기 전까지는 - // 어플리케이션이 메뉴바에 남아 계속 실행됩니다. if (process.platform != 'darwin') { app.quit(); } @@ -114,16 +112,16 @@ app.on('ready', function() {

헬로 월드!

- 이 어플리케이션은 io.js 과 - Electron 을 사용합니다. + 우리는 io.js 버전과 + Electron 버전을 사용합니다. ``` ## 앱 실행하기 -앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 패키징한 앱을 실행할 수 있습니다. -또는 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. +앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 +패키징한 앱을 실행해 볼 수 있습니다. 또한 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. Windows의 경우: diff --git a/docs/tutorial/using-native-node-modules-ko.md b/docs/tutorial/using-native-node-modules-ko.md index 1e67ee25305d..da68c475ba83 100644 --- a/docs/tutorial/using-native-node-modules-ko.md +++ b/docs/tutorial/using-native-node-modules-ko.md @@ -1,6 +1,6 @@ # 네이티브 node 모듈 사용하기 -__역주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ +__역자주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ Electron에선 node.js 네이티브 모듈이 지원됩니다. 하지만 Electron은 공식 node.js의 V8 엔진과는 달리 다른 V8 버전을 사용합니다. 그런 이유로 네이티브 모듈을 사용하기 위해선 Electron의 V8 버전에 맞춰 네이티브 모듈을 다시 빌드하고 헤더를 변경해야 합니다. @@ -34,11 +34,11 @@ Node 모듈을 `node-gyp`를 사용하여 Electron을 타겟으로 빌드할 땐 ```bash $ cd /path-to-module/ -$ HOME=~/.electron-gyp node-gyp rebuild --target=0.29.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell +$ HOME=~/.electron-gyp node-gyp rebuild --target=0.25.0 --arch=ia64 --dist-url=https://atom.io/download/atom-shell ``` -`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.29.1`은 Electron의 버전입니다. -`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=x64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. +`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.25.0`은 Electron의 버전입니다. +`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=ia64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. ### npm을 이용한 방법 @@ -47,7 +47,7 @@ $ HOME=~/.electron-gyp node-gyp rebuild --target=0.29.1 --arch=x64 --dist-url=ht ```bash export npm_config_disturl=https://atom.io/download/atom-shell -export npm_config_target=0.29.1 +export npm_config_target=0.25.0 export npm_config_arch=x64 HOME=~/.electron-gyp npm install module-name ``` From e510384375b29518945abd70a0201b2d7190d6c1 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Sun, 12 Jul 2015 13:23:54 +0900 Subject: [PATCH 04/16] Revert "Revert "Update APIs, check grammars"" This reverts commit 5e083473e7b4d3a6014d35e68618594765151afe. --- docs/README-ko.md | 5 +- docs/api/app-ko.md | 4 + docs/api/auto-updater-ko.md | 2 +- docs/api/chrome-command-line-switches-ko.md | 20 ++- docs/api/clipboard-ko.md | 15 +++ docs/api/content-tracing-ko.md | 6 +- docs/api/crash-reporter-ko.md | 63 +++++----- docs/api/dialog-ko.md | 72 +++++------ docs/api/frameless-window-ko.md | 68 +++++------ docs/api/menu-ko.md | 114 +++++++----------- docs/api/protocol-ko.md | 20 +-- docs/api/remote-ko.md | 3 +- docs/api/screen-ko.md | 33 ++--- docs/api/shell-ko.md | 2 +- .../build-instructions-linux-ko.md | 11 +- docs/development/build-system-overview-ko.md | 7 +- docs/tutorial/application-distribution-ko.md | 2 +- docs/tutorial/quick-start-ko.md | 10 +- docs/tutorial/using-native-node-modules-ko.md | 10 +- 19 files changed, 235 insertions(+), 232 deletions(-) diff --git a/docs/README-ko.md b/docs/README-ko.md index 50c4b2c9c9ca..6e0daa59fd2b 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -67,5 +67,6 @@ * [빌드 설명서 (Linux)](development/build-instructions-linux-ko.md) * [디버거에서 디버그 심볼 서버 설정](development/setting-up-symbol-server-ko.md) -이 문서는 [@preco21](https://github.com/preco21) 에 의해 번역되었습니다. -문서내에서 오타나 잘못된 번역이 발견될 경우 해당 repo를 fork한 후 수정하여 PR을 올리거나 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. +이 참조문서는 [@preco21](https://github.com/preco21)에 의해 번역되었습니다. +문서내에서 오타나 잘못된 번역을 발견하면 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. +원본과는 달리 항시 최신버전을 유지할 수 없으므로 원본을 같이 참고하는 것을 권장합니다. diff --git a/docs/api/app-ko.md b/docs/api/app-ko.md index 293cfd965a39..434d0620282a 100644 --- a/docs/api/app-ko.md +++ b/docs/api/app-ko.md @@ -139,6 +139,10 @@ This method guarantees all `beforeunload` and `unload` handlers are correctly executed. It is possible that a window cancels the quitting by returning `false` in `beforeunload` handler. +## app.getAppPath() + +Returns the current application directory. + ## app.getPath(name) * `name` String diff --git a/docs/api/auto-updater-ko.md b/docs/api/auto-updater-ko.md index 0894fc3485fb..bcfc3b562682 100644 --- a/docs/api/auto-updater-ko.md +++ b/docs/api/auto-updater-ko.md @@ -1,6 +1,6 @@ # auto-updater -**This module has only been implemented for OS X.** +**이 모듈은 현재 OS X에서만 사용할 수 있습니다.** Check out [atom/grunt-electron-installer](https://github.com/atom/grunt-electron-installer) for building a Windows installer for your app. diff --git a/docs/api/chrome-command-line-switches-ko.md b/docs/api/chrome-command-line-switches-ko.md index 35ea805ccd4e..ed8cf55e06ec 100644 --- a/docs/api/chrome-command-line-switches-ko.md +++ b/docs/api/chrome-command-line-switches-ko.md @@ -51,10 +51,8 @@ Hostname 맵핑 규칙을 설정합니다. (`,`로 분리) also force the port of the resulting socket address to be 77. * `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for "www.google.com". - -These mappings apply to the endpoint host in a net request (the TCP connect -and host resolver in a direct connection, and the `CONNECT` in an http proxy -connection, and the endpoint host in a `SOCKS` proxy connection). + +이 맵핑은 네트워크 요청시의 endpoint를 지정합니다. (TCP 연결과 직접 연결의 호스트 resolver, http 프록시 연결의 `CONNECT`, `SOCKS` 프록시 연결의 endpoint 호스트) ## --host-resolver-rules=`rules` @@ -88,16 +86,14 @@ Net log 이벤트를 지정한 `path`에 로그로 기록합니다. ## --vmodule=`pattern` -Gives the per-module maximal V-logging levels to override the value given by -`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in -source files `my_module.*` and `foo*.*`. +`--v` 옵션에 전달된 값을 덮어쓰고 모듈당 최대 V-logging 레벨을 지정합니다. +예를 들어 `my_module=2,foo*=3`는 `my_module.*`, `foo*.*`와 같은 파일 이름 패턴을 가진 모든 소스 코드들의 로깅 레벨을 각각 2와 3으로 설정합니다. -Any pattern containing a forward or backward slash will be tested against the -whole pathname and not just the module. E.g. `*/foo/bar/*=2` would change the -logging level for all code in source files under a `foo/bar` directory. +슬래시(`/`), 백슬래시(`\`)를 포함하는 모든 패턴은 모듈뿐만 아니라 모든 경로명에 대해서도 테스트 됩니다. +예를 들어 `*/foo/bar/*=2` 표현식은 `foo/bar` 디렉터리 안의 모든 소스 코드의 로깅 레벨을 2로 지정합니다. + +모든 크로미움과 관련된 로그를 비활성화하고 어플리케이션의 로그만 활성화 하려면 다음과 같이 코드를 작성하면 됩니다: -To disable all chromium related logs and only enable your application logs you -can do: ```javascript app.commandLine.appendSwitch('v', -1); diff --git a/docs/api/clipboard-ko.md b/docs/api/clipboard-ko.md index 3ee0164e9759..bc6c82786cb7 100644 --- a/docs/api/clipboard-ko.md +++ b/docs/api/clipboard-ko.md @@ -86,3 +86,18 @@ console.log(clipboard.has('

selection

')); 클립보드로부터 `data`를 읽어들입니다. **알림:** 이 API는 실험적인 기능이며 차후 최신버전에서 제외될 수 있습니다. + +## clipboard.write(data[, type]) + +* `data` Object + * `text` String + * `html` String + * `image` [NativeImage](native-image.md) +* `type` String + +```javascript +var clipboard = require('clipboard'); +clipboard.write({text: 'test', html: "test"}); +``` + +`data`를 클립보드에 씁니다. diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md index a0896c2a7182..e9fa3158a2fb 100644 --- a/docs/api/content-tracing-ko.md +++ b/docs/api/content-tracing-ko.md @@ -1,9 +1,7 @@ # content-tracing -The `content-trace` module is used to collect tracing data generated by the -underlying Chromium content module. This module does not include a web interface -so you need to open `chrome://tracing/` in a Chrome browser and load the generated -file to view the result. +`content-trace` 모듈은 Chromium 컨텐츠 모듈단에서 생성된 데이터를 수집하고 추적하는데 사용됩니다. +이 모듈은 웹 인터페이스를 포함하고 있지 않으며 크롬 브라우저에서 `chrome://tracing/` 페이지를 열어 생성된 파일을 로드하면 결과를 볼 수 있습니다. ```javascript var tracing = require('content-tracing'); diff --git a/docs/api/crash-reporter-ko.md b/docs/api/crash-reporter-ko.md index 1302d9b457e2..b8c076a7ceae 100644 --- a/docs/api/crash-reporter-ko.md +++ b/docs/api/crash-reporter-ko.md @@ -1,6 +1,6 @@ # crash-reporter -An example of automatically submitting crash reporters to remote server: +다음 예제는 윈격 서버에 어플리케이션 오류 정보를 자동으로 보고하는 예제입니다: ```javascript crashReporter = require('crash-reporter'); @@ -15,47 +15,46 @@ crashReporter.start({ ## crashReporter.start(options) * `options` Object - * `productName` String, default: Electron - * `companyName` String, default: GitHub, Inc - * `submitUrl` String, default: http://54.249.141.255:1127/post - * URL that crash reports would be sent to as POST - * `autoSubmit` Boolean, default: true - * Send the crash report without user interaction - * `ignoreSystemCrashHandler` Boolean, default: false + * `productName` String, 기본값: Electron + * `companyName` String, 기본값: GitHub, Inc + * `submitUrl` String, 기본값: http://54.249.141.255:1127/post + * Crash Reporter는 POST 방식으로 해당 URL에 전송됩니다. + * `autoSubmit` Boolean, 기본값: true + * true로 지정할 경우 유저의 승인 없이 자동으로 오류를 보고합니다. + * `ignoreSystemCrashHandler` Boolean, 기본값: false * `extra` Object - * An object you can define which content will be send along with the report. - * Only string properties are send correctly. - * Nested objects are not supported. - -Developers are required to call the API before using other crashReporter APIs. + * 오류보고 시 같이 보낼 추가 정보를 지정하는 객체입니다. + * 문자열로 된 속성만 정상적으로 보내집니다. + * 중첩 객체는 지원되지 않습니다. (Nested objects are not supported) + +다른 crashReporter API들을 사용하기 전에 이 함수를 먼저 호출해야 합니다. -**Note:** On OS X, electron uses a new `crashpad` client, which is different -with the `breakpad` on Windows and Linux. To enable crash collection feature, -you are required to call `crashReporter.start` API to initiliaze `crashpad` in -main process, even you only collect crash report in renderer process. +**알림:** OS X에선 Windows와 Linux의 `breakpad`와 달리 새로운 `crashpad` 클라이언트를 사용합니다. +오류 수집 기능을 활성화 시키려면 오류를 수집하고 싶은 메인 프로세스나 랜더러 프로세스에서 +`crashReporter.start` 함수를 호출하여 `crashpad`를 초기화 해야합니다. ## crashReporter.getLastCrashReport() -Returns the date and ID of last crash report, when there was no crash report -sent or the crash reporter is not started, `null` will be returned. +마지막 오류보고의 날짜와 ID를 반환합니다. +이전 오류보고가 없거나 Crash Reporter가 시작되지 않았을 경우 `null`이 반환됩니다. ## crashReporter.getUploadedReports() -Returns all uploaded crash reports, each report contains date and uploaded ID. +모든 업로드된 오류보고를 반환합니다. 각 보고는 날짜와 업로드 ID를 포함하고 있습니다. -# crash-reporter payload +# crash-reporter 오류보고 형식 -The crash reporter will send the following data to the `submitUrl` as `POST`: +Crash Reporter는 다음과 같은 데이터를 `submitUrl`에 `POST` 방식으로 전송합니다: -* `rept` String - e.g. 'electron-crash-service' -* `ver` String - The version of Electron -* `platform` String - e.g. 'win32' -* `process_type` String - e.g. 'renderer' +* `rept` String - 예시 'electron-crash-service' +* `ver` String - Electron의 버전 +* `platform` String - 예시 'win32' +* `process_type` String - 예시 'renderer' * `ptime` Number -* `_version` String - The version in `package.json` -* `_productName` String - The product name in the crashReporter `options` object -* `prod` String - Name of the underlying product. In this case Electron -* `_companyName` String - The company name in the crashReporter `options` object -* `upload_file_minidump` File - The crashreport as file -* All level one properties of the `extra` object in the crashReporter `options` object +* `_version` String - `package.json`내의 `version` 필드 +* `_productName` String - Crash Reporter의 `options` 객체에서 정의한 제품명. +* `prod` String - 기본 제품의 이름. 이 경우 Electron으로 표시됩니다. +* `_companyName` String - Crash Reporter의 `options` 객체에서 정의한 회사명. +* `upload_file_minidump` File - 오류보고 파일 +* Crash Reporter의 `options` 객체에서 정의한 `extra` 객체의 속성들. diff --git a/docs/api/dialog-ko.md b/docs/api/dialog-ko.md index 25c4abfa7631..a16daebb6f3a 100644 --- a/docs/api/dialog-ko.md +++ b/docs/api/dialog-ko.md @@ -1,17 +1,17 @@ # dialog -The `dialog` module provides APIs to show native system dialogs, so web -applications can deliver the same user experience as native applications. +`dialog` 모듈은 네이티브 시스템의 대화 상자를 조작할 때 사용할 수 있는 API입니다. +웹 어플리케이션에서 일반 네이티브 어플리케이션과 같은 사용자 경험을 제공할 수 있습니다. -An example of showing a dialog to select multiple files and directories: +다음 예제는 파일과 디렉터리를 다중으로 선택하는 대화 상자를 표시하는 예제입니다: ```javascript -var win = ...; // window in which to show the dialog +var win = ...; // 대화 상자를 사용할 창 객체 var dialog = require('dialog'); console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', 'multiSelections' ]})); ``` -**Note for OS X**: If you want to present dialogs as sheets, the only thing you have to do is provide a `BrowserWindow` reference in the `browserWindow` parameter. +**OS X 주의**: 대화 상자를 시트처럼 보여지게 하려면 `browserWindow` 인자에 `BrowserWindow` 객체의 참조를 제공하면 됩니다. ## dialog.showOpenDialog([browserWindow], [options], [callback]) @@ -20,16 +20,15 @@ console.log(dialog.showOpenDialog({ properties: [ 'openFile', 'openDirectory', ' * `title` String * `defaultPath` String * `filters` Array - * `properties` Array - Contains which features the dialog should use, can - contain `openFile`, `openDirectory`, `multiSelections` and - `createDirectory` + * `properties` Array - 대화 상자가 사용할 기능(모드)이 담긴 배열입니다. + 다음을 포함할 수 있습니다: `openFile`, `openDirectory`, `multiSelections`, `createDirectory` * `callback` Function -On success, returns an array of file paths chosen by the user, otherwise -returns `undefined`. +사용할 대화 상자의 기능이 담긴 배열입니다. 다음을 포함할 수 있습니다: `openFile`, `openDirectory`, `multiSelections`, `createDirectory` -The `filters` specifies an array of file types that can be displayed or -selected, an example is: +작업에 성공하면 유저가 선택한 파일의 경로를 포함한 배열을 반환합니다. 그 외의 경우엔 `undefined`를 반환합니다. + +`filters`를 지정하면 유저가 선택 가능한 파일 형식을 지정할 수 있습니다. 예제는 다음과 같습니다: ```javascript { @@ -41,12 +40,10 @@ selected, an example is: } ``` -If a `callback` is passed, the API call would be asynchronous and the result -would be passed via `callback(filenames)` +`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(filenames)`을 통해 전달됩니다. -**Note:** On Windows and Linux, an open dialog can not be both a file selector -and a directory selector, so if you set `properties` to -`['openFile', 'openDirectory']` on these platforms, a directory selector will be shown. +Windows와 Linux에선 파일 선택 모드, 디렉터리 선택 모드를 동시에 사용할 수 없습니다. +그래서 이 두 플랫폼에선 `properties`를 `['openFile', 'openDirectory']`로 설정하면 디렉터리 선택 대화 상자가 표시됩니다. ## dialog.showSaveDialog([browserWindow], [options], [callback]) @@ -57,36 +54,41 @@ and a directory selector, so if you set `properties` to * `filters` Array * `callback` Function -On success, returns the path of the file chosen by the user, otherwise returns -`undefined`. +작업에 성공하면 -The `filters` specifies an array of file types that can be displayed, see -`dialog.showOpenDialog` for an example. +작업에 성공하면 유저가 선택한 파일의 경로를 포함한 배열을 반환합니다. 그 외의 경우엔 `undefined`를 반환합니다. -If a `callback` is passed, the API call will be asynchronous and the result -will be passed via `callback(filename)` +`filters`를 지정하면 유저가 저장 가능한 파일 형식을 지정할 수 있습니다. 사용 방법은 `dialog.showOpenDialog`의 `filters` 속성과 같습니다. + +`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(filename)`을 통해 전달됩니다. ## dialog.showMessageBox([browserWindow], options, [callback]) * `browserWindow` BrowserWindow * `options` Object - * `type` String - Can be `"none"`, `"info"` or `"warning"` - * `buttons` Array - Array of texts for buttons - * `title` String - Title of the message box, some platforms will not show it - * `message` String - Content of the message box - * `detail` String - Extra information of the message + ** `type` String - `"none"`, `"info"`, `"error"`, `"question"`, `"warning"` 중 하나를 사용할 수 있습니다. + * `buttons` Array - 버튼들의 라벨을 포함한 배열입니다. + * `title` String - 메시지 상자의 제목입니다. 몇몇 플랫폼에선 보이지 않을 수 있습니다. + * `message` String - 메시지 상자의 본문 내용입니다. + * `detail` String - 메시지의 추가 정보입니다. * `icon` [NativeImage](native-image-ko.md) + * `cancelId` Integer - 유저가 대화 상자의 버튼을 클릭하지 않고 대화 상자를 취소했을 때 반환되는 버튼의 index입니다. + 기본적으로 버튼 리스트가 "cancel" 또는 "no" 라벨을 가지고 있을 때 해당 버튼의 index를 반환합니다. 따로 두 라벨이 지정되지 않은 경우 0을 반환합니다. + OS X와 Windows에선 `cancelId` 지정 여부에 상관없이 "Cancel" 버튼이 언제나 `cancelId`로 지정됩니다. * `callback` Function -Shows a message box, it will block until the message box is closed. It returns -the index of the clicked button. +메시지 상자를 표시합니다. `browserWindow`를 지정하면 메시지 상자가 완전히 닫힐 때까지는 창을 사용할 수 없습니다. +완료시 유저가 선택한 버튼의 index를 반환합니다. -If a `callback` is passed, the API call will be asynchronous and the result -will be passed via `callback(response)` +역주: 부정을 표현하는 "아니오", "취소"와 같은 한글 단어는 지원되지 않습니다. +만약 OS X 또는 Windows에서 "확인", "취소"와 같은 순서로 버튼을 지정하게 될 때 Alt + f4로 해당 대화 상자를 끄게 되면 "확인"을 누른걸로 판단되어 버립니다. +이를 해결하려면 "Cancel"을 대신 사용하거나 BrowserWindow API를 사용하여 메시지 상자를 직접 구현해야합니다. + +`callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(response)`을 통해 전달됩니다. ## dialog.showErrorBox(title, content) -Runs a modal dialog that shows an error message. +에러 메시지를 보여주는 모달 대화 상자를 표시합니다. -This API can be called safely before the `ready` event of `app` module emits, it -is usually used to report errors in early stage of startup. +이 API는 `app` 모듈의 `ready` 이벤트가 발생하기 전에 사용할 수 있습니다. +이 메소드는 보통 어플리케이션이 시작되기 전에 특정한 에러를 표시하기 위해 사용됩니다. diff --git a/docs/api/frameless-window-ko.md b/docs/api/frameless-window-ko.md index 8315f48ec8ee..420b277d9b17 100644 --- a/docs/api/frameless-window-ko.md +++ b/docs/api/frameless-window-ko.md @@ -1,20 +1,19 @@ -# Frameless window +# Frameless 윈도우 -frameless window는 테두리가 없는 윈도우 창을 말합니다. +Frameless 윈도우는 테두리가 없는 윈도우 창을 말합니다. -## Frameless window 만들기 +## Frameless 윈도우 만들기 -Frameless window를 만드려면 [BrowserWindow](browser-window-ko.md) 객체의 `options`에서 `frame` 옵션을 `false`로 지정하기만 하면됩니다: +Frameless 윈도우를 만드려면 [BrowserWindow](browser-window-ko.md) 객체의 `options`에서 `frame` 옵션을 `false`로 지정하기만 하면됩니다: ```javascript var BrowserWindow = require('browser-window'); var win = new BrowserWindow({ width: 800, height: 600, frame: false }); ``` -## 투명한 윈도우 +## 투명한 창 만들기 -By setting the `transparent` option to `true`, you can also make the frameless -window transparent: +Frameless 윈도우의 창의 배경을 투명하게 만들고 싶다면 `transparent` 옵션을 `true`로 바꿔주기만 하면됩니다: ```javascript var win = new BrowserWindow({ transparent: true, frame: false }); @@ -22,39 +21,32 @@ var win = new BrowserWindow({ transparent: true, frame: false }); ### API의 한계 -* You can not click through the transparent area, we are going to introduce an - API to set window shape to solve this, but currently blocked at an - [upstream bug](https://code.google.com/p/chromium/issues/detail?id=387234). -* Transparent window is not resizable, setting `resizable` to `true` may make - transparent window stop working on some platforms. -* The `blur` filter only applies to the web page, so there is no way to apply - blur effect to the content below the window. -* On Windows transparent window will not work when DWM is disabled. -* On Linux users have to put `--enable-transparent-visuals --disable-gpu` in - command line to disable GPU and allow ARGB to make transparent window, this is - caused by an upstream bug that [alpha channel doesn't work on some NVidia - drivers](https://code.google.com/p/chromium/issues/detail?id=369209) on Linux. -* On Mac the native window shadow will not show for transparent window. + + +* 투명한 영역을 통과하여 클릭할 수 없습니다. 우리는 이 문제를 해결하기 위해 API를 제공할 예정이지만 현재로써는 + [upstream 버그](https://code.google.com/p/chromium/issues/detail?id=387234)로 인해 중단된 상태입니다. +* 투명한 창은 크기를 조절할 수 없습니다. `resizable` 속성을 `true`로 할 경우 몇몇 플랫폼에선 윈도우 크래시가 일어납니다. +* `blur` 필터는 웹 페이지에서만 적용됩니다. 윈도우 아래 컨텐츠에는 블러 효과를 적용할 방법이 없습니다. +* Windows에선 DWM(데스크톱 창 관리자)가 비활성화되어 있을 경우 작동하지 않습니다. +* Linux를 사용할 경우 [alpha channel doesn't work on some NVidia drivers](https://code.google.com/p/chromium/issues/detail?id=369209) + upstream 버그가 있으므로 CLI 옵션에 `--enable-transparent-visuals --disable-gpu`을 추가해야 합니다. + 이 옵션은 GPU의 사용을 중단하고 윈도우를 생성하는데 ARGB를 사용할 수 있도록 해줍니다. +* OS X(Mac)에선 네이티브 윈도우의 그림자가 투명한 창에선 보이지 않습니다. ## 드래그 가능 위치 지정 -By default, the frameless window is non-draggable. Apps need to specify -`-webkit-app-region: drag` in CSS to tell Electron which regions are draggable -(like the OS's standard titlebar), and apps can also use -`-webkit-app-region: no-drag` to exclude the non-draggable area from the - draggable region. Note that only rectangular shape is currently supported. +기본적으로 Frameless 윈도우는 드래그 할 수 없습니다. +어플리케이션의 CSS에서 특정 범위를 `-webkit-app-region: drag`로 지정하면 OS의 기본 타이틀바 처럼 드래그 되도록 할 수 있습니다. +그리고 `-webkit-app-region: no-drag`를 지정해서 드래그 불가능 영역을 만들 수도 있습니다. 현재 사각형 형태의 범위만 지원합니다. -To make the whole window draggable, you can add `-webkit-app-region: drag` as -`body`'s style: +창 전체를 드래그 가능하게 만드려면 `-webkit-app-region: drag`을 `body`의 스타일에 지정하면 됩니다: ```html ``` -And note that if you have made the whole window draggable, you must also mark -buttons as non-draggable, otherwise it would be impossible for users to click on -them: +참고로 창 전체를 드래그 영역으로 지정할 경우 사용자가 버튼을 클릭할 수 없게 되므로 버튼은 드래그 불가능 영역으로 지정해야 합니다: ```css button { @@ -62,15 +54,13 @@ button { } ``` -If you're only using a custom titlebar, you also need to make buttons in -titlebar non-draggable. +또한 커스텀 타이틀바를 만들어 사용할 때 타이틀바 내부의 버튼도 드래그 불가능 영역으로 지정해야 합니다. ## 텍스트 선택 -One thing on frameless window is that the dragging behaviour may conflict with -selecting text, for example, when you drag the titlebar, you may accidentally -select the text on titlebar. To prevent this, you need to disable text -selection on dragging area like this: +한가지, Frameless 윈도우에서 텍스트가 선택되는 드래그 동작은 혼란을 야기할 수 있습니다. +예를 들어 타이틀바를 드래그 할 때 타이틀바의 텍스트를 실수로 선택할 수 있습니다. +이를 방지하기 위해선 다음과 같이 드래그 영역의 텍스트 선택 동작을 비활성화해야 할 필요가 있습니다: ```css .titlebar { @@ -81,7 +71,5 @@ selection on dragging area like this: ## 컨텍스트 메뉴 -On some platforms, the draggable area would be treated as non-client frame, so -when you right click on it a system menu would be popuped. To make context menu -behave correctly on all platforms, you should never custom context menu on -draggable areas. +몇몇 플랫폼에선 드래그 가능 영역이 non-client 프레임으로 처리됩니다. 그래서 이 영역에서 오른쪽 클릭을 할 경우 시스템 메뉴가 팝업 됩니다. +그래서 컨텍스트 메뉴 지정이 모든 플랫폼에서 정상적으로 작동하게 하려면 커스텀 컨텍스트 메뉴를 드래그 영역 내에 만들어선 안됩니다. diff --git a/docs/api/menu-ko.md b/docs/api/menu-ko.md index 3ac62012f675..234aad4afeee 100644 --- a/docs/api/menu-ko.md +++ b/docs/api/menu-ko.md @@ -1,12 +1,10 @@ # menu -The `Menu` class is used to create native menus that can be used as -application menus and context menus. Each menu consists of multiple menu -items, and each menu item can have a submenu. +`Menu` 클래스는 어플리케이션 메뉴와 컨텍스트 메뉴를 만들 때 사용할 수 있습니다. +각 메뉴는 여러 개의 메뉴 아이템으로 구성되어 있으며 서브 메뉴를 가질 수도 있습니다. -Below is an example of creating a menu dynamically in a web page by using -the [remote](remote-ko.md) module, and showing it when the user right clicks -the page: +다음 예제는 웹 페이지 내에서 [remote](remote-ko.md) 모듈을 활용하여 동적으로 메뉴를 생성하는 예제입니다. +그리고 이 예제에서 만들어진 메뉴는 유저가 페이지에서 오른쪽 클릭을 할 때 마우스 위치에 팝업으로 표시됩니다: ```html @@ -27,7 +25,7 @@ window.addEventListener('contextmenu', function (e) { ``` -Another example of creating the application menu with the simple template API: +다음 예제는 template API를 활용하여 어플리케이션 메뉴를 만드는 간단한 예제입니다: ```html @@ -167,34 +165,30 @@ Menu.setApplicationMenu(menu); ### new Menu() -Creates a new menu. +새로운 메뉴를 생성합니다. ### Class Method: Menu.setApplicationMenu(menu) * `menu` Menu -Sets `menu` as the application menu on OS X. On Windows and Linux, the `menu` -will be set as each window's top menu. +지정한 `menu`를 이용하여 어플리케이션 메뉴를 만듭니다. OS X에선 상단바에 표시되며 Windows와 Linux에선 각 창의 상단에 표시됩니다. ### Class Method: Menu.sendActionToFirstResponder(action) * `action` String -Sends the `action` to the first responder of application, this is used for -emulating default Cocoa menu behaviors, usually you would just use the -`selector` property of `MenuItem`. +`action`을 어플리케이션의 first responder에 전달합니다. +이 함수는 Cocoa 메뉴 동작을 에뮬레이트 하는데 사용되며 보통 `MenuItem`의 `selector` 속성에 사용됩니다. -**Note:** This method is OS X only. +**알림:** 이 함수는 OS X에서만 사용할 수 있습니다. ### Class Method: Menu.buildFromTemplate(template) * `template` Array -Generally, the `template` is just an array of `options` for constructing -[MenuItem](menu-item-ko.md), the usage can be referenced above. +기본적으로 `template`는 [MenuItem](menu-item-ko.md)을 생성할 때 사용하는 `options`의 배열입니다. 사용법은 위에서 설명한 것과 같습니다. -You can also attach other fields to element of the `template`, and they will -become properties of the constructed menu items. +또한 `template`에는 다른 속성도 추가할 수 있으며 메뉴가 만들어질 때 해당 메뉴 아이템의 프로퍼티로 변환됩니다. ### Menu.popup(browserWindow, [x, y]) @@ -202,86 +196,70 @@ become properties of the constructed menu items. * `x` Number * `y` Number -Popups this menu as a context menu in the `browserWindow`. You can optionally -provide a `(x,y)` coordinate to place the menu at, otherwise it will be placed -at the current mouse cursor position. +메뉴를 `browserWindow` 안에서 팝업으로 표시합니다. +옵션으로 메뉴를 표시할 `(x,y)` 좌표를 임의로 지정할 수 있습니다. 따로 지정하지 않은 경우 마우스 커서 위치에 표시됩니다. ### Menu.append(menuItem) * `menuItem` MenuItem -Appends the `menuItem` to the menu. +메뉴의 리스트 끝에 `menuItem`을 삽입합니다. ### Menu.insert(pos, menuItem) * `pos` Integer * `menuItem` MenuItem -Inserts the `menuItem` to the `pos` position of the menu. +`pos` 위치에 `menuItem`을 삽입합니다. ### Menu.items -Get the array containing the menu's items. +메뉴가 가지고 있는 메뉴 아이템들의 배열입니다. -## Notes on OS X application menu +## OS X 어플리케이션 메뉴에 대해 알아 둬야 할 것들 -OS X has a completely different style of application menu from Windows and -Linux, and here are some notes on making your app's menu more native-like. +OS X에선 Windows, Linux와 달리 완전히 다른 어플리케이션 메뉴 스타일을 가지고 있습니다. +어플리케이션을 네이티브처럼 작동할 수 있도록 하기 위해선 다음의 몇 가지 유의 사항을 숙지해야 합니다. -### Standard menus +### 기본 메뉴 -On OS X there are many system defined standard menus, like the `Services` and -`Windows` menus. To make your menu a standard menu, you can just set your menu's -label to one of followings, and Electron will recognize them and make them -become standard menus: +OS X엔 `Services`나 `Windows`와 같은 많은 시스템 지정 기본 메뉴가 있습니다. +기본 메뉴를 만들려면 다음 중 하나를 메뉴의 라벨로 지정하기만 하면 됩니다. +그러면 Electron이 자동으로 인식하여 해당 메뉴를 기본 메뉴로 만듭니다: * `Window` * `Help` * `Services` -### Standard menu item actions +### 기본 메뉴 아이템 동작 -OS X has provided standard actions for some menu items (which are called -`selector`s), like `About xxx`, `Hide xxx`, and `Hide Others`. To set the action -of a menu item to a standard action, you can set the `selector` attribute of the -menu item. +OS X는 몇몇의 메뉴 아이템에 대해 `About xxx`, `Hide xxx`, `Hide Others`와 같은 기본 동작을 제공하고 있습니다. (`selector`라고 불립니다) +메뉴 아이템의 기본 동작을 지정하려면 메뉴 아이템의 `selector` 속성을 사용하면 됩니다. -### Main menu's name +### 메인 메뉴의 이름 -On OS X the label of application menu's first item is always your app's name, -no matter what label you set. To change it you have to change your app's name -by modifying your app bundle's `Info.plist` file. See -[About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html) -for more. +OS X에선 지정한 어플리케이션 메뉴에 상관없이 메뉴의 첫번째 라벨은 언제나 어플리케이션의 이름이 됩니다. +어플리케이션 이름을 변경하려면 앱 번들내의 `Info.plist` 파일을 수정해야합니다. +자세한 내용은 [About Information Property List Files](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html)을 참고하세요. +## 메뉴 아이템 위치 -## Menu item position +`Menu.buildFromTemplate`로 메뉴를 만들 때 `position`과 `id`를 사용해서 아이템의 위치를 지정할 수 있습니다. -You can make use of `position` and `id` to control how the item would be placed -when building a menu with `Menu.buildFromTemplate`. +`MenuItem`의 `position` 속성은 `[placement]=[id]`와 같은 형식을 가지며 `placement`는 +`before`, `after`, `endof` 속성 중 한가지를 사용할 수 있고 `id`는 메뉴 아이템이 가지는 유일 ID 입니다: -The `position` attribute of `MenuItem` has the form `[placement]=[id]` where -placement is one of `before`, `after`, or `endof` and `id` is the unique ID of -an existing item in the menu: +* `before` - 이 아이템을 지정한 id 이전의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. +* `after` - 이 아이템을 지정한 id 다음의 위치에 삽입합니다. 만약 참조된 아이템이 없을 경우 메뉴의 맨 뒤에 삽입됩니다. +* `endof` - 이 아이템을 id의 논리 그룹에 맞춰서 각 그룹의 항목 뒤에 삽입합니다. (그룹은 분리자 아이템에 의해 만들어집니다) + 만약 참조된 아이템의 분리자 그룹이 존재하지 않을 경우 지정된 id로 새로운 분리자 그룹을 만든 후 해당 그룹의 뒤에 삽입됩니다. -* `before` - Inserts this item before the id referenced item. If the - referenced item doesn't exist the item will be inserted at the end of - the menu. -* `after` - Inserts this item after id referenced item. If the referenced - item doesn't exist the item will be inserted at the end of the menu. -* `endof` - Inserts this item at the end of the logical group containing - the id referenced item. (Groups are created by separator items). If - the referenced item doesn't exist a new separator group is created with - the given id and this item is inserted after that separator. +위치를 지정한 아이템의 뒤에 위치가 지정되지 않은 아이템이 있을 경우 해당 아이템의 위치가 지정되기 전까지 이전에 위치가 지정된 아이템의 위치 지정을 따릅니다. +이에 따라 위치를 이동하고 싶은 특정 그룹의 아이템들이 있을 경우 해당 그룹의 맨 첫번째 메뉴 아이템의 위치만을 지정하면 됩니다. -When an item is positioned following unpositioned items are inserted after -it, until a new item is positioned. So if you want to position a group of -menu items in the same location you only need to specify a position for -the first item. +### 예제 -### Examples - -Template: +메뉴 템플릿: ```javascript [ @@ -293,7 +271,7 @@ Template: ] ``` -Menu: +메뉴: ``` - 1 @@ -303,7 +281,7 @@ Menu: - 5 ``` -Template: +메뉴 템플릿: ```javascript [ @@ -316,7 +294,7 @@ Template: ] ``` -Menu: +메뉴: ``` - --- diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md index 26fc4eb740c4..20243ab95824 100644 --- a/docs/api/protocol-ko.md +++ b/docs/api/protocol-ko.md @@ -19,18 +19,20 @@ app.on('ready', function() { **알림:** 이 모듈은 app의 `ready` 이벤트가 발생한 이후에만 사용할 수 있습니다. -## protocol.registerProtocol(scheme, handler) +## protocol.registerProtocol(scheme, handler, callback) * `scheme` String * `handler` Function +* `callback` Function -지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler` 함수가 호출됩니다. +지정한 `scheme`을 기반으로 커스텀 프로토콜을 등록합니다. `handler`는 등록한 `scheme` 프로토콜에 요청이 들어올 경우 `request` 인자와 함께 `handler(request)` 형식으로 호출됩니다. -호출된 `handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 할 필요가 있습니다. +`handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 합니다. -## protocol.unregisterProtocol(scheme) +## protocol.unregisterProtocol(scheme, callback) * `scheme` String +* `callback` Function 지정한 `scheme` 프로토콜을 등록 해제합니다. @@ -40,23 +42,27 @@ app.on('ready', function() { 지정한 `value` 배열을 사용하여 미리 지정된 스킴으로 등록합니다. -## protocol.isHandledProtocol(scheme) +## protocol.isHandledProtocol(scheme, callback) * `scheme` String +* `callback` Function 해당 `scheme`에 처리자(handler)가 등록되었는지 확인합니다. +지정한 `callback`에 결과가 boolean 값으로 반환됩니다. -## protocol.interceptProtocol(scheme, handler) +## protocol.interceptProtocol(scheme, handler, callback) * `scheme` String * `handler` Function +* `callback` Function 지정한 `scheme`의 작업을 `handler`로 변경합니다. `handler`에서 `null` 또는 `undefined`를 반환 할 경우 해당 프로토콜의 기본 동작(응답)으로 대체 됩니다. -## protocol.uninterceptProtocol(scheme) +## protocol.uninterceptProtocol(scheme, callback) * `scheme` String +* `callback` Function 변경된 프로토콜의 작업을 해제합니다. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md index 0feb53ece5ee..11d62dd27194 100644 --- a/docs/api/remote-ko.md +++ b/docs/api/remote-ko.md @@ -1,7 +1,6 @@ # remote -The `remote` module provides a simple way to do inter-process communication -between the renderer process and the main process. +`remote` 모듈은 메인 프로세스와 랜더러 프로세스 사이에 inter-process 통신을 하기 위한 가장 간단한 방법입니다. In Electron, only GUI-unrelated modules are available in the renderer process. Without the `remote` module, users who wanted to call a main process API in diff --git a/docs/api/screen-ko.md b/docs/api/screen-ko.md index c554863586cc..6b508991e4f7 100644 --- a/docs/api/screen-ko.md +++ b/docs/api/screen-ko.md @@ -1,13 +1,14 @@ # screen -Gets various info about screen size, displays, cursor position, etc. You should -not use this module until the `ready` event of `app` module gets emitted. +`screen` 모듈은 화면 크기, 디스플레이, 커서 위치 등등의 다양한 정보를 가져옵니다. +이 모듈은 `app` 모듈의 `ready` 이벤트가 발생하기 전까지 사용할 수 없습니다. -`screen` is an [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). +`screen`은 [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)를 상속 받았습니다. -Make sure to note that in the renderer / DevTools, `window.screen` is a reserved DOM property, so writing `screen = require('screen')` won't work. In our examples below, we use `atomScreen` as the variable name instead. +한가지 주의할 점은 랜더러 / DevTools에선 이 모듈의 이름인 `screen`은 이미 DOM 속성에 `window.screen`로 존재 하므로 `screen = require('screen')`를 +사용할 수 없습니다. 밑의 예제와 같이 `atomScreen`등의 이름으로 변수 이름을 대체하여 사용해야 합니다. -An example of creating a window that fills the whole screen: +다음 예제는 화면 전체를 채우는 윈도우 창을 생성합니다: ```javascript var app = require('app'); @@ -22,7 +23,7 @@ app.on('ready', function() { }); ``` -Another example of creating a window in the external display: +다음 예제는 확장 디스플레이에 윈도우를 생성합니다: ```javascript var app = require('app'); @@ -55,14 +56,14 @@ app.on('ready', function() { * `event` Event * `newDisplay` Object -Emitted when `newDisplay` has been added. +새로운 디스플레이가 추가되면 발생합니다. ## Event: display-removed * `event` Event * `oldDisplay` Object -Emitted when `oldDisplay` has been removed. +기존의 디스플레이가 제거되면 발생합니다. ## Event: display-metrics-changed @@ -70,21 +71,21 @@ Emitted when `oldDisplay` has been removed. * `display` Object * `changedMetrics` Array -Emitted when a `display` has one or more metrics changed, `changedMetrics` is -an array of strings that describe the changes. Possible changes are `bounds`, -`workArea`, `scaleFactor` and `rotation`. +`display`의 하나 또는 다수의 매트릭스가 변경될 경우 발생합니다. +`changedMetrics`는 변경에 대한 정보를 담은 문자열의 배열입니다. +`bounds`, `workArea`, `scaleFactor`, `rotation`등이 변경될 수 있습니다. ## screen.getCursorScreenPoint() -Returns the current absolute position of the mouse pointer. +현재 마우스 포인터의 절대 위치를 반환합니다. ## screen.getPrimaryDisplay() -Returns the primary display. +기본 디스플레이를 반환합니다. ## screen.getAllDisplays() -Returns an array of displays that are currently available. +사용 가능한 모든 디스플레이를 배열로 반환합니다. ## screen.getDisplayNearestPoint(point) @@ -92,7 +93,7 @@ Returns an array of displays that are currently available. * `x` Integer * `y` Integer -Returns the display nearest the specified point. +지정한 좌표에 가까운 디스플레이를 반환합니다. ## screen.getDisplayMatching(rect) @@ -102,4 +103,4 @@ Returns the display nearest the specified point. * `width` Integer * `height` Integer -Returns the display that most closely intersects the provided bounds. +지정한 범위에 가장 가깝게 교차한 디스플레이를 반환합니다. diff --git a/docs/api/shell-ko.md b/docs/api/shell-ko.md index 5811afdcb930..d9ceea106a54 100644 --- a/docs/api/shell-ko.md +++ b/docs/api/shell-ko.md @@ -26,7 +26,7 @@ shell.openExternal('https://github.com'); * `url` String 제공된 외부 프로토콜 URL을 기반으로 데스크톱의 기본 프로그램으로 엽니다. (예를 들어 mailto: URL은 해당 URL을 기본 메일 에이전트로 엽니다.) -역자주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) +역주: 폴더는 'file:\\\\C:\\'와 같이 지정하여 열 수 있습니다. (`\\`로 경로를 표현한 이유는 Escape 문자열을 참고하세요.) ## shell.moveItemToTrash(fullPath) diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index ec955f3439a7..3d7f9389f77b 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -89,7 +89,16 @@ $ ./script/clean.py ## 문제 해결 -개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. +개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. + +## libtinfo.so.5 동적 링크 라이브러리를 로드하는 도중 에러가 발생할 경우 + +미리 빌드된 `clang`은 `libtinfo.so.5`로 링크를 시도합니다. +플랫폼에 따라 적당한 `libncurses` symlink를 추가하세요. + +```bash +$ sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5 +``` ## 테스트 diff --git a/docs/development/build-system-overview-ko.md b/docs/development/build-system-overview-ko.md index 92fd50008529..7198fa831b92 100644 --- a/docs/development/build-system-overview-ko.md +++ b/docs/development/build-system-overview-ko.md @@ -25,9 +25,14 @@ Electron도 상당히 비슷한 접근을 했습니다: ## 부트스트랩 최소화 -모든 사전 빌드 된 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. +Prebuilt된 모든 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. 기본적으로 공유 라이브러리와 정적 라이브러리 모두 다운로드되며 최종 전체 파일 크기는 플랫폼에 따라 800MB에서 2GB까지 차지합니다. +기본적으로 libchromiumcontent는 Amazon Web Service를 통해 다운로드 됩니다. +만약 `LIBCHROMIUMCONTENT_MIRROR` 환경 변수가 설정되어 있으면 부트스트랩은 해당 링크를 사용하여 바이너리를 다운로드 합니다. +[libchromiumcontent-qiniu-mirror](https://github.com/hokein/libchromiumcontent-qiniu-mirror)는 libchromiumcontent의 미러입니다. +만약 AWS에 접근할 수 없다면 `export LIBCHROMIUMCONTENT_MIRROR=http://7xk3d2.dl1.z0.glb.clouddn.com/`를 통해 다운로드 할 수 있습니다. + 만약 빠르게 Electron의 개발 또는 테스트만 하고 싶다면 `--dev` 플래그를 추가하여 공유 라이브러리만 다운로드할 수 있습니다: ```bash diff --git a/docs/tutorial/application-distribution-ko.md b/docs/tutorial/application-distribution-ko.md index a1bb5bc65044..0b6ff631ad70 100644 --- a/docs/tutorial/application-distribution-ko.md +++ b/docs/tutorial/application-distribution-ko.md @@ -99,7 +99,7 @@ MyApp.app/Contents 실행파일 `electron`의 이름을 원하는 대로 바꿀 수 있습니다. 리눅스 어플리케이션의 아이콘은 [.desktop](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) 파일을 사용하여 지정할 수 있습니다. -### 역자주-자동화 +### 역주-자동화 배포시에 Electron의 리소스를 일일이 수정하는 것은 매우 귀찮고 복잡합니다. 하지만 이 작업을 자동화 시킬 수 있는 몇가지 방법이 있습니다: diff --git a/docs/tutorial/quick-start-ko.md b/docs/tutorial/quick-start-ko.md index e5ef8662cd7a..a49b7e017609 100644 --- a/docs/tutorial/quick-start-ko.md +++ b/docs/tutorial/quick-start-ko.md @@ -75,6 +75,8 @@ var mainWindow = null; // 모든 창이 닫히면 어플리케이션 종료. app.on('window-all-closed', function() { + // OSX의 대부분의 어플리케이션에선 유저가 Cmd + Q 커맨드로 확실하게 종료하기 전까지는 + // 어플리케이션이 메뉴바에 남아 계속 실행됩니다. if (process.platform != 'darwin') { app.quit(); } @@ -112,16 +114,16 @@ app.on('ready', function() {

헬로 월드!

- 우리는 io.js 버전과 - Electron 버전을 사용합니다. + 이 어플리케이션은 io.js 과 + Electron 을 사용합니다. ``` ## 앱 실행하기 -앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 -패키징한 앱을 실행해 볼 수 있습니다. 또한 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. +앱을 작성한 후 [어플리케이션 배포](./application-distribution-ko.md) 가이드를 따라 앱을 패키징 하고 패키징한 앱을 실행할 수 있습니다. +또는 Electron 실행파일을 다운로드 받아 바로 실행해 볼 수도 있습니다. Windows의 경우: diff --git a/docs/tutorial/using-native-node-modules-ko.md b/docs/tutorial/using-native-node-modules-ko.md index da68c475ba83..1e67ee25305d 100644 --- a/docs/tutorial/using-native-node-modules-ko.md +++ b/docs/tutorial/using-native-node-modules-ko.md @@ -1,6 +1,6 @@ # 네이티브 node 모듈 사용하기 -__역자주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ +__역주: 현재 Electron은 node.js대신 io.js를 사용합니다. 문서에 기재된 버전과 다를 수 있습니다__ Electron에선 node.js 네이티브 모듈이 지원됩니다. 하지만 Electron은 공식 node.js의 V8 엔진과는 달리 다른 V8 버전을 사용합니다. 그런 이유로 네이티브 모듈을 사용하기 위해선 Electron의 V8 버전에 맞춰 네이티브 모듈을 다시 빌드하고 헤더를 변경해야 합니다. @@ -34,11 +34,11 @@ Node 모듈을 `node-gyp`를 사용하여 Electron을 타겟으로 빌드할 땐 ```bash $ cd /path-to-module/ -$ HOME=~/.electron-gyp node-gyp rebuild --target=0.25.0 --arch=ia64 --dist-url=https://atom.io/download/atom-shell +$ HOME=~/.electron-gyp node-gyp rebuild --target=0.29.1 --arch=x64 --dist-url=https://atom.io/download/atom-shell ``` -`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.25.0`은 Electron의 버전입니다. -`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=ia64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. +`HOME=~/.electron-gyp`은 변경할 헤더의 위치를 찾습니다. `--target=0.29.1`은 Electron의 버전입니다. +`--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=x64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. ### npm을 이용한 방법 @@ -47,7 +47,7 @@ $ HOME=~/.electron-gyp node-gyp rebuild --target=0.25.0 --arch=ia64 --dist-url=h ```bash export npm_config_disturl=https://atom.io/download/atom-shell -export npm_config_target=0.25.0 +export npm_config_target=0.29.1 export npm_config_arch=x64 HOME=~/.electron-gyp npm install module-name ``` From 0dfcc7a9b38663c2aab72122cbbde159345d85f2 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Sun, 12 Jul 2015 14:54:55 +0900 Subject: [PATCH 05/16] Update changes as upstream --- docs/README-ko.md | 2 +- docs/api/global-shortcut-ko.md | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/README-ko.md b/docs/README-ko.md index 6e0daa59fd2b..135d6b5c657f 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -69,4 +69,4 @@ 이 참조문서는 [@preco21](https://github.com/preco21)에 의해 번역되었습니다. 문서내에서 오타나 잘못된 번역을 발견하면 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. -원본과는 달리 항시 최신버전을 유지할 수 없으므로 원본을 같이 참고하는 것을 권장합니다. +문서는 항시 최신버전을 유지할 수 없으므로 원본을 같이 참고하는 것을 권장합니다. diff --git a/docs/api/global-shortcut-ko.md b/docs/api/global-shortcut-ko.md index 6626882368bc..a69dd4ee4ce4 100644 --- a/docs/api/global-shortcut-ko.md +++ b/docs/api/global-shortcut-ko.md @@ -2,25 +2,31 @@ `global-shortcut` 모듈은 사용자가 다양한 단축키 작업을 정의 할 수 있도록 운영체제의 전역 키보드 단축키를 설정 등록/해제 하는 방법을 제공합니다. 참고로 설정된 단축키는 어플리케이션이 백그라운드로 작동(창이 포커스 되지 않음) 할 때도 여전히 계속 작동합니다. +이 모듈은 `app` 모듈의 `ready` 이밴트 이전에 사용할 수 없습니다. ```javascript +var app = require('app'); var globalShortcut = require('global-shortcut'); -// 'ctrl+x' 단축키를 리스너에 등록합니다. -var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) +app.on('ready', function() { + // 'ctrl+x' 단축키를 리스너에 등록합니다. + var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) -if (!ret) { - console.log('registration failed'); -} + if (!ret) { + console.log('registration failed'); + } -// 단축키가 등록되었는지 확인합니다. -console.log(globalShortcut.isRegistered('ctrl+x')); + // 단축키가 등록되었는지 확인합니다. + console.log(globalShortcut.isRegistered('ctrl+x')); +}); -// 단축키의 등록을 해제합니다. -globalShortcut.unregister('ctrl+x'); +app.on('will-quit', function() { + // 단축키의 등록을 해제합니다. + globalShortcut.unregister('ctrl+x'); -// 모든 단축키의 등록을 해제합니다. -globalShortcut.unregisterAll(); + // 모든 단축키의 등록을 해제합니다. + globalShortcut.unregisterAll(); +}); ``` ## globalShortcut.register(accelerator, callback) From 26163e581249e0b1e48ea98a8e868497279566b8 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Wed, 15 Jul 2015 08:07:09 +0900 Subject: [PATCH 06/16] Prepare update forked repo --- docs/api/content-tracing-ko.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md index e9fa3158a2fb..a66a4635bdbd 100644 --- a/docs/api/content-tracing-ko.md +++ b/docs/api/content-tracing-ko.md @@ -20,6 +20,8 @@ tracing.startRecording('*', tracing.DEFAULT_OPTIONS, function() { * `callback` Function +카테고리 그룹 set을 가져옵니다. 카테고리 그룹은 도달 대상이 되는 코드 경로를 변경할 수 있습니다. + Get a set of category groups. The category groups can change as new code paths are reached. From b52491400877b87525b1bd29356cddd0bf8739c3 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Wed, 15 Jul 2015 08:30:02 +0900 Subject: [PATCH 07/16] Update as upstream --- docs/api/browser-window-ko.md | 52 ++++++++++++++----- docs/api/chrome-command-line-switches-ko.md | 4 ++ docs/api/global-shortcut-ko.md | 22 ++++---- docs/api/protocol-ko.md | 3 ++ .../build-instructions-linux-ko.md | 9 +++- 5 files changed, 65 insertions(+), 25 deletions(-) diff --git a/docs/api/browser-window-ko.md b/docs/api/browser-window-ko.md index 38b78459d25a..29a07661409d 100644 --- a/docs/api/browser-window-ko.md +++ b/docs/api/browser-window-ko.md @@ -16,7 +16,7 @@ win.show(); ``` You can also create a window without chrome by using -[Frameless Window](frameless-window-ko.md) API. +[Frameless Window](frameless-window.md) API. ## Class: BrowserWindow @@ -48,11 +48,11 @@ You can also create a window without chrome by using zoom percent / 100, so `3.0` represents `300%` * `kiosk` Boolean - The kiosk mode * `title` String - Default window title - * `icon` [NativeImage](native-image-ko.md) - The window icon, when omitted on + * `icon` [NativeImage](native-image.md) - The window icon, when omitted on Windows the executable's icon would be used as window icon * `show` Boolean - Whether window should be shown when created * `frame` Boolean - Specify `false` to create a - [Frameless Window](frameless-window-ko.md) + [Frameless Window](frameless-window.md) * `node-integration` Boolean - Whether node integration is enabled, default is `true` * `accept-first-mouse` Boolean - Whether the web view accepts a single @@ -68,7 +68,7 @@ You can also create a window without chrome by using scripts run in the window. This script will always have access to node APIs no matter whether node integration is turned on for the window, and the path of `preload` script has to be absolute path. - * `transparent` Boolean - Makes the window [transparent](frameless-window-ko.md) + * `transparent` Boolean - Makes the window [transparent](frameless-window.md) * `type` String - Specifies the type of the window, possible types are `desktop`, `dock`, `toolbar`, `splash`, `notification`. This only works on Linux. @@ -566,11 +566,11 @@ Opens the developer tools for the service worker context present in the web cont Captures the snapshot of page within `rect`, upon completion `callback` would be called with `callback(image)`, the `image` is an instance of -[NativeImage](native-image-ko.md) that stores data of the snapshot. Omitting the +[NativeImage](native-image.md) that stores data of the snapshot. Omitting the `rect` would capture the whole visible page. **Note:** Be sure to read documents on remote buffer in -[remote](remote-ko.md) if you are going to use this API in renderer +[remote](remote.md) if you are going to use this API in renderer process. ### BrowserWindow.print([options]) @@ -613,7 +613,7 @@ it will assume `app.getName().desktop`. ### BrowserWindow.setOverlayIcon(overlay, description) -* `overlay` [NativeImage](native-image-ko.md) - the icon to display on the bottom +* `overlay` [NativeImage](native-image.md) - the icon to display on the bottom right corner of the taskbar icon. If this parameter is `null`, the overlay is cleared * `description` String - a description that will be provided to Accessibility @@ -784,6 +784,10 @@ Emitted when a plugin process is crashed. Emitted when the WebContents is destroyed. +### WebContents.session + +Returns the `Session` object used by this WebContents. + ### WebContents.loadUrl(url, [options]) * `url` URL @@ -1055,7 +1059,9 @@ app.on('ready', function() { 2. There is no way to send synchronous messages from the main process to a renderer process, because it would be very easy to cause dead locks. -## Class: WebContents.session.cookies +## Class: Session + +### Session.cookies The `cookies` gives you ability to query and modify cookies, an example is: @@ -1091,7 +1097,7 @@ win.webContents.on('did-finish-load', function() { }); ``` -### WebContents.session.cookies.get(details, callback) +### Session.cookies.get(details, callback) * `details` Object * `url` String - Retrieves cookies which are associated with `url`. @@ -1113,12 +1119,12 @@ win.webContents.on('did-finish-load', function() { * `secure` Boolean - Whether the cookie is marked as Secure (typically HTTPS) * `http_only` Boolean - Whether the cookie is marked as HttpOnly * `session` Boolean - Whether the cookie is a session cookie or a persistent - cookie with an expiration date. + cookie with an expiration date. * `expirationDate` Double - (Option) The expiration date of the cookie as - the number of seconds since the UNIX epoch. Not provided for session cookies. + the number of seconds since the UNIX epoch. Not provided for session cookies. -### WebContents.session.cookies.set(details, callback) +### Session.cookies.set(details, callback) * `details` Object * `url` String - Retrieves cookies which are associated with `url` @@ -1134,10 +1140,30 @@ win.webContents.on('did-finish-load', function() { * `callback` Function - function(error) * `error` Error -### WebContents.session.cookies.remove(details, callback) +### Session.cookies.remove(details, callback) * `details` Object * `url` String - The URL associated with the cookie * `name` String - The name of cookie to remove * `callback` Function - function(error) * `error` Error + +### Session.clearCache(callback) + +* `callback` Function - Called when operation is done + +Clears the session's HTTP cache. + +### Session.clearStorageData([options, ]callback) + +* `options` Object + * `origin` String - Should follow `window.location.origin`'s representation + `scheme://host:port` + * `storages` Array - The types of storages to clear, can contain: + `appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`, + `shadercache`, `websql`, `serviceworkers` + * `quotas` Array - The types of quotas to clear, can contain: + `temporary`, `persistent`, `syncable` +* `callback` Function - Called when operation is done + +Clears the data of web storages. diff --git a/docs/api/chrome-command-line-switches-ko.md b/docs/api/chrome-command-line-switches-ko.md index ed8cf55e06ec..7d1a7011eff6 100644 --- a/docs/api/chrome-command-line-switches-ko.md +++ b/docs/api/chrome-command-line-switches-ko.md @@ -34,6 +34,10 @@ HTTP 요청 캐시를 비활성화 합니다. 시스템 설정의 프록시 서버를 무시하고 지정한 서버로 연결합니다. HTTP와 HTTPS 요청에만 적용됩니다. +## --proxy-pac-url=`url` + +지정한 `url`의 PAC 스크립트를 사용합니다. + ## --no-proxy-server 프록시 서버를 사용하지 않습니다. 다른 프록시 서버 플래그 및 설정을 무시하고 언제나 직접 연결을 사용합니다. diff --git a/docs/api/global-shortcut-ko.md b/docs/api/global-shortcut-ko.md index a69dd4ee4ce4..6ad3fb5109fc 100644 --- a/docs/api/global-shortcut-ko.md +++ b/docs/api/global-shortcut-ko.md @@ -9,23 +9,23 @@ var app = require('app'); var globalShortcut = require('global-shortcut'); app.on('ready', function() { - // 'ctrl+x' 단축키를 리스너에 등록합니다. - var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) + // 'ctrl+x' 단축키를 리스너에 등록합니다. + var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) - if (!ret) { - console.log('registration failed'); - } + if (!ret) { + console.log('registration failed'); + } - // 단축키가 등록되었는지 확인합니다. - console.log(globalShortcut.isRegistered('ctrl+x')); + // 단축키가 등록되었는지 확인합니다. + console.log(globalShortcut.isRegistered('ctrl+x')); }); app.on('will-quit', function() { - // 단축키의 등록을 해제합니다. - globalShortcut.unregister('ctrl+x'); + // 단축키의 등록을 해제합니다. + globalShortcut.unregister('ctrl+x'); - // 모든 단축키의 등록을 해제합니다. - globalShortcut.unregisterAll(); + // 모든 단축키의 등록을 해제합니다. + globalShortcut.unregisterAll(); }); ``` diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md index 20243ab95824..ef1e15ebf03d 100644 --- a/docs/api/protocol-ko.md +++ b/docs/api/protocol-ko.md @@ -13,6 +13,9 @@ app.on('ready', function() { protocol.registerProtocol('atom', function(request) { var url = request.url.substr(7) return new protocol.RequestFileJob(path.normalize(__dirname + '/' + url)); + }, function (error, scheme) { + if (!error) + console.log(scheme, ' registered successfully') }); }); ``` diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index 3d7f9389f77b..c946e9adeaad 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -46,7 +46,14 @@ $ ./script/bootstrap.py -v ### 크로스 컴파일 -크로스 컴파일을 하려면 `bootstrap.py` 스크립트의 `--target_arch` 파라미터에 `arm` 또는 `ia32` 타겟 아키텍쳐를 전달하면 됩니다. +`arm` 아키텍쳐로 빌드 하려면 먼저 종속성 라이브러리를 설치해야 합니다: + +```bash +$ sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross \ + g++-arm-linux-gnueabihf +``` + +그리고 `bootstrap.py` 스크립트의 `--target_arch` 파라미터에 `arm` 또는 `ia32` 아키텍쳐를 지정하여 크로스 컴파일 할 수 있습니다: ```bash $ ./script/bootstrap.py -v --target_arch=arm From 72d332dfa046e79a94eb3745ce7e8b0d855b572b Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 17 Jul 2015 09:18:16 +0900 Subject: [PATCH 08/16] Translate little files into korean --- docs/api/auto-updater-ko.md | 38 ++++++++++++++-------------------- docs/api/content-tracing-ko.md | 2 +- docs/api/remote-ko.md | 2 +- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/docs/api/auto-updater-ko.md b/docs/api/auto-updater-ko.md index bcfc3b562682..9466bd190957 100644 --- a/docs/api/auto-updater-ko.md +++ b/docs/api/auto-updater-ko.md @@ -2,38 +2,30 @@ **이 모듈은 현재 OS X에서만 사용할 수 있습니다.** -Check out [atom/grunt-electron-installer](https://github.com/atom/grunt-electron-installer) -for building a Windows installer for your app. +Windows 어플리케이션 인스톨러를 생성하려면 [atom/grunt-electron-installer](https://github.com/atom/grunt-electron-installer)를 참고하세요. -The `auto-updater` module is a simple wrap around the -[Squirrel.Mac](https://github.com/Squirrel/Squirrel.Mac) framework. +`auto-updater` 모듈은 [Squirrel.Mac](https://github.com/Squirrel/Squirrel.Mac) 프레임워크의 간단한 Wrapper입니다. -Squirrel.Mac requires that your `.app` folder is signed using the +Squirrel.Mac은 업데이트 설치를 위해 `.app` 폴더에 [codesign](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/codesign.1.html) -utility for updates to be installed. +툴을 사용한 서명을 요구합니다. ## Squirrel -Squirrel is an OS X framework focused on making application updates **as safe -and transparent as updates to a website**. +Squirrel은 어플리케이션이 **안전하고 투명한 웹사이트 업데이트**를 할 수 있도록 하는데 초점이 맞춰진 OS X 프레임워크입니다. -Instead of publishing a feed of versions from which your app must select, -Squirrel updates to the version your server tells it to. This allows you to -intelligently update your clients based on the request you give to Squirrel. +Squirrel은 사용자에게 어플리케이션의 업데이트를 알릴 필요 없이 서버가 지시하는 버전을 받아온 후 자동으로 업데이트합니다. +이 기능을 사용하면 Squirrel을 통해 클라이언트의 어플리케이션을 지능적으로 업데이트 할 수 있습니다. -Your request can include authentication details, custom headers or a request -body so that your server has the context it needs in order to supply the most -suitable update. +요청시 커스텀 헤더 또는 요청 본문에 인증 정보를 포함시킬 수도 있습니다. +서버에선 이러한 요청을 분류 처리하여 적당한 업데이트를 제공할 수 있습니다. -The update JSON Squirrel requests should be dynamically generated based on -criteria in the request, and whether an update is required. Squirrel relies -on server side support for determining whether an update is required, see -[Server Support](#server-support). +Squirrel JSON 업데이트 요청시 처리는 반드시 어떤 업데이트가 필요한지 요청의 기준에 맞춰 동적으로 생성되어야 합니다. +Squirrel은 사용해야 하는 업데이트 선택하는 과정을 서버에 의존합니다. [서버 지원](#server-support)을 참고하세요. -Squirrel's installer is also designed to be fault tolerant, and ensure that any -updates installed are valid. +Squirrel의 인스톨러는 오류에 관대하게 설계되었습니다. 그리고 업데이트가 유효한지 확인합니다. -## Update Requests +## 업데이트 요청 Squirrel is indifferent to the request the client application provides for update checking. `Accept: application/json` is added to the request headers @@ -59,7 +51,7 @@ var autoUpdater = require('auto-updater'); autoUpdater.setFeedUrl('http://mycompany.com/myapp/latest?version=' + app.getVersion()); ``` -## Server Support +## 서버 지원 Your server should determine whether an update is required based on the [Update Request](#update-requests) your client issues. @@ -75,7 +67,7 @@ If no update is required your server must respond with a status code of [204 No Content](http://tools.ietf.org/html/rfc2616#section-10.2.5). Squirrel will check for an update again at the interval you specify. -## Update JSON Format +## JSON 포맷 업데이트 When an update is available, Squirrel expects the following schema in response to the update request provided: diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md index a66a4635bdbd..defa29fda959 100644 --- a/docs/api/content-tracing-ko.md +++ b/docs/api/content-tracing-ko.md @@ -20,7 +20,7 @@ tracing.startRecording('*', tracing.DEFAULT_OPTIONS, function() { * `callback` Function -카테고리 그룹 set을 가져옵니다. 카테고리 그룹은 도달 대상이 되는 코드 경로를 변경할 수 있습니다. +카테고리 그룹 세트를 가져옵니다. 카테고리 그룹은 도달 대상이 되는 코드 경로를 변경할 수 있습니다. Get a set of category groups. The category groups can change as new code paths are reached. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md index 11d62dd27194..a4e1d46ed2ef 100644 --- a/docs/api/remote-ko.md +++ b/docs/api/remote-ko.md @@ -21,7 +21,7 @@ win.loadUrl('https://github.com'); Note: for the reverse (access renderer process from main process), you can use [webContents.executeJavascript](https://github.com/atom/electron/blob/master/docs/api/browser-window-ko.md#browserwindowwebcontents). -## Remote objects +## Remote 객체 Each object (including functions) returned by the `remote` module represents an object in the main process (we call it a remote object or remote function). From 0b7a1a1eef075628a1d4c1d1c654e51ed9c2166d Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 17 Jul 2015 13:28:13 +0900 Subject: [PATCH 09/16] Fix typos, Improve grammer --- docs/README-ko.md | 4 ---- docs/api/auto-updater-ko.md | 2 +- docs/api/global-shortcut-ko.md | 5 +++-- docs/api/protocol-ko.md | 20 ++++++++++++++------ docs/tutorial/quick-start-ko.md | 4 ++-- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/README-ko.md b/docs/README-ko.md index 135d6b5c657f..b48c6a42c516 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -66,7 +66,3 @@ * [빌드 설명서 (Windows)](development/build-instructions-windows-ko.md) * [빌드 설명서 (Linux)](development/build-instructions-linux-ko.md) * [디버거에서 디버그 심볼 서버 설정](development/setting-up-symbol-server-ko.md) - -이 참조문서는 [@preco21](https://github.com/preco21)에 의해 번역되었습니다. -문서내에서 오타나 잘못된 번역을 발견하면 `plusb21@gmail.com` 이메일로 알려주시면 감사하겠습니다. -문서는 항시 최신버전을 유지할 수 없으므로 원본을 같이 참고하는 것을 권장합니다. diff --git a/docs/api/auto-updater-ko.md b/docs/api/auto-updater-ko.md index 9466bd190957..ca23a4ad114b 100644 --- a/docs/api/auto-updater-ko.md +++ b/docs/api/auto-updater-ko.md @@ -77,7 +77,7 @@ to the update request provided: "url": "http://mycompany.com/myapp/releases/myrelease", "name": "My Release Name", "notes": "Theses are some release notes innit", - "pub_date": "2013-09-18T12:29:53+01:00", + "pub_date": "2013-09-18T12:29:53+01:00" } ``` diff --git a/docs/api/global-shortcut-ko.md b/docs/api/global-shortcut-ko.md index 6ad3fb5109fc..25c1d320870e 100644 --- a/docs/api/global-shortcut-ko.md +++ b/docs/api/global-shortcut-ko.md @@ -1,8 +1,9 @@ # global-shortcut -`global-shortcut` 모듈은 사용자가 다양한 단축키 작업을 정의 할 수 있도록 운영체제의 전역 키보드 단축키를 설정 등록/해제 하는 방법을 제공합니다. +`global-shortcut` 모듈은 운영체제의 전역 키보드 단축키를 설정 등록/해제 하는 방법을 제공합니다. +이 모듈을 사용하여 사용자가 다양한 단축키 작업을 할 수 있도록 단축키를 정의 할 수 있습니다. 참고로 설정된 단축키는 어플리케이션이 백그라운드로 작동(창이 포커스 되지 않음) 할 때도 여전히 계속 작동합니다. -이 모듈은 `app` 모듈의 `ready` 이밴트 이전에 사용할 수 없습니다. +이 모듈은 `app` 모듈의 `ready` 이벤트 이전에 사용할 수 없습니다. ```javascript var app = require('app'); diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md index ef1e15ebf03d..3c0152fd2484 100644 --- a/docs/api/protocol-ko.md +++ b/docs/api/protocol-ko.md @@ -32,6 +32,9 @@ app.on('ready', function() { `handler` 함수에선 요청에 대한 해당 프로토콜의 작업 결과를 응답(반환) 해야 합니다. +기본적으로 스킴은 `http:`와 비슷합니다. `file:`과 같이 "표준 URI 구문"을 다르게 해석되게 하려면 +`protocol.registerStandardSchemes` 메서드를 이용해서 사용자 정의 스킴을 표준 스킴으로 만들 수 있습니다. + ## protocol.unregisterProtocol(scheme, callback) * `scheme` String @@ -43,7 +46,10 @@ app.on('ready', function() { * `value` Array -지정한 `value` 배열을 사용하여 미리 지정된 스킴으로 등록합니다. +지정한 `value` 배열을 사용하여 미리 지정된 표준 스킴으로 등록합니다. + +표준 스킴은 RFC 3986 [표준 URI 구문](https://tools.ietf.org/html/rfc3986#section-3)에 해당합니다. +이 표준은 `file:`과 `filesystem:`을 포함합니다. ## protocol.isHandledProtocol(scheme, callback) @@ -78,8 +84,8 @@ app.on('ready', function() { ## Class: protocol.RequestStringJob(options) * `options` Object - * `mimeType` String - `text/plain`이 기본 - * `charset` String - `UTF-8`이 기본 + * `mimeType` String - 기본값: `text/plain` + * `charset` String - 기본값: `UTF-8` * `data` String 문자열을 반환하는 request 작업을 생성합니다. @@ -87,8 +93,8 @@ app.on('ready', function() { ## Class: protocol.RequestBufferJob(options) * `options` Object - * `mimeType` String - Default is `application/octet-stream` - * `encoding` String - Default is `UTF-8` + * `mimeType` String - 기본값: `application/octet-stream` + * `encoding` String - 기본값: `UTF-8` * `data` Buffer 버퍼를 반환하는 request 작업을 생성합니다. @@ -96,8 +102,10 @@ app.on('ready', function() { ## Class: protocol.RequestHttpJob(options) * `options` Object + * `session` [Session](browser-window.md#class-session) - 기본적으로 이 옵션은 어플리케이션의 기본 세션입니다. + `null`로 설정하면 요청을 위한 새로운 세션을 만듭니다. * `url` String - * `method` String - Default is `GET` + * `method` String - 기본값: `GET` * `referrer` String `url`의 요청 결과를 그대로 반환하는 request 작업을 생성합니다. diff --git a/docs/tutorial/quick-start-ko.md b/docs/tutorial/quick-start-ko.md index a49b7e017609..cba30e30dbf9 100644 --- a/docs/tutorial/quick-start-ko.md +++ b/docs/tutorial/quick-start-ko.md @@ -75,8 +75,8 @@ var mainWindow = null; // 모든 창이 닫히면 어플리케이션 종료. app.on('window-all-closed', function() { - // OSX의 대부분의 어플리케이션에선 유저가 Cmd + Q 커맨드로 확실하게 종료하기 전까지는 - // 어플리케이션이 메뉴바에 남아 계속 실행됩니다. + // OS X의 대부분의 어플리케이션은 유저가 Cmd + Q 커맨드로 확실하게 종료하기 전까지 + // 메뉴바에 남아 계속 실행됩니다. if (process.platform != 'darwin') { app.quit(); } From 63258f9f53efa3b9ff18e7df4c95572787c620e3 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 24 Jul 2015 02:39:55 +0900 Subject: [PATCH 10/16] Update as upstream, Fix typos --- docs/api/app-ko.md | 321 --------- docs/api/browser-window-ko.md | 1169 --------------------------------- docs/api/dialog-ko.md | 14 +- docs/api/tray-ko.md | 34 +- docs/api/web-view-tag-ko.md | 4 + 5 files changed, 46 insertions(+), 1496 deletions(-) delete mode 100644 docs/api/app-ko.md delete mode 100644 docs/api/browser-window-ko.md diff --git a/docs/api/app-ko.md b/docs/api/app-ko.md deleted file mode 100644 index 434d0620282a..000000000000 --- a/docs/api/app-ko.md +++ /dev/null @@ -1,321 +0,0 @@ -# app - -The `app` module is responsible for controlling the application's life time. - -The example of quitting the whole application when the last window is closed: - -```javascript -var app = require('app'); -app.on('window-all-closed', function() { - app.quit(); -}); -``` - -## Event: will-finish-launching - -Emitted when application has done basic startup. On Windows and Linux it is the -same with `ready` event, on OS X this event represents the -`applicationWillFinishLaunching` message of `NSApplication`, usually you would -setup listeners to `open-file` and `open-url` events here, and start the crash -reporter and auto updater. - -Under most cases you should just do everything in `ready` event. - -## Event: ready - -Emitted when Electron has done everything initialization. - -## Event: window-all-closed - -Emitted when all windows have been closed. - -This event is only emitted when the application is not going to quit. If a -user pressed `Cmd + Q`, or the developer called `app.quit()`, Electron would -first try to close all windows and then emit the `will-quit` event, and in -this case the `window-all-closed` would not be emitted. - -## Event: before-quit - -* `event` Event - -Emitted before the application starts closing its windows. -Calling `event.preventDefault()` will prevent the default behaviour, which is -terminating the application. - -## Event: will-quit - -* `event` Event - -Emitted when all windows have been closed and the application will quit. -Calling `event.preventDefault()` will prevent the default behaviour, which is -terminating the application. - -See description of `window-all-closed` for the differences between `will-quit` -and it. - -## Event: quit - -Emitted when application is quitting. - -## Event: open-file - -* `event` Event -* `path` String - -Emitted when user wants to open a file with the application, it usually happens -when the application is already opened and then OS wants to reuse the -application to open file. But it is also emitted when a file is dropped onto the -dock and the application is not yet running. Make sure to listen to open-file -very early in your application startup to handle this case (even before the -`ready` event is emitted). - -You should call `event.preventDefault()` if you want to handle this event. - -## Event: open-url - -* `event` Event -* `url` String - -Emitted when user wants to open a URL with the application, this URL scheme -must be registered to be opened by your application. - -You should call `event.preventDefault()` if you want to handle this event. - -## Event: activate-with-no-open-windows - -Emitted when the application is activated while there is no opened windows. It -usually happens when user has closed all of application's windows and then -click on the application's dock icon. - -## Event: browser-window-blur - -* `event` Event -* `window` BrowserWindow - -Emitted when a [browserWindow](browser-window-ko.md) gets blurred. - -## Event: browser-window-focus - -* `event` Event -* `window` BrowserWindow - -Emitted when a [browserWindow](browser-window-ko.md) gets focused. - -### Event: 'select-certificate' - -Emitted when client certificate is requested. - -* `event` Event -* `webContents` [WebContents](browser-window-ko.md#class-webcontents) -* `url` String -* `certificateList` [Objects] - * `data` PEM encoded data - * `issuerName` Issuer's Common Name -* `callback` Function - -``` -app.on('select-certificate', function(event, host, url, list, callback) { - event.preventDefault(); - callback(list[0]); -}) -``` - -`url` corresponds to the navigation entry requesting the client certificate, -`callback` needs to be called with an entry filtered from the list. -`event.preventDefault()` prevents from using the first certificate from -the store. - -### Event: 'gpu-process-crashed' - -Emitted when the gpu process is crashed. - -## app.quit() - -Try to close all windows. The `before-quit` event will first be emitted. If all -windows are successfully closed, the `will-quit` event will be emitted and by -default the application would be terminated. - -This method guarantees all `beforeunload` and `unload` handlers are correctly -executed. It is possible that a window cancels the quitting by returning -`false` in `beforeunload` handler. - -## app.getAppPath() - -Returns the current application directory. - -## app.getPath(name) - -* `name` String - -Retrieves a path to a special directory or file associated with `name`. On -failure an `Error` would throw. - -You can request following paths by the names: - -* `home`: User's home directory -* `appData`: Per-user application data directory, by default it is pointed to: - * `%APPDATA%` on Windows - * `$XDG_CONFIG_HOME` or `~/.config` on Linux - * `~/Library/Application Support` on OS X -* `userData`: The directory for storing your app's configuration files, by - default it is the `appData` directory appended with your app's name -* `cache`: Per-user application cache directory, by default it is pointed to: - * `%APPDATA%` on Window, which doesn't has a universal place for cache - * `$XDG_CACHE_HOME` or `~/.cache` on Linux - * `~/Library/Caches` on OS X -* `userCache`: The directory for placing your app's caches, by default it is the - `cache` directory appended with your app's name -* `temp`: Temporary directory -* `userDesktop`: The current user's Desktop directory -* `exe`: The current executable file -* `module`: The `libchromiumcontent` library - -## app.setPath(name, path) - -* `name` String -* `path` String - -Overrides the `path` to a special directory or file associated with `name`. if -the path specifies a directory that does not exist, the directory will be -created by this method. On failure an `Error` would throw. - -You can only override paths of `name`s defined in `app.getPath`. - -By default web pages' cookies and caches will be stored under `userData` -directory, if you want to change this location, you have to override the -`userData` path before the `ready` event of `app` module gets emitted. - -## app.getVersion() - -Returns the version of loaded application, if no version is found in -application's `package.json`, the version of current bundle or executable would -be returned. - -## app.getName() - -Returns current application's name, the name in `package.json` would be -used. - -Usually the `name` field of `package.json` is a short lowercased name, according -to the spec of npm modules. So usually you should also specify a `productName` -field, which is your application's full capitalized name, and it will be -preferred over `name` by Electron. - -## app.resolveProxy(url, callback) - -* `url` URL -* `callback` Function - -Resolves the proxy information for `url`, the `callback` would be called with -`callback(proxy)` when the request is done. - -## app.addRecentDocument(path) - -* `path` String - -Adds `path` to recent documents list. - -This list is managed by the system, on Windows you can visit the list from task -bar, and on Mac you can visit it from dock menu. - -## app.clearRecentDocuments() - -Clears the recent documents list. - -## app.setUserTasks(tasks) - -* `tasks` Array - Array of `Task` objects - -Adds `tasks` to the [Tasks][tasks] category of JumpList on Windows. - -The `tasks` is an array of `Task` objects in following format: - -* `Task` Object - * `program` String - Path of the program to execute, usually you should - specify `process.execPath` which opens current program - * `arguments` String - The arguments of command line when `program` is - executed - * `title` String - The string to be displayed in a JumpList - * `description` String - Description of this task - * `iconPath` String - The absolute path to an icon to be displayed in a - JumpList, it can be arbitrary resource file that contains an icon, usually - you can specify `process.execPath` to show the icon of the program - * `iconIndex` Integer - The icon index in the icon file. If an icon file - consists of two or more icons, set this value to identify the icon. If an - icon file consists of one icon, this value is 0 - -**Note:** This API is only available on Windows. - -## app.commandLine.appendSwitch(switch, [value]) - -Append a switch [with optional value] to Chromium's command line. - -**Note:** This will not affect `process.argv`, and is mainly used by developers -to control some low-level Chromium behaviors. - -## app.commandLine.appendArgument(value) - -Append an argument to Chromium's command line. The argument will quoted properly. - -**Note:** This will not affect `process.argv`. - -## app.dock.bounce([type]) - -* `type` String - Can be `critical` or `informational`, the default is - `informational` - -When `critical` is passed, the dock icon will bounce until either the -application becomes active or the request is canceled. - -When `informational` is passed, the dock icon will bounce for one second. The -request, though, remains active until either the application becomes active or -the request is canceled. - -An ID representing the request would be returned. - -**Note:** This API is only available on Mac. - -## app.dock.cancelBounce(id) - -* `id` Integer - -Cancel the bounce of `id`. - -**Note:** This API is only available on Mac. - -## app.dock.setBadge(text) - -* `text` String - -Sets the string to be displayed in the dock’s badging area. - -**Note:** This API is only available on Mac. - -## app.dock.getBadge() - -Returns the badge string of the dock. - -**Note:** This API is only available on Mac. - -## app.dock.hide() - -Hides the dock icon. - -**Note:** This API is only available on Mac. - -## app.dock.show() - -Shows the dock icon. - -**Note:** This API is only available on Mac. - -## app.dock.setMenu(menu) - -* `menu` Menu - -Sets the application [dock menu][dock-menu]. - -**Note:** This API is only available on Mac. - -[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 diff --git a/docs/api/browser-window-ko.md b/docs/api/browser-window-ko.md deleted file mode 100644 index 29a07661409d..000000000000 --- a/docs/api/browser-window-ko.md +++ /dev/null @@ -1,1169 +0,0 @@ -# browser-window - -The `BrowserWindow` class gives you ability to create a browser window, an -example is: - -```javascript -var BrowserWindow = require('browser-window'); - -var win = new BrowserWindow({ width: 800, height: 600, show: false }); -win.on('closed', function() { - win = null; -}); - -win.loadUrl('https://github.com'); -win.show(); -``` - -You can also create a window without chrome by using -[Frameless Window](frameless-window.md) API. - -## Class: BrowserWindow - -`BrowserWindow` is an -[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). - -### new BrowserWindow(options) - -* `options` Object - * `x` Integer - Window's left offset to screen - * `y` Integer - Window's top offset to screen - * `width` Integer - Window's width - * `height` Integer - Window's height - * `use-content-size` Boolean - The `width` and `height` would be used as web - page's size, which means the actual window's size will include window - frame's size and be slightly larger. - * `center` Boolean - Show window in the center of the screen - * `min-width` Integer - Minimum width - * `min-height` Integer - Minimum height - * `max-width` Integer - Maximum width - * `max-height` Integer - Maximum height - * `resizable` Boolean - Whether window is resizable - * `always-on-top` Boolean - Whether the window should always stay on top of - other windows - * `fullscreen` Boolean - Whether the window should show in fullscreen, when - set to `false` the fullscreen button would also be hidden on OS X - * `skip-taskbar` Boolean - Do not show window in taskbar - * `zoom-factor` Number - The default zoom factor of the page, zoom factor is - zoom percent / 100, so `3.0` represents `300%` - * `kiosk` Boolean - The kiosk mode - * `title` String - Default window title - * `icon` [NativeImage](native-image.md) - The window icon, when omitted on - Windows the executable's icon would be used as window icon - * `show` Boolean - Whether window should be shown when created - * `frame` Boolean - Specify `false` to create a - [Frameless Window](frameless-window.md) - * `node-integration` Boolean - Whether node integration is enabled, default - is `true` - * `accept-first-mouse` Boolean - Whether the web view accepts a single - mouse-down event that simultaneously activates the window - * `disable-auto-hide-cursor` Boolean - Do not hide cursor when typing - * `auto-hide-menu-bar` Boolean - Auto hide the menu bar unless the `Alt` - key is pressed. - * `enable-larger-than-screen` Boolean - Enable the window to be resized larger - than screen. - * `dark-theme` Boolean - Forces using dark theme for the window, only works on - some GTK+3 desktop environments - * `preload` String - Specifies a script that will be loaded before other - scripts run in the window. This script will always have access to node APIs - no matter whether node integration is turned on for the window, and the path - of `preload` script has to be absolute path. - * `transparent` Boolean - Makes the window [transparent](frameless-window.md) - * `type` String - Specifies the type of the window, possible types are - `desktop`, `dock`, `toolbar`, `splash`, `notification`. This only works on - Linux. - * `standard-window` Boolean - Uses the OS X's standard window instead of the - textured window. Defaults to `true`. - * `web-preferences` Object - Settings of web page's features - * `javascript` Boolean - * `web-security` Boolean - * `images` Boolean - * `java` Boolean - * `text-areas-are-resizable` Boolean - * `webgl` Boolean - * `webaudio` Boolean - * `plugins` Boolean - Whether plugins should be enabled, currently only - `NPAPI` plugins are supported. - * `extra-plugin-dirs` Array - Array of paths that would be searched for - plugins. Note that if you want to add a directory under your app, you - should use `__dirname` or `process.resourcesPath` to join the paths to - make them absolute, using relative paths would make Electron search - under current working directory. - * `experimental-features` Boolean - * `experimental-canvas-features` Boolean - * `subpixel-font-scaling` Boolean - * `overlay-scrollbars` Boolean - * `overlay-fullscreen-video` Boolean - * `shared-worker` Boolean - * `direct-write` Boolean - Whether the DirectWrite font rendering system on - Windows is enabled - * `page-visibility` Boolean - Page would be forced to be always in visible - or hidden state once set, instead of reflecting current window's - visibility. Users can set it to `true` to prevent throttling of DOM - timers. - -Creates a new `BrowserWindow` with native properties set by the `options`. -Usually you only need to set the `width` and `height`, other properties will -have decent default values. - -### Event: 'page-title-updated' - -* `event` Event - -Emitted when the document changed its title, calling `event.preventDefault()` -would prevent the native window's title to change. - -### Event: 'close' - -* `event` Event - -Emitted when the window is going to be closed. It's emitted before the -`beforeunload` and `unload` event of DOM, calling `event.preventDefault()` -would cancel the close. - -Usually you would want to use the `beforeunload` handler to decide whether the -window should be closed, which will also be called when the window is -reloaded. In Electron, returning an empty string or `false` would cancel the -close. An example is: - -```javascript -window.onbeforeunload = function(e) { - console.log('I do not want to be closed'); - - // Unlike usual browsers, in which a string should be returned and the user is - // prompted to confirm the page unload, Electron gives developers more options. - // Returning empty string or false would prevent the unloading now. - // You can also use the dialog API to let the user confirm closing the application. - return false; -}; -``` - -### Event: 'closed' - -Emitted when the window is closed. After you have received this event you should -remove the reference to the window and avoid using it anymore. - -### Event: 'unresponsive' - -Emitted when the web page becomes unresponsive. - -### Event: 'responsive' - -Emitted when the unresponsive web page becomes responsive again. - -### Event: 'blur' - -Emitted when window loses focus. - -### Event: 'focus' - -Emitted when window gains focus. - -### Event: 'maximize' - -Emitted when window is maximized. - -### Event: 'unmaximize' - -Emitted when window exits from maximized state. - -### Event: 'minimize' - -Emitted when window is minimized. - -### Event: 'restore' - -Emitted when window is restored from minimized state. - -### Event: 'resize' - -Emitted when window is getting resized. - -### Event: 'move' - -Emitted when the window is getting moved to a new position. - -__Note__: On OS X this event is just an alias of `moved`. - -### Event: 'moved' - -Emitted once when the window is moved to a new position. - -__Note__: This event is available only on OS X. - -### Event: 'enter-full-screen' - -Emitted when window enters full screen state. - -### Event: 'leave-full-screen' - -Emitted when window leaves full screen state. - -### Event: 'enter-html-full-screen' - -Emitted when window enters full screen state triggered by html api. - -### Event: 'leave-html-full-screen' - -Emitted when window leaves full screen state triggered by html api. - -### Event: 'devtools-opened' - -Emitted when devtools is opened. - -### Event: 'devtools-closed' - -Emitted when devtools is closed. - -### Event: 'devtools-focused' - -Emitted when devtools is focused / opened. - -### Event: 'app-command': - -Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx) is invoked. These are typically related to keyboard media keys or browser commands, as well as the "Back" button built into some mice on Windows. - -```js -someWindow.on('app-command', function(e, cmd) { - // Navigate the window back when the user hits their mouse back button - if (cmd === 'browser-backward' && someWindow.webContents.canGoBack()) { - someWindow.webContents.goBack(); - } -}); -``` - -__Note__: This event is only fired on Windows. - -### Class Method: BrowserWindow.getAllWindows() - -Returns an array of all opened browser windows. - -### Class Method: BrowserWindow.getFocusedWindow() - -Returns the window that is focused in this application. - -### Class Method: BrowserWindow.fromWebContents(webContents) - -* `webContents` WebContents - -Find a window according to the `webContents` it owns - -### Class Method: BrowserWindow.fromId(id) - -* `id` Integer - -Find a window according to its ID. - -### Class Method: BrowserWindow.addDevToolsExtension(path) - -* `path` String - -Adds devtools extension located at `path`, and returns extension's name. - -The extension will be remembered so you only need to call this API once, this -API is not for programming use. - -### Class Method: BrowserWindow.removeDevToolsExtension(name) - -* `name` String - -Remove the devtools extension whose name is `name`. - -### BrowserWindow.webContents - -The `WebContents` object this window owns, all web page related events and -operations would be done via it. - -**Note:** Users should never store this object because it may become `null` -when the renderer process (web page) has crashed. - -### BrowserWindow.devToolsWebContents - -Get the `WebContents` of devtools of this window. - -**Note:** Users should never store this object because it may become `null` -when the devtools has been closed. - -### BrowserWindow.id - -Get the unique ID of this window. - -### BrowserWindow.destroy() - -Force closing the window, the `unload` and `beforeunload` event won't be emitted -for the web page, and `close` event would also not be emitted -for this window, but it would guarantee the `closed` event to be emitted. - -You should only use this method when the renderer process (web page) has crashed. - -### BrowserWindow.close() - -Try to close the window, this has the same effect with user manually clicking -the close button of the window. The web page may cancel the close though, see -the [close event](#event-close). - -### BrowserWindow.focus() - -Focus on the window. - -### BrowserWindow.isFocused() - -Returns whether the window is focused. - -### BrowserWindow.show() - -Shows and gives focus to the window. - -### BrowserWindow.showInactive() - -Shows the window but doesn't focus on it. - -### BrowserWindow.hide() - -Hides the window. - -### BrowserWindow.isVisible() - -Returns whether the window is visible to the user. - -### BrowserWindow.maximize() - -Maximizes the window. - -### BrowserWindow.unmaximize() - -Unmaximizes the window. - -### BrowserWindow.isMaximized() - -Returns whether the window is maximized. - -### BrowserWindow.minimize() - -Minimizes the window. On some platforms the minimized window will be shown in -the Dock. - -### BrowserWindow.restore() - -Restores the window from minimized state to its previous state. - -### BrowserWindow.isMinimized() - -Returns whether the window is minimized. - -### BrowserWindow.setFullScreen(flag) - -* `flag` Boolean - -Sets whether the window should be in fullscreen mode. - -### BrowserWindow.isFullScreen() - -Returns whether the window is in fullscreen mode. - -### BrowserWindow.setBounds(options) - -* `options` Object - * `x` Integer - * `y` Integer - * `width` Integer - * `height` Integer - -Resizes and moves the window to `width`, `height`, `x`, `y`. - -### BrowserWindow.getBounds() - -Returns an object that contains window's width, height, x and y values. - -### BrowserWindow.setSize(width, height) - -* `width` Integer -* `height` Integer - -Resizes the window to `width` and `height`. - -### BrowserWindow.getSize() - -Returns an array that contains window's width and height. - -### BrowserWindow.setContentSize(width, height) - -* `width` Integer -* `height` Integer - -Resizes the window's client area (e.g. the web page) to `width` and `height`. - -### BrowserWindow.getContentSize() - -Returns an array that contains window's client area's width and height. - -### BrowserWindow.setMinimumSize(width, height) - -* `width` Integer -* `height` Integer - -Sets the minimum size of window to `width` and `height`. - -### BrowserWindow.getMinimumSize() - -Returns an array that contains window's minimum width and height. - -### BrowserWindow.setMaximumSize(width, height) - -* `width` Integer -* `height` Integer - -Sets the maximum size of window to `width` and `height`. - -### BrowserWindow.getMaximumSize() - -Returns an array that contains window's maximum width and height. - -### BrowserWindow.setResizable(resizable) - -* `resizable` Boolean - -Sets whether the window can be manually resized by user. - -### BrowserWindow.isResizable() - -Returns whether the window can be manually resized by user. - -### BrowserWindow.setAlwaysOnTop(flag) - -* `flag` Boolean - -Sets whether the window should show always on top of other windows. After -setting this, the window is still a normal window, not a toolbox window which -can not be focused on. - -### BrowserWindow.isAlwaysOnTop() - -Returns whether the window is always on top of other windows. - -### BrowserWindow.center() - -Moves window to the center of the screen. - -### BrowserWindow.setPosition(x, y) - -* `x` Integer -* `y` Integer - -Moves window to `x` and `y`. - -### BrowserWindow.getPosition() - -Returns an array that contains window's current position. - -### BrowserWindow.setTitle(title) - -* `title` String - -Changes the title of native window to `title`. - -### BrowserWindow.getTitle() - -Returns the title of the native window. - -**Note:** The title of web page can be different from the title of the native -window. - -### BrowserWindow.flashFrame(flag) - -* `flag` Boolean - -Starts or stops flashing the window to attract user's attention. - -### BrowserWindow.setSkipTaskbar(skip) - -* `skip` Boolean - -Makes the window not show in the taskbar. - -### BrowserWindow.setKiosk(flag) - -* `flag` Boolean - -Enters or leaves the kiosk mode. - -### BrowserWindow.isKiosk() - -Returns whether the window is in kiosk mode. - -### BrowserWindow.setRepresentedFilename(filename) - -* `filename` String - -Sets the pathname of the file the window represents, and the icon of the file -will show in window's title bar. - -__Note__: This API is only available on OS X. - -### BrowserWindow.getRepresentedFilename() - -Returns the pathname of the file the window represents. - -__Note__: This API is only available on OS X. - -### BrowserWindow.setDocumentEdited(edited) - -* `edited` Boolean - -Specifies whether the window’s document has been edited, and the icon in title -bar will become grey when set to `true`. - -__Note__: This API is only available on OS X. - -### BrowserWindow.IsDocumentEdited() - -Whether the window's document has been edited. - -__Note__: This API is only available on OS X. - -### BrowserWindow.openDevTools([options]) - -* `options` Object - * `detach` Boolean - opens devtools in a new window - -Opens the developer tools. - -### BrowserWindow.closeDevTools() - -Closes the developer tools. - -### BrowserWindow.isDevToolsOpened() - -Returns whether the developer tools are opened. - -### BrowserWindow.toggleDevTools() - -Toggle the developer tools. - -### BrowserWindow.inspectElement(x, y) - -* `x` Integer -* `y` Integer - -Starts inspecting element at position (`x`, `y`). - -### BrowserWindow.inspectServiceWorker() - -Opens the developer tools for the service worker context present in the web contents. - -### BrowserWindow.focusOnWebView() - -### BrowserWindow.blurWebView() - -### BrowserWindow.capturePage([rect, ]callback) - -* `rect` Object - The area of page to be captured - * `x` Integer - * `y` Integer - * `width` Integer - * `height` Integer -* `callback` Function - -Captures the snapshot of page within `rect`, upon completion `callback` would be -called with `callback(image)`, the `image` is an instance of -[NativeImage](native-image.md) that stores data of the snapshot. Omitting the -`rect` would capture the whole visible page. - -**Note:** Be sure to read documents on remote buffer in -[remote](remote.md) if you are going to use this API in renderer -process. - -### BrowserWindow.print([options]) - -Same with `webContents.print([options])` - -### BrowserWindow.printToPDF(options, callback) - -Same with `webContents.printToPDF(options, callback)` - -### BrowserWindow.loadUrl(url, [options]) - -Same with `webContents.loadUrl(url, [options])`. - -### BrowserWindow.reload() - -Same with `webContents.reload`. - -### BrowserWindow.setMenu(menu) - -* `menu` Menu - -Sets the `menu` as the window's menu bar, setting it to `null` will remove the -menu bar. - -__Note:__ This API is not available on OS X. - -### BrowserWindow.setProgressBar(progress) - -* `progress` Double - -Sets progress value in progress bar. Valid range is [0, 1.0]. - -Remove progress bar when progress < 0; -Change to indeterminate mode when progress > 1. - -On Linux platform, only supports Unity desktop environment, you need to specify -the `*.desktop` file name to `desktopName` field in `package.json`. By default, -it will assume `app.getName().desktop`. - -### BrowserWindow.setOverlayIcon(overlay, description) - -* `overlay` [NativeImage](native-image.md) - the icon to display on the bottom -right corner of the taskbar icon. If this parameter is `null`, the overlay is -cleared -* `description` String - a description that will be provided to Accessibility -screen readers - -Sets a 16px overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user. - -__Note:__ This API is only available on Windows (Windows 7 and above) - -### BrowserWindow.showDefinitionForSelection() - -Shows pop-up dictionary that searches the selected word on the page. - -__Note__: This API is only available on OS X. - -### BrowserWindow.setAutoHideMenuBar(hide) - -* `hide` Boolean - -Sets whether the window menu bar should hide itself automatically. Once set the -menu bar will only show when users press the single `Alt` key. - -If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't -hide it immediately. - -### BrowserWindow.isMenuBarAutoHide() - -Returns whether menu bar automatically hides itself. - -### BrowserWindow.setMenuBarVisibility(visible) - -* `visible` Boolean - -Sets whether the menu bar should be visible. If the menu bar is auto-hide, users -can still bring up the menu bar by pressing the single `Alt` key. - -### BrowserWindow.isMenuBarVisible() - -Returns whether the menu bar is visible. - -### BrowserWindow.setVisibleOnAllWorkspaces(visible) - -* `visible` Boolean - -Sets whether the window should be visible on all workspaces. - -**Note:** This API does nothing on Windows. - -### BrowserWindow.isVisibleOnAllWorkspaces() - -Returns whether the window is visible on all workspaces. - -**Note:** This API always returns false on Windows. - -## Class: WebContents - -A `WebContents` is responsible for rendering and controlling a web page. - -`WebContents` is an -[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter). - -### Event: 'did-finish-load' - -Emitted when the navigation is done, i.e. the spinner of the tab will stop -spinning, and the `onload` event was dispatched. - -### Event: 'did-fail-load' - -* `event` Event -* `errorCode` Integer -* `errorDescription` String - -This event is like `did-finish-load`, but emitted when the load failed or was -cancelled, e.g. `window.stop()` is invoked. - -### Event: 'did-frame-finish-load' - -* `event` Event -* `isMainFrame` Boolean - -Emitted when a frame has done navigation. - -### Event: 'did-start-loading' - -Corresponds to the points in time when the spinner of the tab starts spinning. - -### Event: 'did-stop-loading' - -Corresponds to the points in time when the spinner of the tab stops spinning. - -### Event: 'did-get-response-details' - -* `event` Event -* `status` Boolean -* `newUrl` String -* `originalUrl` String -* `httpResponseCode` Integer -* `requestMethod` String -* `referrer` String -* `headers` Object - -Emitted when details regarding a requested resource is available. -`status` indicates the socket connection to download the resource. - -### Event: 'did-get-redirect-request' - -* `event` Event -* `oldUrl` String -* `newUrl` String -* `isMainFrame` Boolean - -Emitted when a redirect was received while requesting a resource. - -### Event: 'dom-ready' - -* `event` Event - -Emitted when document in the given frame is loaded. - -### Event: 'page-favicon-updated' - -* `event` Event -* `favicons` Array - Array of Urls - -Emitted when page receives favicon urls. - -### Event: 'new-window' - -* `event` Event -* `url` String -* `frameName` String -* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`, - `new-window` and `other` - -Emitted when the page requested to open a new window for `url`. It could be -requested by `window.open` or an external link like ``. - -By default a new `BrowserWindow` will be created for the `url`. - -Calling `event.preventDefault()` can prevent creating new windows. - -### Event: 'will-navigate' - -* `event` Event -* `url` String - -Emitted when user or the page wants to start an navigation, it can happen when -`window.location` object is changed or user clicks a link in the page. - -This event will not emit when the navigation is started programmatically with APIs -like `WebContents.loadUrl` and `WebContents.back`. - -Calling `event.preventDefault()` can prevent the navigation. - -### Event: 'crashed' - -Emitted when the renderer process is crashed. - -### Event: 'plugin-crashed' - -* `event` Event -* `name` String -* `version` String - -Emitted when a plugin process is crashed. - -### Event: 'destroyed' - -Emitted when the WebContents is destroyed. - -### WebContents.session - -Returns the `Session` object used by this WebContents. - -### WebContents.loadUrl(url, [options]) - -* `url` URL -* `options` URL - * `httpReferrer` String - A HTTP Referer url - * `userAgent` String - A user agent originating the request - -Loads the `url` in the window, the `url` must contains the protocol prefix, -e.g. the `http://` or `file://`. - -### WebContents.getUrl() - -Returns URL of current web page. - -### WebContents.getTitle() - -Returns the title of web page. - -### WebContents.isLoading() - -Returns whether web page is still loading resources. - -### WebContents.isWaitingForResponse() - -Returns whether web page is waiting for a first-response for the main resource -of the page. - -### WebContents.stop() - -Stops any pending navigation. - -### WebContents.reload() - -Reloads current page. - -### WebContents.reloadIgnoringCache() - -Reloads current page and ignores cache. - -### WebContents.canGoBack() - -Returns whether the web page can go back. - -### WebContents.canGoForward() - -Returns whether the web page can go forward. - -### WebContents.canGoToOffset(offset) - -* `offset` Integer - -Returns whether the web page can go to `offset`. - -### WebContents.clearHistory() - -Clears the navigation history. - -### WebContents.goBack() - -Makes the web page go back. - -### WebContents.goForward() - -Makes the web page go forward. - -### WebContents.goToIndex(index) - -* `index` Integer - -Navigates to the specified absolute index. - -### WebContents.goToOffset(offset) - -* `offset` Integer - -Navigates to the specified offset from the "current entry". - -### WebContents.isCrashed() - -Whether the renderer process has crashed. - -### WebContents.setUserAgent(userAgent) - -* `userAgent` String - -Overrides the user agent for this page. - -### WebContents.insertCSS(css) - -* `css` String - -Injects CSS into this page. - -### WebContents.executeJavaScript(code) - -* `code` String - -Evaluates `code` in page. - -### WebContents.setAudioMuted(muted) - -+ `muted` Boolean - -Set the page muted. - -### WebContents.isAudioMuted() - -Returns whether this page has been muted. - -### WebContents.undo() - -Executes editing command `undo` in page. - -### WebContents.redo() - -Executes editing command `redo` in page. - -### WebContents.cut() - -Executes editing command `cut` in page. - -### WebContents.copy() - -Executes editing command `copy` in page. - -### WebContents.paste() - -Executes editing command `paste` in page. - -### WebContents.pasteAndMatchStyle() - -Executes editing command `pasteAndMatchStyle` in page. - -### WebContents.delete() - -Executes editing command `delete` in page. - -### WebContents.selectAll() - -Executes editing command `selectAll` in page. - -### WebContents.unselect() - -Executes editing command `unselect` in page. - -### WebContents.replace(text) - -* `text` String - -Executes editing command `replace` in page. - -### WebContents.replaceMisspelling(text) - -* `text` String - -Executes editing command `replaceMisspelling` in page. - -### WebContents.hasServiceWorker(callback) - -* `callback` Function - -Checks if any serviceworker is registered and returns boolean as -response to `callback`. - -### WebContents.unregisterServiceWorker(callback) - -* `callback` Function - -Unregisters any serviceworker if present and returns boolean as -response to `callback` when the JS promise is fullfilled or false -when the JS promise is rejected. - -### WebContents.print([options]) - -* `options` Object - * `silent` Boolean - Don't ask user for print settings, defaults to `false` - * `printBackground` Boolean - Also prints the background color and image of - the web page, defaults to `false`. - -Prints window's web page. When `silent` is set to `false`, Electron will pick -up system's default printer and default settings for printing. - -Calling `window.print()` in web page is equivalent to call -`WebContents.print({silent: false, printBackground: false})`. - -**Note:** On Windows, the print API relies on `pdf.dll`. If your application -doesn't need print feature, you can safely remove `pdf.dll` in saving binary -size. - -### WebContents.printToPDF(options, callback) - -* `options` Object - * `marginsType` Integer - Specify the type of margins to use - * 0 - default - * 1 - none - * 2 - minimum - * `printBackground` Boolean - Whether to print CSS backgrounds. - * `printSelectionOnly` Boolean - Whether to print selection only. - * `landscape` Boolean - `true` for landscape, `false` for portrait. - -* `callback` Function - `function(error, data) {}` - * `error` Error - * `data` Buffer - PDF file content - -Prints windows' web page as PDF with Chromium's preview printing custom -settings. - -By default, an empty `options` will be regarded as -`{marginsType:0, printBackgrounds:false, printSelectionOnly:false, - landscape:false}`. - -```javascript -var BrowserWindow = require('browser-window'); -var fs = require('fs'); - -var win = new BrowserWindow({width: 800, height: 600}); -win.loadUrl("http://github.com"); - -win.webContents.on("did-finish-load", function() { - // Use default printing options - win.webContents.printToPDF({}, function(error, data) { - if (error) throw error; - fs.writeFile(dist, data, function(error) { - if (err) - alert('write pdf file error', error); - }) - }) -}); -``` - -### WebContents.send(channel[, args...]) - -* `channel` String - -Send `args..` to the web page via `channel` in asynchronous message, the web -page can handle it by listening to the `channel` event of `ipc` module. - -An example of sending messages from the main process to the renderer process: - -```javascript -// On the main process. -var window = null; -app.on('ready', function() { - window = new BrowserWindow({width: 800, height: 600}); - window.loadUrl('file://' + __dirname + '/index.html'); - window.webContents.on('did-finish-load', function() { - window.webContents.send('ping', 'whoooooooh!'); - }); -}); -``` - -```html -// index.html - - - - - -``` - -**Note:** - -1. The IPC message handler in web pages do not have a `event` parameter, which - is different from the handlers on the main process. -2. There is no way to send synchronous messages from the main process to a - renderer process, because it would be very easy to cause dead locks. - -## Class: Session - -### Session.cookies - -The `cookies` gives you ability to query and modify cookies, an example is: - -```javascript -var BrowserWindow = require('browser-window'); - -var win = new BrowserWindow({ width: 800, height: 600 }); - -win.loadUrl('https://github.com'); - -win.webContents.on('did-finish-load', function() { - // Query all cookies. - win.webContents.session.cookies.get({}, function(error, cookies) { - if (error) throw error; - console.log(cookies); - }); - - // Query all cookies that are associated with a specific url. - win.webContents.session.cookies.get({ url : "http://www.github.com" }, - function(error, cookies) { - if (error) throw error; - console.log(cookies); - }); - - // Set a cookie with the given cookie data; - // may overwrite equivalent cookies if they exist. - win.webContents.session.cookies.set( - { url : "http://www.github.com", name : "dummy_name", value : "dummy"}, - function(error, cookies) { - if (error) throw error; - console.log(cookies); - }); -}); -``` - -### Session.cookies.get(details, callback) - -* `details` Object - * `url` String - Retrieves cookies which are associated with `url`. - Empty imples retrieving cookies of all urls. - * `name` String - Filters cookies by name - * `domain` String - Retrieves cookies whose domains match or are subdomains of `domains` - * `path` String - Retrieves cookies whose path matches `path` - * `secure` Boolean - Filters cookies by their Secure property - * `session` Boolean - Filters out session or persistent cookies. -* `callback` Function - function(error, cookies) - * `error` Error - * `cookies` Array - array of `cookie` objects. - * `cookie` - Object - * `name` String - The name of the cookie - * `value` String - The value of the cookie - * `domain` String - The domain of the cookie - * `host_only` String - Whether the cookie is a host-only cookie - * `path` String - The path of the cookie - * `secure` Boolean - Whether the cookie is marked as Secure (typically HTTPS) - * `http_only` Boolean - Whether the cookie is marked as HttpOnly - * `session` Boolean - Whether the cookie is a session cookie or a persistent - cookie with an expiration date. - * `expirationDate` Double - (Option) The expiration date of the cookie as - the number of seconds since the UNIX epoch. Not provided for session cookies. - - -### Session.cookies.set(details, callback) - -* `details` Object - * `url` String - Retrieves cookies which are associated with `url` - * `name` String - The name of the cookie. Empty by default if omitted. - * `value` String - The value of the cookie. Empty by default if omitted. - * `domain` String - The domain of the cookie. Empty by default if omitted. - * `path` String - The path of the cookie. Empty by default if omitted. - * `secure` Boolean - Whether the cookie should be marked as Secure. Defaults to false. - * `session` Boolean - Whether the cookie should be marked as HttpOnly. Defaults to false. - * `expirationDate` Double - The expiration date of the cookie as the number of - seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. - -* `callback` Function - function(error) - * `error` Error - -### Session.cookies.remove(details, callback) - -* `details` Object - * `url` String - The URL associated with the cookie - * `name` String - The name of cookie to remove -* `callback` Function - function(error) - * `error` Error - -### Session.clearCache(callback) - -* `callback` Function - Called when operation is done - -Clears the session's HTTP cache. - -### Session.clearStorageData([options, ]callback) - -* `options` Object - * `origin` String - Should follow `window.location.origin`'s representation - `scheme://host:port` - * `storages` Array - The types of storages to clear, can contain: - `appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`, - `shadercache`, `websql`, `serviceworkers` - * `quotas` Array - The types of quotas to clear, can contain: - `temporary`, `persistent`, `syncable` -* `callback` Function - Called when operation is done - -Clears the data of web storages. diff --git a/docs/api/dialog-ko.md b/docs/api/dialog-ko.md index a16daebb6f3a..11b06f99ae9c 100644 --- a/docs/api/dialog-ko.md +++ b/docs/api/dialog-ko.md @@ -66,23 +66,27 @@ Windows와 Linux에선 파일 선택 모드, 디렉터리 선택 모드를 동 * `browserWindow` BrowserWindow * `options` Object - ** `type` String - `"none"`, `"info"`, `"error"`, `"question"`, `"warning"` 중 하나를 사용할 수 있습니다. + * `type` String - `"none"`, `"info"`, `"error"`, `"question"`, `"warning"` 중 하나를 사용할 수 있습니다. + Windows에선 따로 `icon`을 설정하지 않은 이상 "question"과 "info"는 같은 아이콘으로 표시됩니다. * `buttons` Array - 버튼들의 라벨을 포함한 배열입니다. - * `title` String - 메시지 상자의 제목입니다. 몇몇 플랫폼에선 보이지 않을 수 있습니다. - * `message` String - 메시지 상자의 본문 내용입니다. + * `title` String - 대화 상자의 제목입니다. 몇몇 플랫폼에선 보이지 않을 수 있습니다. + * `message` String - 대화 상자의 본문 내용입니다. * `detail` String - 메시지의 추가 정보입니다. * `icon` [NativeImage](native-image-ko.md) * `cancelId` Integer - 유저가 대화 상자의 버튼을 클릭하지 않고 대화 상자를 취소했을 때 반환되는 버튼의 index입니다. 기본적으로 버튼 리스트가 "cancel" 또는 "no" 라벨을 가지고 있을 때 해당 버튼의 index를 반환합니다. 따로 두 라벨이 지정되지 않은 경우 0을 반환합니다. OS X와 Windows에선 `cancelId` 지정 여부에 상관없이 "Cancel" 버튼이 언제나 `cancelId`로 지정됩니다. + * `noLink` Boolean - Windows Electron은 "Cancel"이나 "Yes"와 같은 흔히 사용되는 버튼을 찾으려고 시도하고 + 대화 상자 내에서 해당 버튼을 커맨드 링크처럼 만듭니다. 이 기능으로 앱을 좀 더 Modern Windows 앱처럼 만들 수 있습니다. + 이 기능을 원하지 않으면 `noLink`를 true로 지정하면 됩니다. * `callback` Function -메시지 상자를 표시합니다. `browserWindow`를 지정하면 메시지 상자가 완전히 닫힐 때까지는 창을 사용할 수 없습니다. +대화 상자를 표시합니다. `browserWindow`를 지정하면 대화 상자가 완전히 닫힐 때까지는 창을 사용할 수 없습니다. 완료시 유저가 선택한 버튼의 index를 반환합니다. 역주: 부정을 표현하는 "아니오", "취소"와 같은 한글 단어는 지원되지 않습니다. 만약 OS X 또는 Windows에서 "확인", "취소"와 같은 순서로 버튼을 지정하게 될 때 Alt + f4로 해당 대화 상자를 끄게 되면 "확인"을 누른걸로 판단되어 버립니다. -이를 해결하려면 "Cancel"을 대신 사용하거나 BrowserWindow API를 사용하여 메시지 상자를 직접 구현해야합니다. +이를 해결하려면 "Cancel"을 대신 사용하거나 BrowserWindow API를 사용하여 대화 상자를 직접 구현해야합니다. `callback`이 전달되면 메소드가 비동기로 작동되며 결과는 `callback(response)`을 통해 전달됩니다. diff --git a/docs/api/tray-ko.md b/docs/api/tray-ko.md index 145302b65f65..3d7120e69b98 100644 --- a/docs/api/tray-ko.md +++ b/docs/api/tray-ko.md @@ -24,8 +24,8 @@ app.on('ready', function(){ __플랫폼별 한계:__ -* OS X에서는 트레이 아이콘이 컨텍스트 메뉴를 가지고 있을 경우 `clicked` 이벤트는 무시됩니다. * Linux에서는 앱 알림 표시기(app indicator)가 지원되면 해당 기능을 사용합니다. 만약 지원하지 않으면 `GtkStatusIcon`을 대신 사용합니다. +* Linux 배포판이 앱 알림 표시기만 지원하고 있다면 `libappindicator1`를 설치하여 트레이 아이콘이 작동하도록 만들 수 있습니다. * 앱 알림 표시기는 컨텍스트 메뉴를 가지고 있을 때만 보입니다. * Linux에서 앱 알림 표시기가 사용될 경우, `clicked` 이벤트는 무시됩니다. @@ -55,6 +55,20 @@ __플랫폼별 한계:__ __주의:__ `bounds`는 OS X와 Window 7 이후 버전에서만 작동합니다. +### Event: 'right-clicked' + +* `event` +* `bounds` Object - 트레이 아이콘의 범위 + * `x` Integer + * `y` Integer + * `width` Integer + * `height` Integer + +트레이 아이콘을 오른쪽 클릭될 때 호출 됩니다. + +__주의:__ 이 기능은 Windows와 OS X에서만 사용할 수 있습니다. +Windows에서는 이 이벤트가 컨텍스트 메뉴를 가지고 있을 때만 호출됩니다. + ### Event: 'double-clicked' 트레이 아이콘이 더블 클릭될 때 호출됩니다. @@ -79,6 +93,15 @@ __주의:__ 이 기능은 Windows에서만 작동합니다. __주의:__ 이 기능은 Windows에서만 작동합니다. +### Event: 'drop-files' + +* `event` +* `files` Array - 드롭된 파일의 경로 + +트레이 아이콘에 파일이 드롭되면 호출됩니다. + +__주의:__ 이 기능은 OS X에서만 작동합니다. + ### Tray.destroy() 트레이 아이콘을 즉시 삭제시킵니다. @@ -130,6 +153,15 @@ __주의:__ 이 기능은 OS X에서만 작동합니다. __알림:__ 이 기능은 Windows에서만 작동합니다. +### Tray.popContextMenu([position]) + +* `position` Object - 팝 메뉴 위치 + * `x` Integer + * `y` Integer + +__주의:__ 이 기능은 Windows와 OS X에서만 작동합니다. +`position`은 Windows에서만 사용할 수 있으며 기본값은 (0, 0)입니다. + ### Tray.setContextMenu(menu) * `menu` Menu diff --git a/docs/api/web-view-tag-ko.md b/docs/api/web-view-tag-ko.md index 2ff07ccc126f..e6b3d6c99f5c 100644 --- a/docs/api/web-view-tag-ko.md +++ b/docs/api/web-view-tag-ko.md @@ -215,6 +215,10 @@ Whether the renderer process has crashed. Overrides the user agent for guest page. +### ``.getUserAgent() + +Returns a `String` represents the user agent for guest page. + ### ``.insertCSS(css) * `css` String From 11589a7bde78bc69b9548a1cb700a0a9933916a5 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Wed, 29 Jul 2015 02:21:32 +0900 Subject: [PATCH 11/16] Update as upstream --- docs/api/web-view-tag-ko.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/web-view-tag-ko.md b/docs/api/web-view-tag-ko.md index e6b3d6c99f5c..9054d1824823 100644 --- a/docs/api/web-view-tag-ko.md +++ b/docs/api/web-view-tag-ko.md @@ -130,10 +130,10 @@ If "on", the guest page will have web security disabled. ## API -The webview element must be loaded before using the methods. +The webview element must be loaded before using the methods. **Example** ```javascript -webview.addEventListener("dom-ready", function(){ +webview.addEventListener("dom-ready", function() { webview.openDevTools(); }); ``` From 05def654c3cba14fcd809bed6f04cb06e45f3852 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Thu, 30 Jul 2015 09:56:27 +0900 Subject: [PATCH 12/16] Translate web-view-tag-tag-ko.md, improve grammer --- docs/api/content-tracing-ko.md | 5 +- docs/api/screen-ko.md | 6 +- docs/api/web-view-tag-ko.md | 207 ++++++++---------- .../build-instructions-windows-ko.md | 2 +- 4 files changed, 99 insertions(+), 121 deletions(-) diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md index defa29fda959..9758d9236aa8 100644 --- a/docs/api/content-tracing-ko.md +++ b/docs/api/content-tracing-ko.md @@ -20,10 +20,7 @@ tracing.startRecording('*', tracing.DEFAULT_OPTIONS, function() { * `callback` Function -카테고리 그룹 세트를 가져옵니다. 카테고리 그룹은 도달 대상이 되는 코드 경로를 변경할 수 있습니다. - -Get a set of category groups. The category groups can change as new code paths -are reached. +카테고리 그룹 세트를 가져옵니다. 카테고리 그룹은 도달된 코드 경로를 변경할 수 있습니다. Once all child processes have acked to the `getCategories` request, `callback` is invoked with an array of category groups. diff --git a/docs/api/screen-ko.md b/docs/api/screen-ko.md index 6b508991e4f7..44f0c1ea58b3 100644 --- a/docs/api/screen-ko.md +++ b/docs/api/screen-ko.md @@ -56,14 +56,14 @@ app.on('ready', function() { * `event` Event * `newDisplay` Object -새로운 디스플레이가 추가되면 발생합니다. +새로운 디스플레이가 추가되면 발생하는 이벤트입니다. ## Event: display-removed * `event` Event * `oldDisplay` Object -기존의 디스플레이가 제거되면 발생합니다. +기존의 디스플레이가 제거되면 발생하는 이벤트입니다. ## Event: display-metrics-changed @@ -71,7 +71,7 @@ app.on('ready', function() { * `display` Object * `changedMetrics` Array -`display`의 하나 또는 다수의 매트릭스가 변경될 경우 발생합니다. +`display`의 하나 또는 다수의 매트릭스가 변경될 때 발생하는 이벤트입니다. `changedMetrics`는 변경에 대한 정보를 담은 문자열의 배열입니다. `bounds`, `workArea`, `scaleFactor`, `rotation`등이 변경될 수 있습니다. diff --git a/docs/api/web-view-tag-ko.md b/docs/api/web-view-tag-ko.md index 9054d1824823..abef526d7876 100644 --- a/docs/api/web-view-tag-ko.md +++ b/docs/api/web-view-tag-ko.md @@ -1,31 +1,24 @@ # `` 태그 -Use the `webview` tag to embed 'guest' content (such as web pages) in your -Electron app. The guest content is contained within the `webview` container; -an embedder page within your app controls how the guest content is laid out and -rendered. +`guest` 컨텐츠(웹 페이지)를 Electron 앱 페이지에 삽입하기 위해 `webview` 태그를 사용할 수 있습니다. +게스트 컨텐츠는 `webview` 컨테이너에 담겨 대상 페이지에 삽입되고 해당 페이지에선 게스트 컨텐츠의 배치 및 렌더링 과정을 조작할 수 있습니다. -Different from the `iframe`, the `webview` runs in a separate process than your -app; it doesn't have the same permissions as your web page and all interactions -between your app and embedded content will be asynchronous. This keeps your app -safe from the embedded content. +`iframe`과 `webview`의 차이는 어플리케이션과 프로세스가 분리되어 돌아간다는 점입니다. +그것은 모든 권한이 웹 페이지와 같지 않고 모든 앱과 임베디드(게스트) 컨텐츠간의 상호작용이 비동기로 작동한다는 것을 의미합니다. +이에 따라 임베디드 컨텐츠로부터 어플리케이션을 안전하게 유지할 수 있습니다. ## 예제 -To embed a web page in your app, add the `webview` tag to your app's embedder -page (this is the app page that will display the guest content). In its simplest -form, the `webview` tag includes the `src` of the web page and css styles that -control the appearance of the `webview` container: +웹 페이지를 어플리케이션에 삽입하려면 `webview` 태그를 사용해 원하는 타겟 페이지에 추가하면 됩니다. (게스트 컨텐츠가 앱 페이지에 추가 됩니다) +간단한 예로 `webview` 태그의 `src` 속성에 페이지를 지정하고 css 스타일을 이용해서 컨테이너의 외관을 설정할 수 있습니다: ```html ``` -If you want to control the guest content in any way, you can write JavaScript -that listens for `webview` events and responds to those events using the -`webview` methods. Here's sample code with two event listeners: one that listens -for the web page to start loading, the other for the web page to stop loading, -and displays a "loading..." message during the load time: +게스트 컨텐츠를 조작하기 위해 자바스크립트로 `webview` 태그의 이벤트를 리스닝 하여 응답을 받을 수 있습니다. +다음 예제를 참고하세요: 첫번째 리스너는 페이지 로딩 시작시의 이벤트를 확인하고 두번째 리스너는 페이지의 로딩이 끝난시점을 확인합니다. +그리고 페이지를 로드하는 동안 "loading..." 메시지를 표시합니다. ```html