From bf5b084945eb6bccbb27d08fea252a1a6402874f Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Wed, 24 Jun 2015 11:41:47 +0900 Subject: [PATCH 1/5] Fix some typos and translate more files --- README-ko.md | 2 +- docs/README-ko.md | 4 +- .../atom-shell-vs-node-webkit-ko.md | 49 +++++++ .../build-instructions-linux-ko.md | 100 ++++++++++++++ docs/development/build-instructions-mac-ko.md | 56 ++++++++ .../build-instructions-windows-ko.md | 128 ++++++++++++++++++ docs/development/build-system-overview-ko.md | 64 +++++++++ docs/development/coding-style-ko.md | 1 - .../setting-up-symbol-server-ko.md | 56 ++++++++ .../source-code-directory-structure-ko.md | 48 +++++++ docs/tutorial/application-distribution-ko.md | 10 +- docs/tutorial/application-packaging-ko.md | 96 ++++++------- .../desktop-environment-integration-ko.md | 125 +++++++---------- docs/tutorial/online-offline-events-ko.md | 2 +- docs/tutorial/quick-start-ko.md | 2 +- docs/tutorial/using-native-node-modules-ko.md | 2 - docs/tutorial/using-pepper-flash-plugin-ko.md | 28 ++-- .../using-selenium-and-webdriver-ko.md | 2 +- 18 files changed, 622 insertions(+), 153 deletions(-) create mode 100644 docs/development/atom-shell-vs-node-webkit-ko.md create mode 100644 docs/development/build-instructions-linux-ko.md create mode 100644 docs/development/build-instructions-mac-ko.md create mode 100644 docs/development/build-instructions-windows-ko.md create mode 100644 docs/development/build-system-overview-ko.md create mode 100644 docs/development/setting-up-symbol-server-ko.md create mode 100644 docs/development/source-code-directory-structure-ko.md diff --git a/README-ko.md b/README-ko.md index cc862a3e89e7..2b7efe7343f9 100644 --- a/README-ko.md +++ b/README-ko.md @@ -33,7 +33,7 @@ npm install electron-prebuilt --save-dev ## 참조문서 -[docs](https://github.com/preco21/electron/tree/master/docs) 에 프레임워크 사용 가이드와 API 레퍼런스가 있습니다. +[docs](https://github.com/atom/electron/tree/master/docs/README-ko.md) 에 프레임워크 사용 가이드와 API 레퍼런스가 있습니다. 또한, Electron을 빌드 하는 방법과 프로젝트에 기여하는 방법 문서에 포함되어 있으니 참고바랍니다. ## 커뮤니티 diff --git a/docs/README-ko.md b/docs/README-ko.md index 0a00d7a479df..c59a59d89c8c 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -58,7 +58,7 @@ ## 개발자용 * [코딩 스타일](development/coding-style-ko.md) -* [소스코드 구조](development/source-code-directory-structure-ko.md) +* [소스 코드 디렉터리 구조](development/source-code-directory-structure-ko.md) * [NW.js와 기술적으로 다른점 (이전 node-webkit)](development/atom-shell-vs-node-webkit-ko.md) * [빌드 시스템 개요](development/build-system-overview-ko.md) * [빌드 설명서 (Mac)](development/build-instructions-mac-ko.md) @@ -66,4 +66,4 @@ * [빌드 설명서 (Linux)](development/build-instructions-linux-ko.md) * [디버거에서 디버그 심볼 서버 설정](development/setting-up-symbol-server-ko.md) -이 문서는 (@preco21)[https://github.com/preco21]이 번역하였습니다. +이 문서는 [@preco21](https://github.com/preco21) 이 번역하였습니다. diff --git a/docs/development/atom-shell-vs-node-webkit-ko.md b/docs/development/atom-shell-vs-node-webkit-ko.md new file mode 100644 index 000000000000..efecb3abdec5 --- /dev/null +++ b/docs/development/atom-shell-vs-node-webkit-ko.md @@ -0,0 +1,49 @@ +# NW.js와 기술적으로 다른점 (이전 node-webkit) + +__알림: Electron은 이전까지 Atom Shell로 불려졌습니다.__ + +Like NW.js, Electron provides a platform to write desktop applications +with JavaScript and HTML and has Node integration to grant access to low level +system in web pages. + +But there are also fundamental differences between the two projects that make +Electron a completely separate product from NW.js: + +__1. 어플리케이션의 엔트리 포인트__ + +In NW.js, the main entry of an application is a web page. You specify a +main page in the `package.json` and it is opened in a browser window as +the application's main window. + +In Electron, the entry point is a JavaScript script. Instead of +providing a URL directly, you manually create a browser window and load +an HTML file using the API. You also need to listen to window events +to decide when to quit the application. + +Electron works more like the Node.js runtime. Electron's APIs are lower level +so you can use it for browser testing in place of [PhantomJS](http://phantomjs.org/). + +__2. 빌드 시스템__ + +In order to avoid the complexity of building the whole Chromium, Electron uses +[libchromiumcontent](https://github.com/brightray/libchromiumcontent) to access +Chromium's Content API. libchromiumcontent is a single, shared library that +includes the Chromium Content module and all its dependencies. Users don't +need a powerful machine to build Electron. + +__3. Node 통합__ + +In NW.js, the Node integration in web pages requires patching Chromium to +work, while in Electron we chose a different way to integrate libuv loop with +each platform's message loop to avoid hacking Chromium. See the +[`node_bindings`](../../atom/common/) code for how that was done. + +__4. 다중 컨텍스트__ + +If you are an experienced NW.js user, you should be familiar with the +concept of Node context and web context. These concepts were invented because +of how NW.js was implemented. + +By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/) +feature of Node, Electron doesn't introduce a new JavaScript context in web +pages. diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md new file mode 100644 index 000000000000..57a8b3ec6403 --- /dev/null +++ b/docs/development/build-instructions-linux-ko.md @@ -0,0 +1,100 @@ +# 빌드 설명서 (Linux) + +## 빌드전 요구사양 + +* Python 2.7.x. Some distributions like CentOS still use Python 2.6.x +so you may need to check your Python version with `python -V`. +* Node.js v0.12.x. There are various ways to install Node. One can download +source code from [Node.js] (http://nodejs.org) and compile from source. +Doing so permits installing Node to your own home directory as a standard user. +Or try repositories such as [NodeSource] (https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories) +* Clang 3.4 or later +* Development headers of GTK+ and libnotify + +On Ubuntu, install the following libraries: + +```bash +$ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \ + libnotify-dev libgnome-keyring-dev libgconf2-dev \ + libasound2-dev libcap-dev libcups2-dev libxtst-dev \ + libxss1 gcc-multilib g++-multilib +``` + +Other distributions may offer similar packages for installation via package +managers such as yum. Or one can compile from source code. + + +## 가상머신을 사용하여 빌드 하는 경우 + +If you plan to build electron on a virtual machine, you will need a fixed-size +device container of at least 25 gigabytes in size. + + +## 코드 가져오기 + +```bash +$ git clone https://github.com/atom/electron.git +``` + +## 부트 스트랩 + +The bootstrap script will download all necessary build dependencies and create +build project files. You must have Python 2.7.x for the script to succeed. +Downloading certain files could take a long time. Notice that we are using +`ninja` to build Electron so there is no `Makefile` generated. + +```bash +$ cd electron +$ ./script/bootstrap.py -v +``` + +## 빌드 하기 + +If you would like to build both `Release` and `Debug` targets: + +```bash +$ ./script/build.py +``` + +This script will cause a very large Electron executable to be placed in +the directory `out/R`. The file size is in excess of 1.3 gigabytes. This +happens because the Release target binary contains debugging symbols. +To reduce the file size, run the `create-dist.py` script: + +```bash +$ ./script/create-dist.py +``` + +This will put a working distribution with much smaller file sizes in +the `dist` directory. After running the create-dist.py script, you +may want to remove the 1.3+ gigabyte binary which is still in out/R. + +You can also build the `Debug` target only: + +```bash +$ ./script/build.py -c D +``` + +After building is done, you can find the `electron` debug binary +under `out/D`. + + +## 정리 하기 + + +To clean the build files: + +```bash +$ ./script/clean.py +``` + + +## 문제 해결 + +Make sure you have installed all the build dependencies. + +## 테스트 + +```bash +$ ./script/test.py +``` diff --git a/docs/development/build-instructions-mac-ko.md b/docs/development/build-instructions-mac-ko.md new file mode 100644 index 000000000000..13a73ccf5194 --- /dev/null +++ b/docs/development/build-instructions-mac-ko.md @@ -0,0 +1,56 @@ +# 빌드 설명서 (Mac) + +## 빌드전 요구 사항 + +* OS X >= 10.8 +* [Xcode](https://developer.apple.com/technologies/tools/) >= 5.1 +* [node.js](http://nodejs.org) (external). + +If you are using the python downloaded by Homebrew, you also need to install +following python modules: + +* pyobjc + +## 코드 가져오기 + +```bash +$ git clone https://github.com/atom/electron.git +``` + +## 부트 스트랩 + +The bootstrap script will download all necessary build dependencies and create +build project files. Notice that we're using `ninja` to build Electron so +there is no Xcode project generated. + +```bash +$ cd electron +$ ./script/bootstrap.py -v +``` + +## 빌드 하기 + +Build both `Release` and `Debug` targets: + +```bash +$ ./script/build.py +``` + +You can also only build the `Debug` target: + +```bash +$ ./script/build.py -c D +``` + +After building is done, you can find `Electron.app` under `out/D`. + +## 32비트 지원 + +Electron can only be built for 64bit target on OS X, and there is no plan to +support 32bit OS X in future. + +## 테스트 + +```bash +$ ./script/test.py +``` diff --git a/docs/development/build-instructions-windows-ko.md b/docs/development/build-instructions-windows-ko.md new file mode 100644 index 000000000000..492ec824f7be --- /dev/null +++ b/docs/development/build-instructions-windows-ko.md @@ -0,0 +1,128 @@ +# 빌드 설명서 (Windows) + +## 빌드전 요구 사항 + +* Windows 7 / Server 2008 R2 or higher +* Visual Studio 2013 - [download VS 2013 Community Edition for + free](http://www.visualstudio.com/products/visual-studio-community-vs) +* [Python 2.7](http://www.python.org/download/releases/2.7/) +* [Node.js](http://nodejs.org/download/) +* [git](http://git-scm.com) + +If you don't have a Windows installation at the moment, +[modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads) has +timebombed versions of Windows that you can use to build Electron. + +The building of Electron is done entirely with command-line scripts, so you +can use any editor you like to develop Electron, but it also means you can +not use Visual Studio for the development. Support of building with Visual +Studio will come in the future. + +**Note:** Even though Visual Studio is not used for building, it's still +**required** because we need the build toolchains it provided. + +## 코드 가져오기 + +```powershell +git clone https://github.com/atom/electron.git +``` + +## 부트 스트랩 + +The bootstrap script will download all necessary build dependencies and create +build project files. Notice that we're using `ninja` to build Electron so +there is no Visual Studio project generated. + +```powershell +cd electron +python script\bootstrap.py -v +``` + +## 빌드 하기 + +Build both Release and Debug targets: + +```powershell +python script\build.py +``` + +You can also only build the Debug target: + +```powershell +python script\build.py -c D +``` + +After building is done, you can find `atom.exe` under `out\D`. + +## 64비트 빌드 + +To build for the 64bit target, you need to pass `--target_arch=x64` when running +the bootstrap script: + +```powershell +python script\bootstrap.py -v --target_arch=x64 +``` + +The other building steps are exactly the same. + +## 테스트 + +```powershell +python script\test.py +``` + +## 문제 해결 + +### Command xxxx not found + +If you encountered an error like `Command xxxx not found`, you may try to use +the `VS2012 Command Prompt` console to execute the build scripts. + +### Fatal internal compiler error: C1001 + +Make sure you have the latest Visual Studio update installed. + +### Assertion failed: ((handle))->activecnt >= 0 + +If building under Cygwin, you may see `bootstrap.py` failed with following +error: + +``` +Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430 + +Traceback (most recent call last): + File "script/bootstrap.py", line 87, in + sys.exit(main()) + File "script/bootstrap.py", line 22, in main + update_node_modules('.') + File "script/bootstrap.py", line 56, in update_node_modules + execute([NPM, 'install']) + File "/home/zcbenz/codes/raven/script/lib/util.py", line 118, in execute + raise e +subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 3 +``` + +This is caused by a bug when using Cygwin python and Win32 node together. The +solution is to use the Win32 python to execute the bootstrap script (supposing +you have installed python under `C:\Python27`): + +```bash +/cygdrive/c/Python27/python.exe script/bootstrap.py +``` + +### LNK1181: cannot open input file 'kernel32.lib' + +Try reinstalling 32bit node.js. + +### Error: ENOENT, stat 'C:\Users\USERNAME\AppData\Roaming\npm' + +Simply making that directory [should fix the problem](http://stackoverflow.com/a/25095327/102704): + +```powershell +mkdir ~\AppData\Roaming\npm +``` + +### node-gyp is not recognized as an internal or external command + +You may get this error if you are using Git Bash for building, you should use +PowerShell or VS2012 Command Prompt instead. diff --git a/docs/development/build-system-overview-ko.md b/docs/development/build-system-overview-ko.md new file mode 100644 index 000000000000..4967b28c6426 --- /dev/null +++ b/docs/development/build-system-overview-ko.md @@ -0,0 +1,64 @@ +# 빌드 시스템 개요 + +Electron uses `gyp` for project generation, and `ninja` for building, project +configurations can be found in `.gyp` and `.gypi` files. + +## Gyp 파일들 + +Following `gyp` files contain the main rules of building Electron: + +* `atom.gyp` defines how Electron itself is built. +* `common.gypi` adjusts the build configurations of Node to make it build + together with Chromium. +* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and + includes the default configurations of linking with Chromium. +* `vendor/brightray/brightray.gypi` includes general build configurations about + building. + +## 구성요소 빌드 + +Since Chromium is quite a large project, the final linking stage would take +quite a few minutes, making it hard for development. In order to solve this, +Chromium introduced the "component build", which builds each component as a +separate shared library, making linking very quick but sacrificing file size +and performance. + +In Electron we took a very similar approach: for `Debug` builds, the binary +will be linked to shared library version of Chromium's components to achieve +fast linking time; for `Release` builds, the binary will be linked to the static +library versions, so we can have the best possible binary size and performance. + +## 부트스트랩 최소화 + +All of Chromium's prebuilt binaries are downloaded when running the bootstrap +script. By default both static libraries and shared libraries will be +downloaded and the final size should be between 800MB and 2GB according to the +platform. + +If you only want to build Electron quickly for testing or development, you +can only download the shared library versions by passing the `--dev` parameter: + +```bash +$ ./script/bootstrap.py --dev +$ ./script/build.py -c D +``` + +## Two-phrase 프로젝트 생성 + +Electron links with different sets of libraries in `Release` and `Debug` +builds, however `gyp` doesn't support configuring different link settings for +different configurations. + +To work around this Electron uses a `gyp` variable +`libchromiumcontent_component` to control which link settings to use, and only +generates one target when running `gyp`. + +## 타겟 이름 + +Unlike most projects that use `Release` and `Debug` as target names, Electron +uses `R` and `D` instead. This is because `gyp` randomly crashes if there is +only one `Release` or `Debug` build configuration is defined, and Electron has +to only generate one target for one time as stated above. + +This only affects developers, if you are only building Electron for rebranding +you are not affected. diff --git a/docs/development/coding-style-ko.md b/docs/development/coding-style-ko.md index 40328cd6c5e3..fc2d1f498dfa 100644 --- a/docs/development/coding-style-ko.md +++ b/docs/development/coding-style-ko.md @@ -4,7 +4,6 @@ C++과 Python스크립트는 Chromium의 [코딩 스타일](http://www.chromium.org/developers/coding-style)을 따릅니다. 파이선 스크립트 `script/cpplint.py`를 사용하여 모든 파일이 해당 코딩스타일에 맞게 코딩 되었는지 확인할 수 있습니다. - 파이선의 버전은 2.7을 사용합니다. ## CoffeeScript diff --git a/docs/development/setting-up-symbol-server-ko.md b/docs/development/setting-up-symbol-server-ko.md new file mode 100644 index 000000000000..c4d2f2c4ebd7 --- /dev/null +++ b/docs/development/setting-up-symbol-server-ko.md @@ -0,0 +1,56 @@ +# 디버거에서 디버그 심볼 서버 설정 + +Debug symbols allow you to have better debugging sessions. They have information +about the functions contained in executables and dynamic libraries and provide +you with information to get clean call stacks. A Symbol Server allows the +debugger to load the correct symbols, binaries and sources automatically without +forcing users to download large debugging files. The server functions like +[Microsoft's symbol server](http://support.microsoft.com/kb/311503) so the +documentation there can be useful. + +Note that because released Electron builds are heavily optimized, debugging is +not always easy. The debugger will not be able to show you the content of all +variables and the execution path can seem strange because of inlining, tail +calls, and other compiler optimizations. The only workaround is to build an +unoptimized local build. + +The official symbol server URL for Electron is +http://54.249.141.255:8086/atom-shell/symbols. +You cannot visit this URL directly: you must add it to the symbol path of your +debugging tool. In the examples below, a local cache directory is used to avoid +repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an +appropriate cache directory on your machine. + +## Windbg에서 심볼 서버 사용하기 + +The Windbg symbol path is configured with a string value delimited with asterisk +characters. To use only the Electron symbol server, add the following entry to +your symbol path (__note:__ you can replace `c:\code\symbols` with any writable +directory on your computer, if you'd prefer a different location for downloaded +symbols): + +``` +SRV*c:\code\symbols\*http://54.249.141.255:8086/atom-shell/symbols +``` + +Set this string as `_NT_SYMBOL_PATH` in the environment, using the Windbg menus, +or by typing the `.sympath` command. If you would like to get symbols from +Microsoft's symbol server as well, you should list that first: + +``` +SRV*c:\code\symbols\*http://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*http://54.249.141.255:8086/atom-shell/symbols +``` + +## Using the symbol server in Visual Studio + + + + +## 문제 해결: Symbols will not load + +Type the following commands in Windbg to print why symbols are not loading: + +``` +> !sym noisy +> .reload /f chromiumcontent.dll +``` diff --git a/docs/development/source-code-directory-structure-ko.md b/docs/development/source-code-directory-structure-ko.md new file mode 100644 index 000000000000..8b768b115748 --- /dev/null +++ b/docs/development/source-code-directory-structure-ko.md @@ -0,0 +1,48 @@ +# 소스 코드 디렉터리 구조 + +## 개요 + +Electron의 소스 코드는 몇 개의 파트로 분리되어 있습니다. 우리는 Chromium의 분리 규칙(separation conventions)을 주로 따르고 있습니다. + +이미 [Chromium의 멀티 프로세스 아키텍쳐](http://dev.chromium.org/developers/design-documents/multi-process-architecture)에 익숙해져 있다면 소스 코드를 이해하기 쉬울 것입니다. + +## 소스 코드 구조 + +* **atom** - Electron의 소스코드. + * **app** - 시스템 엔트리 코드. + * **browser** - 주 윈도우를 포함한 프론트엔드, UI, 그리고 메인 프로세스에 관련된 것들. 주 랜더러와 웹 페이지 관리관련 코드. + * **lib** - 메인 프로세스 초기화 코드의 자바스크립트 파트. + * **ui** - 크로스 플랫폼에 대응하는 UI 구현. + * **cocoa** - 코코아 특정 소스 코드. + * **gtk** - GTK+ 특정 소스 코드. + * **win** - Windows GUI 특정 소스 코드. + * **default_app** - 어플리케이션이 제공되지 않으면 기본적으로 사용될 페이지. + * **api** - 메인 프로세스 API들의 구현. + * **lib** - API 구현의 자바스크립트 파트. + * **net** - 네트워크 관련 코드. + * **mac** - Mac 특정 Objective-C 소스 코드. + * **resources** - 아이콘들, 플랫폼 종속성 파일들, 기타 등등. + * **renderer** - 렌더러 프로세스에서 작동하는 코드들. + * **lib** - 렌더러 프로세스 초기화 코드의 자바스크립트 파트. + * **api** - 렌더러 프로세스 API들의 구현. + * **lib** - API 구현의 자바스크립트 파트. + * **common** - 메인 프로세스와 렌더러 프로세스에서 공유하는 코드. 유틸리티 함수와 node 메시지 루프를 Chromium의 메시지 루프에 통합시킨 코드가 포함. + * **lib** - 공통 자바스크립트 초기화 코드. + * **api** - 공통 API들의 구현, Electron의 빌트인 모듈 기초 코드들. + * **lib** - API 구현의 자바스크립트 파트. +* **chromium_src** - 복사된 Chromium 소스 코드. +* **docs** - 참조 문서. +* **spec** - 자동화된 테스트. +* **atom.gyp** - Electron의 빌드 규칙. +* **common.gypi** - 컴파일러 설정 및 `node` 와 `breakpad` 등의 구성요소를 위한 빌드 규칙. + +## 그외 디렉터리 구조 + +* **script** - 개발목적으로 사용되는 빌드, 패키징, 테스트, 기타등을 실행하는 스크립트. +* **tools** - gyp 파일에서 사용되는 헬퍼 스크립트, `script`와는 다르게 유저로부터 직접 실행되지 않는 스크립트들을 이곳에 넣습니다. +* **vendor** - 소스코드의 서드파티 종속성 코드, 소스 코드 디렉터리가 겹쳐 혼란을 일으킬 수 있기 때문에, + 우리는 `third_party`와 같은 Chromium 소스 코드 디렉터리에서 사용된 폴더 이름을 사용하지 않았습니다. +* **node_modules** - 빌드에 사용되는 node 서드파티 모듈. +* **out** - `ninja`의 임시 출력 디렉터리. +* **dist** - 배포용 바이너리를 빌드할 때 사용하는 `script/create-dist.py` 스크립트로부터 만들어지는 임시 디렉터리. +* **external_binaries** - `gyp`를 통한 빌드가 지원하지 않아 따로 다운로드된 서드파티 프레임워크 바이너리들. diff --git a/docs/tutorial/application-distribution-ko.md b/docs/tutorial/application-distribution-ko.md index fff2453fc0a5..43d9ce7f695f 100644 --- a/docs/tutorial/application-distribution-ko.md +++ b/docs/tutorial/application-distribution-ko.md @@ -1,4 +1,4 @@ -# 어플리케이션 배포 +# 어플리케이션 배포 Electron 어플리케이션을 배포할 때는 어플리케이션 폴더의 이름을 `app`으로 지정한 후 Electron 실행파일의 리소스 디렉터리에 집어넣어야합니다. 리소스 디렉터리는 OS X에선 `Electron.app/Contents/Resources/` Windows와 Linux에선 `resources/` 입니다. @@ -48,7 +48,7 @@ electron/resources/ └── app.asar ``` -자세한 내용은 [어플리케이션 패키징](application-packaging.md)에서 찾아볼 수 있습니다. +자세한 내용은 [어플리케이션 패키징](application-packaging-ko.md)에서 찾아볼 수 있습니다. ## 다운로드한 바이너리의 리소스를 앱에 맞게 수정하기 @@ -97,11 +97,11 @@ MyApp.app/Contents ### Linux 실행파일 `electron`의 이름을 원하는 대로 바꿀 수 있습니다. -리눅스 어플리케이션의 아이콘은 [.desktop file](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en)을 사용하여 지정할 수 있습니다. +리눅스 어플리케이션의 아이콘은 [.desktop](https://developer.gnome.org/integration-guide/stable/desktop-files.html.en) 파일을 사용하여 지정할 수 있습니다. ### 역자주-자동화 -일일이 Electron의 리소스를 수정하는 것은 상당히 귀찮고 복잡합니다. +배포시에 Electron의 리소스를 일일이 수정하는 것은 매우 귀찮고 복잡합니다. 하지만 이 작업을 자동화 시킬 수 있는 몇가지 방법이 있습니다: * [electron-builder](https://github.com/loopline-systems/electron-builder) @@ -135,4 +135,4 @@ $ script/build.py -c Release -t myapp Electron의 소스코드를 수정하고 다시 빌드하는 작업은 상당히 복잡합니다. 이를 해결하기 위해 [grunt-build-atom-shell](https://github.com/paulcbetts/grunt-build-atom-shell)를 사용하여 빌드를 자동화 시킬 수 있습니다. -이 툴을 사용하면 자동적으로 `.gyp`파일을 수정하고 다시 빌드합니다. 그리고 어플리케이션의 네이티브 Node 모듈 또한 새로운 실행파일 이름으로 매치 시킵니다. +이 툴을 사용하면 자동으로 `.gyp`파일을 수정하고 다시 빌드합니다. 그리고 어플리케이션의 네이티브 Node 모듈 또한 새로운 실행파일 이름으로 매치 시킵니다. diff --git a/docs/tutorial/application-packaging-ko.md b/docs/tutorial/application-packaging-ko.md index 3e4798f1f523..31314a1c9c0c 100644 --- a/docs/tutorial/application-packaging-ko.md +++ b/docs/tutorial/application-packaging-ko.md @@ -1,37 +1,37 @@ -# ø̼ Ű¡ +# 어플리케이션 패키징 -ø̼ ҽ ҽڵ带 κ ȣϱ , ణ ø̼ [asar][asar] ī̺ Ű¡ ֽϴ. +어플리케이션의 리소스와 소스코드를 유저로부터 보호하기 위해, 약간의 구조 변경으로 어플리케이션을 [asar][asar] 아카이브로 패키징 할 수 있습니다. -## `asar` ī̺ +## `asar` 아카이브 생성 -[asar][asar]ī̺ tar ҽ ϳ Ϸ ϴ. -׸ Electron Ƿ о ֽϴ. +[asar][asar]아카이브는 tar과 비슷한 포맷으로 모든 리소스를 하나의 파일로 만듭니다. +그리고 Electron은 압축해제 없이 임의로 모든 파일을 읽어들일 수 있습니다. -  ܰ踦 ø̼ `asar` ī̺ ֽϴ: +다음 몇가지 단계를 통해 어플리케이션을 `asar` 아카이브로 압축할 수 있습니다: -### 1. asar ƿƼ ġ +### 1. asar 유틸리티 설치 ```bash $ npm install -g asar ``` -### 2. `asar pack` Ŀǵ Ű¡ +### 2. `asar pack` 커맨드로 앱 패키징 ```bash $ asar pack your-app app.asar ``` -## `asar` ī̺ ϱ +## `asar` 아카이브 사용하기 -Electron ΰ API ֽϴ: Node.js Node API, Chromiumκ Web API. - API `asar` о ֵ մϴ. +Electron은 두가지의 API를 가지고 있습니다: Node.js로 부터 제공된 Node API, Chromium으로부터 제공된 Web API. +두 API 모두 `asar`에서 읽어들일 수 있도록 지원합니다. ### Node API -`fs.readFile` `require` Node API ϱ Electron `asar` ī̺갡 ͸ -ġ߽ϴ. ׷ ī̺ ο ҽ ýó ֽϴ. +`fs.readFile` 와 `require` 같은 Node API들을 지원하기 위해 Electron에선 `asar` 아카이브가 가상의 디렉터리 구조를 가지도록 +패치했습니다. 그래서 아카이브 내부에서 리소스들을 정상적인 파일 시스템처럼 접근할 수 있습니다. -, `/path/to` ο `example.asar` ī̺갡 ִٰ ϸ: +예를들어, `/path/to`라는 경로에 `example.asar`라는 아카이브가 있다고 가정하면: ```bash $ asar list /path/to/example.asar @@ -43,27 +43,27 @@ $ asar list /path/to/example.asar /static/jquery.min.js ``` -`asar` ī̺꿡 ֽϴ: +`asar` 아카이브에선 다음과 같이 파일을 읽을 수 있습니다: ```javascript var fs = require('fs'); fs.readFileSync('/path/to/example.asar/file.txt'); ``` -ī̺ Ʈ ͸ մϴ: +아카이브 내의 루트 디렉터리를 리스팅합니다: ```javascript var fs = require('fs'); fs.readdirSync('/path/to/example.asar'); ``` -ī̺ ϱ: +아카이브 안의 모듈 사용하기: ```javascript require('/path/to/example.asar/dir/module.js'); ``` -`BrowserWindow` Ŭ ̿ ϴ ǥ ֽϴ: +`BrowserWindow` 클래스를 이용해 원하는 웹 페이지도 표시할 수 있습니다: ```javascript var BrowserWindow = require('browser-window'); @@ -73,10 +73,10 @@ win.loadUrl('file:///path/to/example.asar/static/index.html'); ### Web API - , ī̺ `file:` Ͽ û ֽϴ. - Node API ͸ ϴ. +웹 페이지 내에선, 아카이브 내의 파일을 `file:` 프로토콜을 사용하여 요청할 수 있습니다. +이 또한 Node API와 같이 가상 디렉터리 구조를 가집니다. -, jQuery `$.get` Ͽ ֽϴ: +예를들어, jQuery의 `$.get`을 사용하여 파일을 가져올 수 있습니다: ```html ``` -### `asar` ī̺긦 Ϲ Ϸ ϱ +### `asar` 아카이브를 일반 파일로 취급하기 -`asar` ī̺ üũ(checksum) ˻ϱ ؼ, `asar` ī̺긦 ״ о鿩 ʿ䰡 ֽϴ. - ۾ ϱ `original-fs` ϴ Ʈ `fs` ſ ֽϴ. - `asar` ֽϴ. ״θ оԴϴ: +`asar` 아카이브의 체크섬(checksum)등을 검사하기 위해선, `asar` 아카이브를 파일 그대로 읽어들여야 할 필요가 있습니다. +이 작업을 하기 위해 `original-fs`라고 하는 빌트인 모듈을 `fs` 모듈 대신에 사용할 수 있습니다. +이 모듈은 `asar` 지원이 빠져있습니다. 즉 파일 그대로를 읽어들입니다: ```javascript var originalFs = require('original-fs'); originalFs.readFileSync('/path/to/example.asar'); ``` -## Node API Ѱ +## Node API의 한계 -`asar` ī̺긦 Node API ִ ͸ ۵ϵ ؿ, (low-level) Node API Ѱ谡 ֽϴ. +`asar` 아카이브를 Node API가 최대한 디렉터리 구조로 작동하도록 노력해왔지만, 여전히 저수준(low-level) Node API 때문에 한계가 있습니다. Even though we tried hard to make `asar` archives in the Node API work like directories as much as possible, there are still limitations due to the low-level nature of the Node API. -### ī̺ б Դϴ +### 아카이브는 읽기 전용입니다 -ī̺ ⺻δ Node API , `asar` ī̺꿡 ۵ ʽϴ. +아카이브는 수정할 수 없으며 기본적으로는 Node API로 파일을 수정할 수 있지만, `asar` 아카이브에선 작동하지 않습니다. -### ī̺ ͸ ۾ η ϸ ȵ˴ϴ +### 아카이브 안의 디렉터리를 작업 경로로 설정하면 안됩니다 -`asar` ī̺ ͸ó ֵ Ǿ, װ Ͻý ͸ ƴ ͸Դϴ. -׷ API ϴ `cwd` ɼ `asar` ī̺ ͸ η ϸ ߿ ߻ ֽϴ. +`asar` 아카이브는 디렉터리처럼 사용할 수 있도록 구현되었지만, 그것은 실제 파일시스템의 디렉터리가 아닌 가상의 디렉터리입니다. +그런 이유로 몇몇 API에서 지원하는 `cwd` 옵션을 `asar` 아카이브 안의 디렉터리 경로로 지정하면 나중에 문제가 발생할 수 있습니다. -### Ư API +### 특정 API로 인한 예외적인 압축 해제 - `fs` API `asar` ī̺ ʰ ٷ ī̺긦 аų , - API ý θ ۵ϹǷ API Electron - API ϰ ۵ ֵ ϱ ӽðο ش ϵ մϴ. ۾ ణ 带 ҷ ų ֽϴ. +많은 `fs` API가 `asar` 아카이브의 압축을 해제하지 않고 바로 아카이브를 읽거나 정보를 가져올 수 있으나, +몇몇 API는 시스템의 실제 파일의 경로를 기반으로 작동하므로 이 API들을 사용할 땐 Electron은 +이 API가 원할하게 작동할 수 있도록 하기 위해 임시경로에 해당 파일들의 압축을 해제합니다. 이 작업은 약간의 오버헤드를 불러 일으킬 수 있습니다. -شϴ API Լ ϴ: +해당하는 API 함수는 다음과 같습니다: * `child_process.execFile` * `fs.open` * `fs.openSync` * `process.dlopen` - Used by `require` on native modules -### `fs.stat` ߸ ͽ +### `fs.stat`의 잘못된 스테이터스 -`fs.stat` ȯǴ `Stats` ü API `asar` ī̺긦 Ÿ ϴ. -ֳϸ ī̺ ͸ δ Ͻýۿ ʱ Դϴ. -׷ ũ Ÿ Ȯ `Stats` ü ŷؼ ȵ˴ϴ. +`fs.stat` 로 부터 반환되는 `Stats` 객체와 비슷한 API들은 `asar` 아카이브를 타겟으로 할 경우 가상의 예측된 정보를 가집니다. +왜냐하면 아카이브의 디렉터리 경로는 실제 파일시스템에 존재하지 않기 때문입니다. +그러한 이유로 파일 크기와 파일 타입 등을 확인할 때 `Stats` 객체를 신뢰해선 안됩니다. ## Adding unpacked files in `asar` archive - ٿ , Node API ȣ ش ӽ մϴ. - ɹ ߻ ֽϴ. ׸ Ʈ ߸ ų ֽϴ. +전술한 바와 같이, 몇몇 Node API는 호출 시 해당 파일을 임시폴더에 압축을 해제합니다. +따로 성능문제가 발생할 수 있습니다. 그리고 백신 소프트웨어의 잘못된 오진을 일으킬 수도 있습니다. - ذϷ, `--unpack` ɼ ȰϿ Ǯ · ؾ մϴ. - node Ƽ ̺귯 unpack · մϴ: +이 문제를 해결하려면, `--unpack` 옵션을 활용하여 파일을 압축이 풀려진 상태로 유지해야 합니다. +다음의 예제는 node 네이티브 모듈의 공유 라이브러리를 unpack 상태로 유지합니다: ```bash $ asar pack app app.asar --unpack *.node ``` -Ŀǵ带 , ͸ `app.asar` ܿ `app.asar.unpacked` ˴ϴ. - ȿ unpack ɼǿ ϵ Ǯ · ԵǾ ֽϴ. - ø̼ ݵ ش Ͽմϴ. +커맨드를 실행한 후, 같은 디렉터리에 `app.asar` 파일 외에 `app.asar.unpacked` 폴더가 같이 생성됩니다. +이 폴더안에 unpack 옵션에서 설정한 파일들이 압축이 풀린 상태로 포함되어 있습니다. +유저에게 어플리케이션을 배포할 때 반드시 해당 폴더도 같이 배포하여야합니다. [asar]: https://github.com/atom/asar diff --git a/docs/tutorial/desktop-environment-integration-ko.md b/docs/tutorial/desktop-environment-integration-ko.md index fbf002154434..73dc47f05790 100644 --- a/docs/tutorial/desktop-environment-integration-ko.md +++ b/docs/tutorial/desktop-environment-integration-ko.md @@ -1,36 +1,30 @@ # 데스크톱 환경 통합 -Different operating systems provide different features on integrating desktop -applications into their desktop environments. For example, on Windows -applications can put shortcuts in the JumpList of task bar, and on Mac -applications can put a custom menu in the dock menu. +어플리케이션을 배포할 서로 다른 운영체제 시스템의 환경과 기능에 맞춰 사용 환경을 통합할 수 있습니다. +예를 들어, Windows에선 태스크바의 JumpList에 바로가기를 추가할 수 있고, Mac(OS X)에선 dock menu에 커스텀 메뉴를 추가할 수 있습니다. -This guide explains how to integrate your application into those desktop -environments with Electron APIs. +이 가이드는 Electron API를 이용하여 각 운영체제 시스템의 기능을 활용하는 방법을 설명합니다. ## 최근 사용한 문서 (Windows & OS X) -Windows and OS X provide easy access to a list of recent documents opened by -the application via JumpList and dock menu. +Windows와 OS X는 dock menu나 JumpList등을 통하여 최근 문서 리스트에 쉽게 접근할 수 있습니다. __JumpList:__ -![JumpList Recent Files](http://i.msdn.microsoft.com/dynimg/IC420538.png) +![JumpList 최근 문서](http://i.msdn.microsoft.com/dynimg/IC420538.png) -__Application dock menu:__ +__어플리케이션 dock menu:__ -To add a file to recent documents, you can use -[app.addRecentDocument][addrecentdocument] API: +파일을 최근 문서에 추가하려면, [app.addRecentDocument][addrecentdocument] API를 사용할 수 있습니다: ```javascript var app = require('app'); app.addRecentDocument('/Users/USERNAME/Desktop/work.type'); ``` -And you can use [app.clearRecentDocuments](clearrecentdocuments) API to empty -the recent documents list: +그리고 [app.clearRecentDocuments](clearrecentdocuments) API로 최근 문서 리스트를 비울 수 있습니다: ```javascript app.clearRecentDocuments(); @@ -38,30 +32,26 @@ app.clearRecentDocuments(); ### Windows에서 주의할 점 -In order to be able to use this feature on Windows, your application has to be -registered as a handler of the file type of the document, otherwise the file -won't appear in JumpList even after you have added it. You can find everything -on registering your application in [Application Registration][app-registration]. +이 기능을 Windows에서 사용할 땐, 운영체제 시스템에 어플리케이션에서 사용하는 파일 확장자가 등록되어 있어야 합니다. +그렇지 않은 경우 파일을 JumpList에 추가해도 추가되지 않습니다. +어플리케이션 등록에 관련된 API의 모든 내용은 [Application Registration][app-registration]에서 찾아볼 수 있습니다. -When a user clicks a file from JumpList, a new instance of your application will -be started with the path of the file added as a command line argument. +유저가 JumpList에서 파일을 클릭할 경우, 클릭된 파일의 경로가 커맨드 라인 인자로 추가되어 새로운 인스턴스의 어플리케이션이 실행됩니다. ### OS X에서 주의할 점 -When a file is requested from the recent documents menu, the `open-file` event -of `app` module would be emitted for it. +파일이 최근 문서 메뉴에서 요청될 경우, `app` 모듈의 `open-file` 이벤트가 호출됩니다. ## 커스텀 독 메뉴 (OS X) -OS X enables developers to specify a custom menu for the dock, which usually -contains some shortcuts for commonly used features of your application: +OS X는 개발자가 dock에 커스텀 메뉴를 만들 수 있도록 허용하고 있습니다. +보통 어플리케이션의 특정 기능 바로가기를 만들 때 사용합니다: -__Dock menu of Terminal.app:__ +__Terminal.app의 dock menu:__ -To set your custom dock menu, you can use the `app.dock.setMenu` API, which is -only available on OS X: +커스텀 dock menu를 설정하려면, `app.dock.setMenu` API를 사용하면 됩니다. OS X에서만 사용 가능합니다: ```javascript var app = require('app'); @@ -79,36 +69,29 @@ app.dock.setMenu(dockMenu); ## 사용자 작업 (Windows) -On Windows you can specify custom actions in the `Tasks` category of JumpList, -as quoted from MSDN: +Windows에선 JumpList의 `Tasks` 카테고리에 원하는 작업을 설정할 수 있습니다. +MSDN에선 해당 기능을 다음과 같이 설명하고 있습니다: -> Applications define tasks based on both the program's features and the key -> things a user is expected to do with them. Tasks should be context-free, in -> that the application does not need to be running for them to work. They -> should also be the statistically most common actions that a normal user would -> perform in an application, such as compose an email message or open the -> calendar in a mail program, create a new document in a word processor, launch -> an application in a certain mode, or launch one of its subcommands. An -> application should not clutter the menu with advanced features that standard -> users won't need or one-time actions such as registration. Do not use tasks -> for promotional items such as upgrades or special offers. +> 어플리케이션 작업은 프로그램의 기능 그리고 주요사양 두가지를 기반으로 유저의 행동을 예측하여 정의합니다. +> 실행할 필요가 없는 어플리케이션 작업은 작동하지 않을 때 반드시 context-free를 유지해야 합니다. +> 작업은 일반 사용자가 프로그램을 실행하거나, 이메일 프로그램으로 이메일을 작성하거나 달력을 불러오고, +> 워드 프로세서로 새 문서를 작성, 특정 모드, 부속 명령으로 프로그램을 실행하는 등의 +> 통계적, 일반적으로 가장 많이 사용되는 작업인지를 고려해야 합니다. +> 어플리케이션 작업은 일반 유저가 필요로 하지 않는 고급 기능을 조잡하게 채우거나 등록과 같은 일회성의 작업을 포함해선 안됩니다. +> 작업에 특별 이벤트 또는 업그레이드 등의 홍보성 작업을 추가하면 안됩니다. > -> It is strongly recommended that the task list be static. It should remain the -> same regardless of the state or status of the application. While it is -> possible to vary the list dynamically, you should consider that this could -> confuse the user who does not expect that portion of the destination list to -> change. +> 작업 리스트는 가능한 한 정적으로 유지되는 것을 적극 권장합니다. +> 이것은 동일한 상태 또는 응용 프로그램의 상태에 관계없이 유지되어야 합니다. +> 작업 목록은 동적으로 변경할 수 있지만, 몇몇 유저는 예상하지 못한 작업 목록 변경에 혼동할 수 있다는 점을 고려해야 합니다. -__Tasks of Internet Explorer:__ +__Internet Explorer의 작업:__ ![IE](http://i.msdn.microsoft.com/dynimg/IC420539.png) -Unlike the dock menu in OS X which is a real menu, user tasks in Windows work -like application shortcuts that when user clicks a task, a program would be -executed with specified arguments. +OS X의 말 그대로 메뉴로 작동하는 dock menu 와는 달리, Windows의 사용자 작업은 어플리케이션 바로가기처럼 작동합니다. +유저가 작업을 클릭할 시, 설정한 인자와 함께 새로운 어플리케이션이 실행됩니다. -To set user tasks for your application, you can use -[app.setUserTasks][setusertaskstasks] API: +사용자 작업을 설정하려면 [app.setUserTasks][setusertaskstasks] API를 사용하여 구현할 수 있습니다: ```javascript var app = require('app'); @@ -124,66 +107,54 @@ app.setUserTasks([ ]); ``` -To clean your tasks list, just call `app.setUserTasks` with empty array: +작업 리스트를 비우려면, 간단히 `app.setUserTasks` 메서드의 첫번째 인자에 빈 배열을 넣어 호출하면 됩니다: ```javascript app.setUserTasks([]); ``` -The user tasks will still show even after your application closes, so the icon -and program path specified for a task should exist until your application is -uninstalled. +사용자 작업 리스트는 어플리케이션이 종료되어도 태스크바에 여전히 보존됩니다. 그러므로 어플리케이션이 삭제되기 전까지 이 기능이 제대로 작동하도록 하기 위해 반드시 프로그램 경로와 아이콘 경로를 지정해야 합니다. ## Unity 런처 숏컷 기능 (Linux) -In Unity, you can add custom entries to its launcher via modifying `.desktop` -file, see [Adding shortcuts to a launcher][unity-launcher]. +Unity 환경에선, `.desktop` 파일을 수정함으로써 런처에 새로운 커스텀 엔트리를 추가할 수 있습니다. [Adding shortcuts to a launcher][unity-launcher] 가이드를 참고하세요. -__Launcher shortcuts of Audacious:__ +__Audacious의 런처 숏컷:__ ![audacious](https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles?action=AttachFile&do=get&target=shortcuts.png) ## Taskbar progress 기능 (Windows & Unity) -On Windows, a taskbar button can be used to display a progress bar. This enables -a window to provide progress information to the user without the user having to -switch to the window itself. +Windows에선 태스크바의 어플리케이션 버튼에 progress bar를 추가할 수 있습니다. +이 기능은 사용자가 어플리케이션의 창을 열지 않고도 어플리케이션의 작업의 상태 정보를 시각적으로 보여줄 수 있도록 해줍니다. -The Unity DE also has a similar feature that allows you to specify the progress -bar in the launcher. +또한 Unity DE도 런처에 progress bar를 부착할 수 있습니다. -__Progress bar in taskbar button:__ +__태스크바 버튼의 progress bar:__ ![Taskbar Progress Bar](https://cloud.githubusercontent.com/assets/639601/5081682/16691fda-6f0e-11e4-9676-49b6418f1264.png) -__Progress bar in Unity launcher:__ +__Unity 런처의 progress bar:__ ![Unity Launcher](https://cloud.githubusercontent.com/assets/639601/5081747/4a0a589e-6f0f-11e4-803f-91594716a546.png) -To set the progress bar for a Window, you can use the -[BrowserWindow.setProgressBar][setprogressbar] API: +이 기능은 [BrowserWindow.setProgressBar][setprogressbar] API를 사용하여 구현할 수 있습니다: ```javascript var window = new BrowserWindow({...}); window.setProgressBar(0.5); ``` -## 윈도우 파일 제시 (OS X) +## 윈도우 대표 파일 제시 (OS X) -On OS X a window can set its represented file, so the file's icon can show in -the title bar, and when users Command-Click or Control-Click on the tile a path -popup will show. +OS X는 윈도우에서 대표 파일을 설정할 수 있습니다. 쉽게 말해, 타이틀바에서 파일 아이콘을 볼 수 있을 때, 사용자가 Command-Click 또는 Control-Click 할 경우 파일 경로 팝업이 보여집니다. +또한 윈도우의 상태도 지정할 수 있습니다. 쉽게 말해, 로드된 문서의 수정여부를 타이틀바 파일 아이콘에 표시할 수 있습니다. -You can also set the edited state of a window so that the file icon can indicate -whether the document in this window has been modified. - -__Represented file popup menu:__ +__대표 파일 팝업 메뉴:__ -To set the represented file of window, you can use the -[BrowserWindow.setRepresentedFilename][setrepresentedfilename] and -[BrowserWindow.setDocumentEdited][setdocumentedited] APIs: +대표 파일 관련 API는 [BrowserWindow.setRepresentedFilename][setrepresentedfilename] 과 [BrowserWindow.setDocumentEdited][setdocumentedited]를 사용할 수 있습니다: ```javascript var window = new BrowserWindow({...}); diff --git a/docs/tutorial/online-offline-events-ko.md b/docs/tutorial/online-offline-events-ko.md index bf4a4124c396..0aa6a8aae4c0 100644 --- a/docs/tutorial/online-offline-events-ko.md +++ b/docs/tutorial/online-offline-events-ko.md @@ -1,4 +1,4 @@ -# 온라인/오프라인 이벤트 +# 온라인/오프라인 이벤트 온라인/오프라인 이벤트는 다음 예제와 같이 랜더러 프로세스에서 표준 HTML5 API를 이용하여 구현할 수 있습니다. diff --git a/docs/tutorial/quick-start-ko.md b/docs/tutorial/quick-start-ko.md index 9cd5f51230f2..204cf11eb215 100644 --- a/docs/tutorial/quick-start-ko.md +++ b/docs/tutorial/quick-start-ko.md @@ -1,4 +1,4 @@ -# 시작하기 +# 시작하기 ## 소개 diff --git a/docs/tutorial/using-native-node-modules-ko.md b/docs/tutorial/using-native-node-modules-ko.md index c36346b6536f..e78e93f5730b 100644 --- a/docs/tutorial/using-native-node-modules-ko.md +++ b/docs/tutorial/using-native-node-modules-ko.md @@ -38,8 +38,6 @@ $ 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`은 변경할 헤더의 위치를 찾습니다. `--target=0.25.0`은 Electron의 버전입니다. `--dist-url=...`은 헤더를 다운로드 하는 주소입니다. `--arch=ia64`는 64비트 시스템을 타겟으로 빌드 한다는 것을 `node-gyp`에게 알려줍니다. diff --git a/docs/tutorial/using-pepper-flash-plugin-ko.md b/docs/tutorial/using-pepper-flash-plugin-ko.md index 92dce61716ef..478c669b49be 100644 --- a/docs/tutorial/using-pepper-flash-plugin-ko.md +++ b/docs/tutorial/using-pepper-flash-plugin-ko.md @@ -1,16 +1,16 @@ -# Pepper ÷ ÷ ϱ +# Pepper 플래시 플러그인 사용하기 -ʿϴٸ Pepper ÷ ÷ ֽϴ. Electron pepper ÷ ÷ ϱ ؼ, pepper ÷ ÷ ġ ־մϴ. +필요하다면 Pepper 플래시 플러그인을 사용할 수 있습니다. Electron에서 pepper 플래시 플러그인을 사용하기 위해서는, 따로 pepper 플래시 플러그인의 위치를 지정해 주어야합니다. -## ÷ ÷ غϱ +## 플래시 플러그인 준비하기 -ũ `chrome://plugins` `` ÷ ÷ ġ ã ֽϴ. -Electron ÷ ÷ ϱ ؼ ; մϴ. +크롬 브라우저의 `chrome://plugins` 페이지에 접속한 후 `세부정보`에서 플래시 플러그인의 위치와 버전을 찾을 수 있습니다. +Electron에서 플래시 플러그인을 지원하기 위해선 이 두 가지를 복사해 와야 합니다. -## Electron ġ ߰ +## Electron 스위치 추가 -÷ ϱ `--ppapi-flash-path` `ppapi-flash-version` ÷׸ ready ̺Ʈ ȣDZ ߰ؾմϴ. -׸ `browser-window` `plugins` ġ ߰ؾմϴ. +플러그인을 사용하기 위해 직접적으로 `--ppapi-flash-path` 와 `ppapi-flash-version` 플래그를 ready 이벤트가 호출되기 전에 추가해야합니다. +그리고 `browser-window`에 `plugins` 스위치도 추가해야합니다. ```javascript var app = require('app'); @@ -30,10 +30,10 @@ app.on('window-all-closed', function() { } }); -// ÷ ÷ ġ մϴ. -// Windows , /path/to/pepflashplayer.dll -// Mac , /path/to/PepperFlashPlayer.plugin -// Linux , /path/to/libpepflashplayer.so +// 플래시 플러그인의 위치를 설정합니다. +// Windows의 경우, /path/to/pepflashplayer.dll +// Mac의 경우, /path/to/PepperFlashPlayer.plugin +// Linux의 경우, /path/to/libpepflashplayer.so app.commandLine.appendSwitch('ppapi-flash-path', '/path/to/libpepflashplayer.so'); // Specify flash version, for example, v17.0.0.169 @@ -52,8 +52,8 @@ app.on('ready', function() { }); ``` -## `` ±׸ ̿Ͽ ÷ Ȱȭ -`plugins` Ӽ `` ±׿ ߰մϴ. +## `` 태그를 이용하여 플러그인을 활성화 +`plugins` 속성을 `` 태그에 추가합니다. ```html ``` diff --git a/docs/tutorial/using-selenium-and-webdriver-ko.md b/docs/tutorial/using-selenium-and-webdriver-ko.md index ddd391653879..22c6f79429c9 100644 --- a/docs/tutorial/using-selenium-and-webdriver-ko.md +++ b/docs/tutorial/using-selenium-and-webdriver-ko.md @@ -3,7 +3,7 @@ [ChromeDriver - WebDriver for Chrome][chrome-driver]로 부터 인용: > WebDriver는 많은 브라우저에서 웹 앱을 자동적으로 테스트하는 툴입니다. -> 이 툴은 웹 페이지를 자동으로 탐색하고, 유저 폼을 사용하거나, 자바스크립트를 실행하는 등의 작업을 수행할 수 있습니다. +> 이 툴킷은 웹 페이지를 자동으로 탐색하고, 유저 폼을 사용하거나, 자바스크립트를 실행하는 등의 작업을 수행할 수 있습니다. > ChromeDriver는 Chromium의 WebDriver wire 프로토콜 스텐드얼론 서버 구현입니다. > Chromium 과 WebDriver 팀 멤버에 의해 개발되었습니다. From ebb031dafebaada7eb24b9599dc8e45b22183f79 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 26 Jun 2015 02:32:51 +0900 Subject: [PATCH 2/5] Fix typos, add more files --- docs/api/accelerator-ko.md | 2 +- docs/api/app-ko.md | 289 +++++ docs/api/auto-updater-ko.md | 143 +++ docs/api/browser-window-ko.md | 1022 +++++++++++++++++ docs/api/chrome-command-line-switches-ko.md | 109 ++ docs/api/clipboard-ko.md | 90 ++ docs/api/content-tracing-ko.md | 137 +++ docs/api/crash-reporter-ko.md | 61 + docs/api/dialog-ko.md | 92 ++ docs/api/file-object-ko.md | 30 + docs/api/frameless-window-ko.md | 89 ++ docs/api/global-shortcut-ko.md | 49 + docs/api/ipc-main-process-ko.md | 49 + docs/api/ipc-renderer-ko.md | 29 + docs/api/menu-item-ko.md | 14 +- docs/api/menu-ko.md | 330 ++++++ docs/api/native-image-ko.md | 139 +++ docs/api/power-monitor-ko.md | 2 +- docs/api/process-ko.md | 13 + docs/api/protocol-ko.md | 121 ++ docs/api/remote-ko.md | 159 +++ docs/api/screen-ko.md | 105 ++ docs/api/shell-ko.md | 39 + docs/api/synopsis-ko.md | 44 + docs/api/tray-ko.md | 2 +- docs/api/web-frame-ko.md | 66 ++ docs/api/web-view-tag-ko.md | 8 +- docs/api/window-open-ko.md | 60 + .../atom-shell-vs-node-webkit-ko.md | 45 +- .../build-instructions-linux-ko.md | 58 +- docs/development/build-instructions-mac-ko.md | 17 +- .../build-instructions-windows-ko.md | 54 +- docs/development/build-system-overview-ko.md | 67 +- docs/development/coding-style-ko.md | 10 +- .../source-code-directory-structure-ko.md | 4 +- docs/tutorial/application-distribution-ko.md | 6 +- docs/tutorial/application-packaging-ko.md | 36 +- docs/tutorial/debugging-main-process-ko.md | 4 +- .../desktop-environment-integration-ko.md | 30 +- docs/tutorial/devtools-extension-ko.md | 11 +- docs/tutorial/online-offline-events-ko.md | 2 +- docs/tutorial/quick-start-ko.md | 32 +- docs/tutorial/using-native-node-modules-ko.md | 8 +- docs/tutorial/using-pepper-flash-plugin-ko.md | 2 +- .../using-selenium-and-webdriver-ko.md | 10 +- 45 files changed, 3450 insertions(+), 239 deletions(-) create mode 100644 docs/api/app-ko.md create mode 100644 docs/api/auto-updater-ko.md create mode 100644 docs/api/browser-window-ko.md create mode 100644 docs/api/chrome-command-line-switches-ko.md create mode 100644 docs/api/clipboard-ko.md create mode 100644 docs/api/content-tracing-ko.md create mode 100644 docs/api/crash-reporter-ko.md create mode 100644 docs/api/dialog-ko.md create mode 100644 docs/api/file-object-ko.md create mode 100644 docs/api/frameless-window-ko.md create mode 100644 docs/api/global-shortcut-ko.md create mode 100644 docs/api/ipc-main-process-ko.md create mode 100644 docs/api/ipc-renderer-ko.md create mode 100644 docs/api/menu-ko.md create mode 100644 docs/api/native-image-ko.md create mode 100644 docs/api/process-ko.md create mode 100644 docs/api/protocol-ko.md create mode 100644 docs/api/remote-ko.md create mode 100644 docs/api/screen-ko.md create mode 100644 docs/api/shell-ko.md create mode 100644 docs/api/synopsis-ko.md create mode 100644 docs/api/web-frame-ko.md create mode 100644 docs/api/window-open-ko.md diff --git a/docs/api/accelerator-ko.md b/docs/api/accelerator-ko.md index 67f94b60a6cb..9e72543a4cc6 100644 --- a/docs/api/accelerator-ko.md +++ b/docs/api/accelerator-ko.md @@ -1,4 +1,4 @@ -# Accelerator +# Accelerator Accelerator는 키보드 단축키를 표현하는 문자열입니다, 여러 혼합키와 키코드를 `+` 문자를 이용하여 결합할 수 있습니다. diff --git a/docs/api/app-ko.md b/docs/api/app-ko.md new file mode 100644 index 000000000000..e0dd37ea836d --- /dev/null +++ b/docs/api/app-ko.md @@ -0,0 +1,289 @@ +# 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.md) gets blurred. + +## Event: browser-window-focus + +* `event` Event +* `window` BrowserWindow + +Emitted when a [browserWindow](browser-window.md) gets focused. + +## 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.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/auto-updater-ko.md b/docs/api/auto-updater-ko.md new file mode 100644 index 000000000000..4bc0b252f68b --- /dev/null +++ b/docs/api/auto-updater-ko.md @@ -0,0 +1,143 @@ +# auto-updater + +**This module has only been implemented for OS X.** + +Check out [atom/grunt-atom-shell-installer](https://github.com/atom/grunt-atom-shell-installer) +for building a Windows installer for your app. + +The `auto-updater` module is a simple wrap around the +[Squirrel.Mac](https://github.com/Squirrel/Squirrel.Mac) framework. + +Squirrel.Mac requires that your `.app` folder is signed using the +[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**. + +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. + +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's installer is also designed to be fault tolerant, and ensure that any +updates installed are valid. + +## Update Requests + +Squirrel is indifferent to the request the client application provides for +update checking. `Accept: application/json` is added to the request headers +because Squirrel is responsible for parsing the response. + +For the requirements imposed on the responses and the body format of an update +response see [Server Support](#server-support). + +Your update request must *at least* include a version identifier so that the +server can determine whether an update for this specific version is required. It +may also include other identifying criteria such as operating system version or +username, to allow the server to deliver as fine grained an update as you +would like. + +How you include the version identifier or other criteria is specific to the +server that you are requesting updates from. A common approach is to use query +parameters, like this: + +```javascript +// On the main process +var app = require('app'); +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. + +If an update is required your server should respond with a status code of +[200 OK](http://tools.ietf.org/html/rfc2616#section-10.2.1) and include the +[update JSON](#update-json-format) in the body. Squirrel **will** download and +install this update, even if the version of the update is the same as the +currently running version. To save redundantly downloading the same version +multiple times your server must not inform the client to update. + +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 + +When an update is available, Squirrel expects the following schema in response +to the update request provided: + +```json +{ + "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", +} +``` + +The only required key is "url", the others are optional. + +Squirrel will request "url" with `Accept: application/zip` and only supports +installing ZIP updates. If future update formats are supported their MIME type +will be added to the `Accept` header so that your server can return the +appropriate format. + +`pub_date` if present must be formatted according to ISO 8601. + +## Event: error + +* `event` Event +* `message` String + +Emitted when there is an error updating. + +## Event: checking-for-update + +Emitted when checking for update has started. + +## Event: update-available + +Emitted when there is an available update, the update would be downloaded +automatically. + +## Event: update-not-available + +Emitted when there is no available update. + +## Event: update-downloaded + +* `event` Event +* `releaseNotes` String +* `releaseName` String +* `releaseDate` Date +* `updateUrl` String +* `quitAndUpdate` Function + +Emitted when update has been downloaded, calling `quitAndUpdate()` would restart +the application and install the update. + +## autoUpdater.setFeedUrl(url) + +* `url` String + +Set the `url` and initialize the auto updater. The `url` could not be changed +once it is set. + +## autoUpdater.checkForUpdates() + +Ask the server whether there is an update, you have to call `setFeedUrl` before +using this API. diff --git a/docs/api/browser-window-ko.md b/docs/api/browser-window-ko.md new file mode 100644 index 000000000000..d46feff475d8 --- /dev/null +++ b/docs/api/browser-window-ko.md @@ -0,0 +1,1022 @@ +# 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. + +### 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.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: 'gpu-crashed' + +Emitted when the gpu 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.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, the options will be +`{marginsType:0, printBackgrounds:false, printSelectionOnly:false, + landscape:false}`. + +### 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. diff --git a/docs/api/chrome-command-line-switches-ko.md b/docs/api/chrome-command-line-switches-ko.md new file mode 100644 index 000000000000..49e5424e5e67 --- /dev/null +++ b/docs/api/chrome-command-line-switches-ko.md @@ -0,0 +1,109 @@ +# Supported Chrome command line switches + +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: + +```javascript +var app = require('app'); +app.commandLine.appendSwitch('remote-debugging-port', '8315'); +app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1'); + +app.on('ready', function() { + // Your code here +}); +``` + +## --client-certificate=`path` + +Sets `path` of client certificate file. + +## --ignore-connections-limit=`domains` + +Ignore the connections limit for `domains` list seperated by `,`. + +## --disable-http-cache + +Disables the disk cache for HTTP requests. + +## --remote-debugging-port=`port` + +Enables remote debug over HTTP on the specified `port`. + +## --proxy-server=`address:port` + +Uses a specified proxy server, overrides system settings. This switch only +affects HTTP and HTTPS requests. + +## --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. + +For example: + +* `MAP * 127.0.0.1` Forces all hostnames to be mapped to 127.0.0.1 +* `MAP *.google.com proxy` Forces all google.com subdomains to be resolved to + "proxy". +* `MAP test.com [::1]:77` Forces "test.com" to resolve to IPv6 loopback. Will + also force the port of the resulting socket address to be 77. +* `MAP * baz, EXCLUDE www.google.com` Remaps everything to "baz", except for + "www.google.com". + +These mappings apply to the endpoint host in a net request (the TCP connect +and host resolver in a direct connection, and the `CONNECT` in an http proxy +connection, and the endpoint host in a `SOCKS` proxy connection). + +## --host-resolver-rules=`rules` + +Like `--host-rules` but these `rules` only apply to the host resolver. + +[app]: app.md +[append-switch]: app.md#appcommandlineappendswitchswitch-value +[ready]: app.md#event-ready + +## --ignore-certificate-errors + +Ignores certificate related errors. + +## --ppapi-flash-path=`path` + +Sets `path` of pepper flash plugin. + +## --ppapi-flash-version=`version` + +Sets `version` of pepper flash plugin. + +## --log-net-log=`path` + +Enables saving net log events and writes them to `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. + +Passing `--v=-1` will disable logging. + +## --vmodule=`pattern` + +Gives the per-module maximal V-logging levels to override the value given by +`--v`. E.g. `my_module=2,foo*=3` would change the logging level for all code in +source files `my_module.*` and `foo*.*`. + +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); +app.commandLine.appendSwitch('vmodule', 'console=0'); +``` diff --git a/docs/api/clipboard-ko.md b/docs/api/clipboard-ko.md new file mode 100644 index 000000000000..35167e31730a --- /dev/null +++ b/docs/api/clipboard-ko.md @@ -0,0 +1,90 @@ +# clipboard + +The `clipboard` provides methods to do copy/paste operations. An example of +writing a string to clipboard: + +```javascript +var clipboard = require('clipboard'); +clipboard.writeText('Example String'); +``` + +On X Window systems, there is also a selection clipboard, to manipulate in it +you need to pass `selection` to each method: + +```javascript +var clipboard = require('clipboard'); +clipboard.writeText('Example String', 'selection'); +console.log(clipboard.readText('selection')); +``` + +## clipboard.readText([type]) + +* `type` String + +Returns the content in clipboard as plain text. + +## clipboard.writeText(text[, type]) + +* `text` String +* `type` String + +Writes the `text` into clipboard as plain text. + +## clipboard.readHtml([type]) + +* `type` String + +Returns the content in clipboard as markup. + +## clipboard.writeHtml(markup[, type]) + +* `markup` String +* `type` String + +Writes the `markup` into clipboard. + +## clipboard.readImage([type]) + +* `type` String + +Returns the content in clipboard as [NativeImage](native-image.md). + +## clipboard.writeImage(image[, type]) + +* `image` [NativeImage](native-image.md) +* `type` String + +Writes the `image` into clipboard. + +## clipboard.clear([type]) + +* `type` String + +Clears everything in clipboard. + +## clipboard.availableFormats([type]) + +Returns an array of supported `format` for the clipboard `type`. + +## clipboard.has(data[, type]) + +* `data` String +* `type` String + +Returns whether clipboard supports the format of specified `data`. + +```javascript +var clipboard = require('clipboard'); +console.log(clipboard.has('

selection

')); +``` + +**Note:** This API is experimental and could be removed in future. + +## clipboard.read(data[, type]) + +* `data` String +* `type` String + +Reads the `data` in clipboard. + +**Note:** This API is experimental and could be removed in future. diff --git a/docs/api/content-tracing-ko.md b/docs/api/content-tracing-ko.md new file mode 100644 index 000000000000..a0896c2a7182 --- /dev/null +++ b/docs/api/content-tracing-ko.md @@ -0,0 +1,137 @@ +# 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. + +```javascript +var tracing = require('content-tracing'); +tracing.startRecording('*', tracing.DEFAULT_OPTIONS, function() { + console.log('Tracing started'); + + setTimeout(function() { + tracing.stopRecording('', function(path) { + console.log('Tracing data recorded to ' + path); + }); + }, 5000); +}); +``` + +## tracing.getCategories(callback) + +* `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. + +## tracing.startRecording(categoryFilter, options, callback) + +* `categoryFilter` String +* `options` Integer +* `callback` Function + +Start recording on all processes. + +Recording begins immediately locally, and asynchronously on child processes +as soon as they receive the EnableRecording request. Once all child processes +have acked to the `startRecording` request, `callback` will be called back. + +`categoryFilter` is a filter to control what category groups should be +traced. A filter can have an optional `-` prefix to exclude category groups +that contain a matching category. Having both included and excluded +category patterns in the same list is not supported. + +Examples: + +* `test_MyTest*`, +* `test_MyTest*,test_OtherStuff`, +* `"-excluded_category1,-excluded_category2` + +`options` controls what kind of tracing is enabled, it could be a OR-ed +combination of `tracing.DEFAULT_OPTIONS`, `tracing.ENABLE_SYSTRACE`, +`tracing.ENABLE_SAMPLING` and `tracing.RECORD_CONTINUOUSLY`. + +## tracing.stopRecording(resultFilePath, callback) + +* `resultFilePath` String +* `callback` Function + +Stop recording on all processes. + +Child processes typically are caching trace data and only rarely flush and send +trace data back to the main process. That is because it may be an expensive +operation to send the trace data over IPC, and we would like to avoid much +runtime overhead of tracing. So, to end tracing, we must asynchronously ask all +child processes to flush any pending trace data. + +Once all child processes have acked to the `stopRecording` request, `callback` +will be called back with a file that contains the traced data. + +Trace data will be written into `resultFilePath` if it is not empty, or into a +temporary file. The actual file path will be passed to `callback` if it's not +null. + +## tracing.startMonitoring(categoryFilter, options, callback) + +* `categoryFilter` String +* `options` Integer +* `callback` Function + +Start monitoring on all processes. + +Monitoring begins immediately locally, and asynchronously on child processes as +soon as they receive the `startMonitoring` request. + +Once all child processes have acked to the `startMonitoring` request, +`callback` will be called back. + +## tracing.stopMonitoring(callback); + +* `callback` Function + +Stop monitoring on all processes. + +Once all child processes have acked to the `stopMonitoring` request, `callback` +is called back. + +## tracing.captureMonitoringSnapshot(resultFilePath, callback) + +* `resultFilePath` String +* `callback` Function + +Get the current monitoring traced data. + +Child processes typically are caching trace data and only rarely flush and send +trace data back to the main process. That is because it may be an expensive +operation to send the trace data over IPC, and we would like to avoid unneeded +runtime overhead of tracing. So, to end tracing, we must asynchronously ask all +child processes to flush any pending trace data. + +Once all child processes have acked to the `captureMonitoringSnapshot` request, +the `callback` will be invoked with a file that contains the traced data. + + +## tracing.getTraceBufferUsage(callback) + +* `callback` Function + +Get the maximum across processes of trace buffer percent full state. When the +TraceBufferUsage value is determined, the `callback` is called. + +## tracing.setWatchEvent(categoryName, eventName, callback) + +* `categoryName` String +* `eventName` String +* `callback` Function + +`callback` will will be called every time the given event occurs on any +process. + +## tracing.cancelWatchEvent() + +Cancel the watch event. If tracing is enabled, this may race with the watch +event callback. diff --git a/docs/api/crash-reporter-ko.md b/docs/api/crash-reporter-ko.md new file mode 100644 index 000000000000..1302d9b457e2 --- /dev/null +++ b/docs/api/crash-reporter-ko.md @@ -0,0 +1,61 @@ +# crash-reporter + +An example of automatically submitting crash reporters to remote server: + +```javascript +crashReporter = require('crash-reporter'); +crashReporter.start({ + productName: 'YourName', + companyName: 'YourCompany', + submitUrl: 'https://your-domain.com/url-to-submit', + autoSubmit: true +}); +``` + +## 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 + * `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. + + +**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() + +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() + +Returns all uploaded crash reports, each report contains date and uploaded ID. + +# crash-reporter payload + +The crash reporter will send the following data to the `submitUrl` as `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' +* `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 diff --git a/docs/api/dialog-ko.md b/docs/api/dialog-ko.md new file mode 100644 index 000000000000..04ed3fe07979 --- /dev/null +++ b/docs/api/dialog-ko.md @@ -0,0 +1,92 @@ +# dialog + +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 = ...; // window in which to show the dialog +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. + +## dialog.showOpenDialog([browserWindow], [options], [callback]) + +* `browserWindow` BrowserWindow +* `options` Object + * `title` String + * `defaultPath` String + * `filters` Array + * `properties` Array - Contains which features the dialog should use, can + contain `openFile`, `openDirectory`, `multiSelections` and + `createDirectory` +* `callback` Function + +On success, returns an array of file paths chosen by the user, otherwise +returns `undefined`. + +The `filters` specifies an array of file types that can be displayed or +selected, an example is: + +```javascript +{ + filters: [ + { name: 'Images', extensions: ['jpg', 'png', 'gif'] }, + { name: 'Movies', extensions: ['mkv', 'avi', 'mp4'] }, + { name: 'Custom File Type', extensions: ['as'] } + ] +} +``` + +If a `callback` is passed, the API call would be asynchronous and the result +would be passed via `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. + +## dialog.showSaveDialog([browserWindow], [options], [callback]) + +* `browserWindow` BrowserWindow +* `options` Object + * `title` String + * `defaultPath` String + * `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. + +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 - 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.md) +* `callback` Function + +Shows a message box, it will block until the message box is closed. It returns +the index of the clicked button. + +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. + +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/file-object-ko.md b/docs/api/file-object-ko.md new file mode 100644 index 000000000000..ea11e01a7526 --- /dev/null +++ b/docs/api/file-object-ko.md @@ -0,0 +1,30 @@ +# `File` object + +The DOM's File interface provides abstraction around native files, in order to +let users work on native files directly with HTML5 file API, Electron has +added a `path` attribute to `File` interface which exposes the file's real path +on filesystem. + +Example on getting real path of a dragged file: + +```html +
+ Drag your file here +
+ + +``` diff --git a/docs/api/frameless-window-ko.md b/docs/api/frameless-window-ko.md new file mode 100644 index 000000000000..fb3c6f5a824f --- /dev/null +++ b/docs/api/frameless-window-ko.md @@ -0,0 +1,89 @@ +# Frameless window + +A frameless window is a window that has no chrome. + +## Create a frameless window + +To create a frameless window, you only need to specify `frame` to `false` in +[BrowserWindow](browser-window.md)'s `options`: + + +```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: + +```javascript +var win = new BrowserWindow({ transparent: true, frame: false }); +``` + +### Limitations + +* 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. + +## 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 +(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. + +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 { + -webkit-app-region: no-drag; +} +``` + +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 +select the text on titlebar. To prevent this, you need to disable text +selection on dragging area like this: + +```css +.titlebar { + -webkit-user-select: none; + -webkit-app-region: drag; +} +``` + +## 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 +behave correctly on all platforms, you should never custom context menu on +draggable areas. diff --git a/docs/api/global-shortcut-ko.md b/docs/api/global-shortcut-ko.md new file mode 100644 index 000000000000..a8f3ac183df0 --- /dev/null +++ b/docs/api/global-shortcut-ko.md @@ -0,0 +1,49 @@ +# global-shortcut + +The `global-shortcut` module can register/unregister a global keyboard shortcut +in operating system, so that you can customize the operations for various shortcuts. +Note that the shortcut is global, even if the app does not get focused, it will still work. + +```javascript +var globalShortcut = require('global-shortcut'); + +// Register a 'ctrl+x' shortcut listener. +var ret = globalShortcut.register('ctrl+x', function() { console.log('ctrl+x is pressed'); }) + +if (!ret) { + console.log('registration failed'); +} + +// Check whether a shortcut is registered. +console.log(globalShortcut.isRegistered('ctrl+x')); + +// Unregister a shortcut. +globalShortcut.unregister('ctrl+x'); + +// Unregister all shortcuts. +globalShortcut.unregisterAll(); +``` + +## globalShortcut.register(accelerator, callback) + +* `accelerator` [Accelerator](accelerator.md) +* `callback` Function + +Registers a global shortcut of `accelerator`, the `callback` would be called when +the registered shortcut is pressed by user. + +## globalShortcut.isRegistered(accelerator) + +* `accelerator` [Accelerator](accelerator.md) + +Returns `true` or `false` depending on if the shortcut `accelerator` is registered. + +## globalShortcut.unregister(accelerator) + +* `accelerator` [Accelerator](accelerator.md) + +Unregisters the global shortcut of `keycode`. + +## globalShortcut.unregisterAll() + +Unregisters all the global shortcuts. diff --git a/docs/api/ipc-main-process-ko.md b/docs/api/ipc-main-process-ko.md new file mode 100644 index 000000000000..2487737baf52 --- /dev/null +++ b/docs/api/ipc-main-process-ko.md @@ -0,0 +1,49 @@ +# ipc (main process) + +Handles asynchronous and synchronous message sent from a renderer process (web +page). + +The messages sent from a renderer would be emitted to this module, the event name +is the `channel` when sending message. To reply a synchronous message, you need +to set `event.returnValue`, to send an asynchronous back to the sender, you can +use `event.sender.send(...)`. + +It's also possible to send messages from main process to the renderer process, +see [WebContents.send](browser-window.md#webcontentssendchannel-args) for more. + +An example of sending and handling messages: + +```javascript +// In main process. +var ipc = require('ipc'); +ipc.on('asynchronous-message', function(event, arg) { + console.log(arg); // prints "ping" + event.sender.send('asynchronous-reply', 'pong'); +}); + +ipc.on('synchronous-message', function(event, arg) { + console.log(arg); // prints "ping" + event.returnValue = 'pong'; +}); +``` + +```javascript +// In renderer process (web page). +var ipc = require('ipc'); +console.log(ipc.sendSync('synchronous-message', 'ping')); // prints "pong" + +ipc.on('asynchronous-reply', function(arg) { + console.log(arg); // prints "pong" +}); +ipc.send('asynchronous-message', 'ping'); +``` + +## Class: Event + +### Event.returnValue + +Assign to this to return an value to synchronous messages. + +### Event.sender + +The `WebContents` that sent the message. diff --git a/docs/api/ipc-renderer-ko.md b/docs/api/ipc-renderer-ko.md new file mode 100644 index 000000000000..75d26ce5438c --- /dev/null +++ b/docs/api/ipc-renderer-ko.md @@ -0,0 +1,29 @@ +# ipc (renderer) + +The `ipc` module provides a few methods so you can send synchronous and +asynchronous messages to the main process, and also receive messages sent from +main process. If you want to make use of modules of main process from renderer +process, you might consider using the [remote](remote.md) module. + +See [ipc (main process)](ipc-main-process.md) for examples. + +## ipc.send(channel[, args...]) + +Send `args..` to the renderer via `channel` in asynchronous message, the main +process can handle it by listening to the `channel` event of `ipc` module. + +## ipc.sendSync(channel[, args...]) + +Send `args..` to the renderer via `channel` in synchronous message, and returns +the result sent from main process. The main process can handle it by listening to +the `channel` event of `ipc` module, and returns by setting `event.returnValue`. + +**Note:** Usually developers should never use this API, since sending +synchronous message would block the whole renderer process. + +## ipc.sendToHost(channel[, args...]) + +Like `ipc.send` but the message will be sent to the host page instead of the +main process. + +This is mainly used by the page in `` to communicate with host page. diff --git a/docs/api/menu-item-ko.md b/docs/api/menu-item-ko.md index 09c2b782a228..519b7fb237a3 100644 --- a/docs/api/menu-item-ko.md +++ b/docs/api/menu-item-ko.md @@ -1,13 +1,13 @@ -# menu-item +# menu-item ## Class: MenuItem ### new MenuItem(options) * `options` Object - * `click` Function - ޴ Ŭ ȣǴ ݹԼ - * `selector` String - First Responder Ŭ ȣ Ǵ (OS X ) - * `type` String - `MenuItem` Ÿ `normal`, `separator`, `submenu`, `checkbox` Ǵ `radio` 밡 + * `click` Function - 메뉴 아이템이 클릭될 때 호출되는 콜백함수 + * `selector` String - First Responder가 클릭될 때 호출 되는 선택자 (OS X 전용) + * `type` String - `MenuItem`의 타입 `normal`, `separator`, `submenu`, `checkbox` 또는 `radio` 사용가능 * `label` String * `sublabel` String * `accelerator` [Accelerator](accelerator.md) @@ -15,6 +15,6 @@ * `enabled` Boolean * `visible` Boolean * `checked` Boolean - * `submenu` Menu - ޴ մϴ. `type` `submenu` ݵ ؾմϴ. Ϲ ޴ ֽϴ. - * `id` String - ޴ ۿ Ű մϴ. Ű `position` ɼǿ ֽϴ. - * `position` String - ̸ `id` ̿Ͽ ޴ ġ ϰ մϴ. + * `submenu` Menu - 보조메뉴를 설정합니다. `type`이 `submenu`일 경우 반드시 설정해야합니다. 일반 메뉴 아이템일 경우 생략할 수 있습니다. + * `id` String - 현재 메뉴 아이템에 대해 유일키를 지정합니다. 이 키는 이후 `position` 옵션에서 사용할 수 있습니다. + * `position` String - 미리 지정한 `id`를 이용하여 메뉴 아이템의 위치를 세밀하게 조정합니다. diff --git a/docs/api/menu-ko.md b/docs/api/menu-ko.md new file mode 100644 index 000000000000..62e07530f260 --- /dev/null +++ b/docs/api/menu-ko.md @@ -0,0 +1,330 @@ +# 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. + +Below is an example of creating a menu dynamically in a web page by using +the [remote](remote.md) module, and showing it when the user right clicks +the page: + +```html + + +``` + +Another example of creating the application menu with the simple template API: + +```html + + +``` + +## Class: 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. + +### 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`. + +**Note:** This method is OS X only. + +### Class Method: Menu.buildFromTemplate(template) + +* `template` Array + +Generally, the `template` is just an array of `options` for constructing +[MenuItem](menu-item.md), the usage can be referenced above. + +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]) + +* `browserWindow` BrowserWindow +* `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. + +### Menu.append(menuItem) + +* `menuItem` MenuItem + +Appends the `menuItem` to the menu. + +### Menu.insert(pos, menuItem) + +* `pos` Integer +* `menuItem` MenuItem + +Inserts the `menuItem` to the `pos` position of the menu. + +### Menu.items + +Get the array containing the menu's items. + +## Notes on OS X application menu + +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 + +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 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 + +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 item position + +You can make use of `position` and `id` to control how the item would be placed +when building a menu with `Menu.buildFromTemplate`. + +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 +[ + {label: '4', id: '4'}, + {label: '5', id: '5'}, + {label: '1', id: '1', position: 'before=4'}, + {label: '2', id: '2'}, + {label: '3', id: '3'} +] +``` + +Menu: + +``` +- 1 +- 2 +- 3 +- 4 +- 5 +``` + +Template: + +```javascript +[ + {label: 'a', position: 'endof=letters'}, + {label: '1', position: 'endof=numbers'}, + {label: 'b', position: 'endof=letters'}, + {label: '2', position: 'endof=numbers'}, + {label: 'c', position: 'endof=letters'}, + {label: '3', position: 'endof=numbers'} +] +``` + +Menu: + +``` +- --- +- a +- b +- c +- --- +- 1 +- 2 +- 3 +``` diff --git a/docs/api/native-image-ko.md b/docs/api/native-image-ko.md new file mode 100644 index 000000000000..55b896725c3a --- /dev/null +++ b/docs/api/native-image-ko.md @@ -0,0 +1,139 @@ +# NativeImage + +In Electron for the APIs that take images, you can pass either file paths or +`NativeImage` instances. When passing `null`, an empty image will be used. + +For example, when creating a tray or setting a window's icon, you can pass an image +file path as a `String`: + +```javascript +var appIcon = new Tray('/Users/somebody/images/icon.png'); +var window = new BrowserWindow({icon: '/Users/somebody/images/window.png'}); +``` + +Or read the image from the clipboard: + +```javascript +var clipboard = require('clipboard'); +var image = clipboard.readImage(); +var appIcon = new Tray(image); +``` + +## Supported formats + +Currently `PNG` and `JPEG` are supported. It is recommended to use `PNG` +because of its support for transparency and lossless compression. + +## High resolution image + +On platforms that have high-DPI support, you can append `@2x` after image's +file name's base name to mark it as a high resolution image. + +For example if `icon.png` is a normal image that has standard resolution, the +`icon@2x.png` would be treated as a high resolution image that has double DPI +density. + +If you want to support displays with different DPI density at the same time, you +can put images with different sizes in the same folder, and use the filename +without DPI suffixes, like this: + +```text +images/ +├── icon.png +├── icon@2x.png +└── icon@3x.png +``` + + +```javascript +var appIcon = new Tray('/Users/somebody/images/icon.png'); +``` + +Following suffixes as DPI denses are also supported: + +* `@1x` +* `@1.25x` +* `@1.33x` +* `@1.4x` +* `@1.5x` +* `@1.8x` +* `@2x` +* `@2.5x` +* `@3x` +* `@4x` +* `@5x` + +## Template image + +Template images consist of black and clear colors (and an alpha channel). +Template images are not intended to be used as standalone images and are usually +mixed with other content to create the desired final appearance. + +The most common case is to use template image for menu bar icon so it can adapt +to both light and dark menu bars. + +Template image is only supported on Mac. + +To mark an image as template image, its filename should end with the word +`Template`, examples are: + +* `xxxTemplate.png` +* `xxxTemplate@2x.png` + +## nativeImage.createEmpty() + +Creates an empty `NativeImage` instance. + +## nativeImage.createFromPath(path) + +* `path` String + +Creates a new `NativeImage` instance from a file located at `path`. + +## nativeImage.createFromBuffer(buffer[, scaleFactor]) + +* `buffer` [Buffer][buffer] +* `scaleFactor` Double + +Creates a new `NativeImage` instance from `buffer`. The `scaleFactor` is 1.0 by +default. + +## nativeImage.createFromDataUrl(dataUrl) + +* `dataUrl` String + +Creates a new `NativeImage` instance from `dataUrl`. + +## Class: NativeImage + +This class is used to represent an image. + +### NativeImage.toPng() + +Returns a [Buffer][buffer] that contains image's `PNG` encoded data. + +### NativeImage.toJpeg(quality) + +* `quality` Integer + +Returns a [Buffer][buffer] that contains image's `JPEG` encoded data. + +### NativeImage.toDataUrl() + +Returns the data URL of image. + +### NativeImage.isEmpty() + +Returns whether the image is empty. + +### NativeImage.getSize() + +Returns the size of the image. + +[buffer]: https://iojs.org/api/buffer.html#buffer_class_buffer + +### NativeImage.setTemplateImage(option) + +* `option` Boolean + +Marks the image as template image. diff --git a/docs/api/power-monitor-ko.md b/docs/api/power-monitor-ko.md index e21c70a77fea..387ae45389fb 100644 --- a/docs/api/power-monitor-ko.md +++ b/docs/api/power-monitor-ko.md @@ -1,4 +1,4 @@ -# power-monitor +# power-monitor `power-monitor` 모듈은 PC의 파워 상태를 나타냅니다. (주로 노트북 등에서 사용됩니다) 이 모듈은 메인 프로세스에서만 사용할 수 있으며, (remote 모듈(RPC)을 사용해도 작동이 됩니다) diff --git a/docs/api/process-ko.md b/docs/api/process-ko.md new file mode 100644 index 000000000000..29c6e053544f --- /dev/null +++ b/docs/api/process-ko.md @@ -0,0 +1,13 @@ +# Process object + +The `process` object in Electron has the following differences from the one in +upstream node: + +* `process.type` String - Process's type, can be `browser` (i.e. main process) or `renderer`. +* `process.versions['electron']` String - Version of Electron. +* `process.versions['chrome']` String - Version of Chromium. +* `process.resourcesPath` String - Path to JavaScript source code. + +## process.hang + +Causes the main thread of the current process hang. diff --git a/docs/api/protocol-ko.md b/docs/api/protocol-ko.md new file mode 100644 index 000000000000..a66d2d9fb480 --- /dev/null +++ b/docs/api/protocol-ko.md @@ -0,0 +1,121 @@ +# protocol + +The `protocol` module can register a new protocol or intercept an existing +protocol, so you can customize the response to the requests for various protocols. + +An example of implementing a protocol that has the same effect with the +`file://` protocol: + +```javascript +var app = require('app'); +var path = require('path'); + +app.on('ready', function() { + var protocol = require('protocol'); + protocol.registerProtocol('atom', function(request) { + var url = request.url.substr(7) + return new protocol.RequestFileJob(path.normalize(__dirname + '/' + url)); + }); +}); +``` + +**Note:** This module can only be used after the `ready` event +was emitted. + +## protocol.registerProtocol(scheme, handler) + +* `scheme` String +* `handler` Function + +Registers a custom protocol of `scheme`, the `handler` would be called with +`handler(request)` when the a request with registered `scheme` is made. + +You need to return a request job in the `handler` to specify which type of +response you would like to send. + +## protocol.unregisterProtocol(scheme) + +* `scheme` String + +Unregisters the custom protocol of `scheme`. + +## protocol.registerStandardSchemes(value) + +* `value` Array + +`value` is an array of custom schemes to be registered to the standard. + +## protocol.isHandledProtocol(scheme) + +* `scheme` String + +Returns whether the `scheme` can be handled already. + +## protocol.interceptProtocol(scheme, handler) + +* `scheme` String +* `handler` Function + +Intercepts an existing protocol with `scheme`, returning `null` or `undefined` +in `handler` would use the original protocol handler to handle the request. + +## protocol.uninterceptProtocol(scheme) + +* `scheme` String + +Unintercepts a protocol. + +## Class: protocol.RequestFileJob(path) + +* `path` String + +Create a request job which would query a file of `path` and set corresponding +mime types. + +## Class: protocol.RequestStringJob(options) + +* `options` Object + * `mimeType` String - Default is `text/plain` + * `charset` String - Default is `UTF-8` + * `data` String + +Create a request job which sends a string as response. + +## Class: protocol.RequestBufferJob(options) + +* `options` Object + * `mimeType` String - Default is `application/octet-stream` + * `encoding` String - Default is `UTF-8` + * `data` Buffer + +Create a request job which sends a buffer as response. + +## Class: protocol.RequestHttpJob(options) + +* `options` Object + * `url` String + * `method` String - Default is `GET` + * `referrer` String + +Send a request to `url` and pipe the response back. + +## Class: protocol.RequestErrorJob(code) + +* `code` Integer + +Create a request job which sets appropriate network error message to console. +Default message is `net::ERR_NOT_IMPLEMENTED`. Code should be in the following +range. + +* Ranges: + * 0- 99 System related errors + * 100-199 Connection related errors + * 200-299 Certificate errors + * 300-399 HTTP errors + * 400-499 Cache errors + * 500-599 ? + * 600-699 FTP errors + * 700-799 Certificate manager errors + * 800-899 DNS resolver errors + +Check the [network error list](https://code.google.com/p/chromium/codesearch#chromium/src/net/base/net_error_list.h) for code and message relations. diff --git a/docs/api/remote-ko.md b/docs/api/remote-ko.md new file mode 100644 index 000000000000..b7db7a8edb85 --- /dev/null +++ b/docs/api/remote-ko.md @@ -0,0 +1,159 @@ +# remote + +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 +the renderer process would have to explicitly send inter-process messages +to the main process. With the `remote` module, users can invoke methods of +main process object without explicitly sending inter-process messages, +similar to Java's +[RMI](http://en.wikipedia.org/wiki/Java_remote_method_invocation). + +An example of creating a browser window in renderer process: + +```javascript +var remote = require('remote'); +var BrowserWindow = remote.require('browser-window'); +var win = new BrowserWindow({ width: 800, height: 600 }); +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.md#browserwindowwebcontents). + +## Remote objects + +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). +When you invoke methods of a remote object, call a remote function, or create +a new object with the remote constructor (function), you are actually sending +synchronous inter-process messages. + +In the example above, both `BrowserWindow` and `win` were remote objects and +`new BrowserWindow` didn't create a `BrowserWindow` object in the renderer process. +Instead, it created a `BrowserWindow` object in the main process and returned the +corresponding remote object in the renderer process, namely the `win` object. + +## Lifetime of remote objects + +Electron makes sure that as long as the remote object in the renderer process +lives (in other words, has not been garbage collected), the corresponding object +in the main process would never be released. When the remote object has been +garbage collected, the corresponding object in the main process would be +dereferenced. + +If the remote object is leaked in renderer process (e.g. stored in a map but never +freed), the corresponding object in the main process would also be leaked, +so you should be very careful not to leak remote objects. + +Primary value types like strings and numbers, however, are sent by copy. + +## Passing callbacks to the main process + +Some APIs in the main process accept callbacks, and it would be tempting to +pass callbacks when calling a remote function. The `remote` module does support +doing this, but you should also be extremely careful with this. + +First, in order to avoid deadlocks, the callbacks passed to the main process +are called asynchronously, so you should not expect the main process to +get the return value of the passed callbacks. + +Second, the callbacks passed to the main process will not get released +automatically after they are called. Instead, they will persistent until the +main process garbage-collects them. + +For example, the following code seems innocent at first glance. It installs a +callback for the `close` event on a remote object: + +```javascript +var remote = require('remote'); +remote.getCurrentWindow().on('close', function() { + // blabla... +}); +``` + +The problem is that the callback would be stored in the main process until you +explicitly uninstall it! So each time you reload your window, the callback would +be installed again and previous callbacks would just leak. To make things +worse, since the context of previously installed callbacks have been released, +when the `close` event was emitted, exceptions would be raised in the main process. + +Generally, unless you are clear what you are doing, you should always avoid +passing callbacks to the main process. + +## Remote buffer + +An instance of node's `Buffer` is an object, so when you get a `Buffer` from +the main process, what you get is indeed a remote object (let's call it remote +buffer), and everything would just follow the rules of remote objects. + +However you should remember that although a remote buffer behaves like the real +`Buffer`, it's not a `Buffer` at all. If you pass a remote buffer to node APIs +that accept a `Buffer`, you should assume the remote buffer would be treated +like a normal object, instead of a `Buffer`. + +For example, you can call `BrowserWindow.capturePage` in the renderer process, which +returns a `Buffer` by calling the passed callback: + +```javascript +var remote = require('remote'); +var fs = require('fs'); +remote.getCurrentWindow().capturePage(function(image) { + var buf = image.toPng(); + fs.writeFile('/tmp/screenshot.png', buf, function(err) { + console.log(err); + }); +}); +``` + +But you may be surprised to find that the file written was corrupted. This is +because when you called `fs.writeFile`, thinking that `buf` was a `Buffer` when +in fact it was a remote buffer, and it was converted to string before it was +written to the file. Since `buf` contained binary data and could not be represented +by a UTF-8 encoded string, the written file was corrupted. + +The work-around is to write the `buf` in the main process, where it is a real +`Buffer`: + +```javascript +var remote = require('remote'); +remote.getCurrentWindow().capturePage(function(image) { + var buf = image.toPng(); + remote.require('fs').writeFile('/tmp/screenshot.png', buf, function(err) { + console.log(err); + }); +}); +``` + +The same thing could happen for all native types, but usually it would just +throw a type error. The `Buffer` deserves your special attention because it +might be converted to string, and APIs accepting `Buffer` usually accept string +too, and data corruption could happen when it contains binary data. + +## remote.require(module) + +* `module` String + +Returns the object returned by `require(module)` in the main process. + +## remote.getCurrentWindow() + +Returns the [BrowserWindow](browser-window.md) object which this web page +belongs to. + +## remote.getCurrentWebContent() + +Returns the WebContents object of this web page. + +## remote.getGlobal(name) + +* `name` String + +Returns the global variable of `name` (e.g. `global[name]`) in the main +process. + +## remote.process + +Returns the `process` object in the main process. This is the same as +`remote.getGlobal('process')`, but gets cached. diff --git a/docs/api/screen-ko.md b/docs/api/screen-ko.md new file mode 100644 index 000000000000..c554863586cc --- /dev/null +++ b/docs/api/screen-ko.md @@ -0,0 +1,105 @@ +# 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` is an [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. + +An example of creating a window that fills the whole screen: + +```javascript +var app = require('app'); +var BrowserWindow = require('browser-window'); + +var mainWindow; + +app.on('ready', function() { + var atomScreen = require('screen'); + var size = atomScreen.getPrimaryDisplay().workAreaSize; + mainWindow = new BrowserWindow({ width: size.width, height: size.height }); +}); +``` + +Another example of creating a window in the external display: + +```javascript +var app = require('app'); +var BrowserWindow = require('browser-window'); + +var mainWindow; + +app.on('ready', function() { + var atomScreen = require('screen'); + var displays = atomScreen.getAllDisplays(); + var externalDisplay = null; + for (var i in displays) { + if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) { + externalDisplay = displays[i]; + break; + } + } + + if (externalDisplay) { + mainWindow = new BrowserWindow({ + x: externalDisplay.bounds.x + 50, + y: externalDisplay.bounds.y + 50, + }); + } +}); +``` + +## Event: display-added + +* `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 + +* `event` Event +* `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`. + +## 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) + +* `point` Object + * `x` Integer + * `y` Integer + +Returns the display nearest the specified point. + +## screen.getDisplayMatching(rect) + +* `rect` Object + * `x` Integer + * `y` Integer + * `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 new file mode 100644 index 000000000000..0d8879637feb --- /dev/null +++ b/docs/api/shell-ko.md @@ -0,0 +1,39 @@ +# shell + +The `shell` module provides functions related to desktop integration. + +An example of opening a URL in default browser: + +```javascript +var shell = require('shell'); +shell.openExternal('https://github.com'); +``` + +## shell.showItemInFolder(fullPath) + +* `fullPath` String + +Show the given file in a file manager. If possible, select the file. + +## shell.openItem(fullPath) + +* `fullPath` String + +Open the given file in the desktop's default manner. + +## shell.openExternal(url) + +* `url` String + +Open the given external protocol URL in the desktop's default manner. (For +example, mailto: URLs in the default mail user agent.) + +## shell.moveItemToTrash(fullPath) + +* `fullPath` String + +Move the given file to trash and returns boolean status for the operation. + +## shell.beep() + +Play the beep sound. diff --git a/docs/api/synopsis-ko.md b/docs/api/synopsis-ko.md new file mode 100644 index 000000000000..89c897c3bc4d --- /dev/null +++ b/docs/api/synopsis-ko.md @@ -0,0 +1,44 @@ +# Synopsis + +All of [node.js's built-in modules](http://nodejs.org/api/) are available in +Electron, and third-party node modules are fully supported too (including the +[native modules](../tutorial/using-native-node-modules.md)). + +Electron also provides some extra built-in modules for developing native +desktop applications. Some modules are only available on the main process, some +are only available on the renderer process, and some can be used on both processes. +The basic rule is: if a module is GUI or low-level system related, then it should +be only available on the main process. You need to be familiar with the concept of +[main process vs. renderer process](../tutorial/quick-start.md#the-main-process) +scripts to be able to use those modules. + +The main process script is just like a normal `node.js` script: + +```javascript +var app = require('app'); +var BrowserWindow = require('browser-window'); + +var window = null; + +app.on('ready', function() { + window = new BrowserWindow({width: 800, height: 600}); + window.loadUrl('https://github.com'); +}); +``` + +The web page is no different than a normal web page, except for the extra +ability to use node modules: + +```html + + + + + + +``` + +To run your app, read [Run your app](../tutorial/quick-start.md#run-your-app). diff --git a/docs/api/tray-ko.md b/docs/api/tray-ko.md index 2678b6812dc8..145302b65f65 100644 --- a/docs/api/tray-ko.md +++ b/docs/api/tray-ko.md @@ -1,4 +1,4 @@ -# Tray +# Tray `Tray`는 OS의 알림영역에 아이콘을 표시합니다. 보통 컨텍스트 메뉴(context menu)를 같이 사용합니다. diff --git a/docs/api/web-frame-ko.md b/docs/api/web-frame-ko.md new file mode 100644 index 000000000000..71f61d09ea45 --- /dev/null +++ b/docs/api/web-frame-ko.md @@ -0,0 +1,66 @@ +# web-frame + +The `web-frame` module can custom the rendering of current web page. + +An example of zooming current page to 200%. + +```javascript +var webFrame = require('web-frame'); +webFrame.setZoomFactor(2); +``` + +## webFrame.setZoomFactor(factor) + +* `factor` Number - Zoom factor + +Changes the zoom factor to the specified factor, zoom factor is +zoom percent / 100, so 300% = 3.0. + +## webFrame.getZoomFactor() + +Returns the current zoom factor. + +## webFrame.setZoomLevel(level) + +* `level` Number - Zoom level + +Changes the zoom level to the specified level, 0 is "original size", and each +increment above or below represents zooming 20% larger or smaller to default +limits of 300% and 50% of original size, respectively. + +## webFrame.getZoomLevel() + +Returns the current zoom level. + +## webFrame.setSpellCheckProvider(language, autoCorrectWord, provider) + +* `language` String +* `autoCorrectWord` Boolean +* `provider` Object + +Sets a provider for spell checking in input fields and text areas. + +The `provider` must be an object that has a `spellCheck` method that returns +whether the word passed is correctly spelled. + +An example of using [node-spellchecker][spellchecker] as provider: + +```javascript +require('web-frame').setSpellCheckProvider("en-US", true, { + spellCheck: function(text) { + return !(require('spellchecker').isMisspelled(text)); + } +}); +``` + +## webFrame.registerUrlSchemeAsSecure(scheme) + +* `scheme` String + +Sets the `scheme` as secure scheme. + +Secure schemes do not trigger mixed content warnings. For example, `https` and +`data` are secure schemes because they cannot be corrupted by active network +attackers. + +[spellchecker]: https://github.com/atom/node-spellchecker diff --git a/docs/api/web-view-tag-ko.md b/docs/api/web-view-tag-ko.md index 198deec8dd6c..2ff07ccc126f 100644 --- a/docs/api/web-view-tag-ko.md +++ b/docs/api/web-view-tag-ko.md @@ -1,4 +1,4 @@ -# `` ± +# `` 태그 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; @@ -10,7 +10,7 @@ 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. -## +## 예제 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 @@ -45,7 +45,7 @@ and displays a "loading..." message during the load time: ``` -## ± Ӽ +## 태그 속성 ### src @@ -308,7 +308,7 @@ page can handle it by listening to the `channel` event of `ipc` module. See [WebContents.send](browser-window-ko.md#webcontentssendchannel-args) for examples. -## DOM ̺Ʈ +## DOM 이벤트 ### did-finish-load diff --git a/docs/api/window-open-ko.md b/docs/api/window-open-ko.md new file mode 100644 index 000000000000..dccba9121bff --- /dev/null +++ b/docs/api/window-open-ko.md @@ -0,0 +1,60 @@ +# `window.open` function + +When `window.open` is called to create a new window in web page, a new instance +of `BrowserWindow` will be created for the `url`, and a proxy will be returned +to `window.open` to let the page to have limited control over it. + +The proxy only has some limited standard functionality implemented to be +compatible with traditional web pages, for full control of the created window +you should create a `BrowserWindow` directly. + +## window.open(url, [frameName[, features]]) + +* `url` String +* `frameName` String +* `features` String + +Creates a new window and returns an instance of `BrowserWindowProxy` class. + +## window.opener.postMessage(message, targetOrigin) + +* `message` String +* `targetOrigin` String + +Sends a message to the parent window with the specified origin or `*` for no +origin preference. + +## Class: BrowserWindowProxy + +### BrowserWindowProxy.blur() + +Removes focus from the child window. + +### BrowserWindowProxy.close() + +Forcefully closes the child window without calling its unload event. + +### BrowserWindowProxy.closed + +Set to true after the child window gets closed. + +### BrowserWindowProxy.eval(code) + +* `code` String + +Evaluates the code in the child window. + +### BrowserWindowProxy.focus() + +Focuses the child window (brings the window to front). + +### BrowserWindowProxy.postMessage(message, targetOrigin) + +* `message` String +* `targetOrigin` String + +Sends a message to the child window with the specified origin or `*` for no +origin preference. + +In addition to these methods, the child window implements `window.opener` object +with no properties and a single method: diff --git a/docs/development/atom-shell-vs-node-webkit-ko.md b/docs/development/atom-shell-vs-node-webkit-ko.md index efecb3abdec5..f688204d537d 100644 --- a/docs/development/atom-shell-vs-node-webkit-ko.md +++ b/docs/development/atom-shell-vs-node-webkit-ko.md @@ -1,49 +1,34 @@ -# NW.js와 기술적으로 다른점 (이전 node-webkit) +# NW.js와 기술적으로 다른점 (이전 node-webkit) __알림: Electron은 이전까지 Atom Shell로 불려졌습니다.__ -Like NW.js, Electron provides a platform to write desktop applications -with JavaScript and HTML and has Node integration to grant access to low level -system in web pages. +NW.js 처럼 Electron은 JavaScript와 HTML 그리고 Node 통합환경을 제공함으로써 웹 페이지에서 저수준 시스템에 접근할 수 있는 웹 기반 데스크탑 어플리케이션을 작성할 수 있도록 합니다. -But there are also fundamental differences between the two projects that make -Electron a completely separate product from NW.js: +하지만 Electron과 NW.js는 근본적인 개발흐름의 차이도 있습니다: __1. 어플리케이션의 엔트리 포인트__ -In NW.js, the main entry of an application is a web page. You specify a -main page in the `package.json` and it is opened in a browser window as -the application's main window. +NW.js에선 어플리케이션의 엔트리 포인트로 웹 페이지를 사용합니다. +`package.json`내의 main 필드에 메인 웹 페이지(index.html) 파일을 지정하면 어플리케이션의 메인 윈도우로 열리게 됩니다. -In Electron, the entry point is a JavaScript script. Instead of -providing a URL directly, you manually create a browser window and load -an HTML file using the API. You also need to listen to window events -to decide when to quit the application. +Electron에선 JavaScript를 엔트리 포인트로 사용합니다. URL을 직접 제공하는 대신 API를 사용하여 직접 브라우저 창과 HTML 파일을 로드할 수 있습니다. +또한 윈도우의 종료시기를 결정하는 이벤트를 리스닝해야합니다. -Electron works more like the Node.js runtime. Electron's APIs are lower level -so you can use it for browser testing in place of [PhantomJS](http://phantomjs.org/). +Electron은 Node.js 런타임과 비슷하게 작동합니다. Electron의 API는 저수준이기에 브라우저 테스팅을 위해 [PhantomJS](http://phantomjs.org/)를 사용할 수도 있습니다. __2. 빌드 시스템__ -In order to avoid the complexity of building the whole Chromium, Electron uses -[libchromiumcontent](https://github.com/brightray/libchromiumcontent) to access -Chromium's Content API. libchromiumcontent is a single, shared library that -includes the Chromium Content module and all its dependencies. Users don't -need a powerful machine to build Electron. +Electron은 Chromium의 모든것을 빌드하는 복잡성을 피하기 위해 [libchromiumcontent](https://github.com/brightray/libchromiumcontent)를 사용하여 +Chromium의 Content API에 접근합니다. libchromiumcontent은 단일 공유 라이브러리이고 Chromium Content 모듈과 종속성 라이브러리들을 포함합니다. +유저는 Electron을 빌드 하기 위해 높은 사양의 빌드용 컴퓨터를 구비할 필요가 없습니다. __3. Node 통합__ -In NW.js, the Node integration in web pages requires patching Chromium to -work, while in Electron we chose a different way to integrate libuv loop with -each platform's message loop to avoid hacking Chromium. See the -[`node_bindings`](../../atom/common/) code for how that was done. +NW.js는 웹 페이지에서 require를 사용할 수 있도록 Chromium을 패치했습니다. 한편 Electron은 Chromium의 해킹을 방지하기 위해 libuv loop와 각 플랫폼의 메시지 루프에 통합하는 등의 다른 방법을 채택하였습니다. +[`node_bindings`](../../atom/common/) 코드를 보면 이 부분이 어떻게 구현됬는지를 알 수 있습니다. __4. 다중 컨텍스트__ -If you are an experienced NW.js user, you should be familiar with the -concept of Node context and web context. These concepts were invented because -of how NW.js was implemented. +만약 NW.js를 사용해본적이 있다면 Node context와 Web context의 개념을 잘 알고 있을겁니다. 이 개념은 NW.js가 구현된 방식에 따라 만들어졌습니다. -By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/) -feature of Node, Electron doesn't introduce a new JavaScript context in web -pages. +Node의 [다중 컨텍스트](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)를 사용할 경우 Electron은 웹 페이지에서 새로운 JavaScript 컨텍스트를 생성하지 않습니다. diff --git a/docs/development/build-instructions-linux-ko.md b/docs/development/build-instructions-linux-ko.md index 57a8b3ec6403..d70e27967ea6 100644 --- a/docs/development/build-instructions-linux-ko.md +++ b/docs/development/build-instructions-linux-ko.md @@ -2,16 +2,14 @@ ## 빌드전 요구사양 -* Python 2.7.x. Some distributions like CentOS still use Python 2.6.x -so you may need to check your Python version with `python -V`. -* Node.js v0.12.x. There are various ways to install Node. One can download -source code from [Node.js] (http://nodejs.org) and compile from source. -Doing so permits installing Node to your own home directory as a standard user. -Or try repositories such as [NodeSource] (https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories) -* Clang 3.4 or later -* Development headers of GTK+ and libnotify +* Python 2.7.x. 몇몇 CentOS와 같은 배포판들은 아직도 Python 2.6.x 버전을 사용합니다. 그래서 `python -V`를 통해 버전을 확인해 줄 필요가 있습니다. +* Node.js v0.12.x. Node를 설치하는 방법은 여러가지가 있습니다. 그중 하나는 [Node.js](http://nodejs.org) 사이트에서 소스코드를 받아 빌드하는 방법입니다. +이렇게 하면 Node를 일반 유저로 홈 디렉터리에 설치할 수 있습니다. 또는 [NodeSource](https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories) 에서 받아올 수도 있습니다. +자세한 내용은 [Node.js 설치 방법](https://github.com/joyent/node/wiki/Installation) 을 참고하세요. +* Clang 3.4 또는 최신 버전 +* GTK+ 와 libnotify의 개발용 헤더 -On Ubuntu, install the following libraries: +Ubuntu를 사용하고 있다면 다음 커맨드로 설치하면 합니다: ```bash $ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \ @@ -20,14 +18,12 @@ $ sudo apt-get install build-essential clang libdbus-1-dev libgtk2.0-dev \ libxss1 gcc-multilib g++-multilib ``` -Other distributions may offer similar packages for installation via package -managers such as yum. Or one can compile from source code. - +다른 배포판의 경우 yum과 같은 패키지 매니저를 통해 패키지를 설치 할 수 있습니다. 패키지의 이름은 대부분 비슷할 것입니다. +또는 소스코드를 내려받아 직접 빌드하는 방법도 있습니다. ## 가상머신을 사용하여 빌드 하는 경우 -If you plan to build electron on a virtual machine, you will need a fixed-size -device container of at least 25 gigabytes in size. +만약 Electron을 가상머신으로 빌드 할 계획이라면 해당 가상머신의 스토리지를 최소 25GB 이상을 확보해 놓아야 합니다. ## 코드 가져오기 @@ -38,10 +34,10 @@ $ git clone https://github.com/atom/electron.git ## 부트 스트랩 -The bootstrap script will download all necessary build dependencies and create -build project files. You must have Python 2.7.x for the script to succeed. -Downloading certain files could take a long time. Notice that we are using -`ninja` to build Electron so there is no `Makefile` generated. +부트스트랩 스크립트는 필수적인 빌드 종속성 라이브러리들을 모두 다운로드하고 프로젝트 파일을 생성합니다. +스크립트가 정상적으로 작동하기 위해선 Python 2.7.x 버전이 필요합니다. +아마 다운로드 작업이 상당히 많은 시간을 소요할 것입니다. +참고로 Electron은 빌드 툴체인으로 `ninja`를 사용하므로 `Makefile`은 생성되지 않습니다. ```bash $ cd electron @@ -50,48 +46,42 @@ $ ./script/bootstrap.py -v ## 빌드 하기 -If you would like to build both `Release` and `Debug` targets: +`Release` 와 `Debug` 두 타겟 모두 빌드 합니다: ```bash $ ./script/build.py ``` -This script will cause a very large Electron executable to be placed in -the directory `out/R`. The file size is in excess of 1.3 gigabytes. This -happens because the Release target binary contains debugging symbols. -To reduce the file size, run the `create-dist.py` script: +이 스크립트는 `out/R` 디렉터리에 크기가 매우 큰 Electron 실행 파일을 배치합니다. 파일 크기는 1.3GB를 초과합니다. +이러한 문제가 발생하는 이유는 Release 타겟 바이너리가 디버그 심볼을 포함하기 때문입니다. +파일 크기를 줄이려면 `create-dist.py` 스크립트를 실행하세요: ```bash $ ./script/create-dist.py ``` -This will put a working distribution with much smaller file sizes in -the `dist` directory. After running the create-dist.py script, you -may want to remove the 1.3+ gigabyte binary which is still in out/R. +이 스크립트는 매우 작은 배포판을 `dist` 디렉터리에 생성합니다. +create-dist.py 스크립트를 실행한 이후 1.3GB를 초과하는 공간을 차지하는 out/R 폴더의 실행파일 바이너리는 삭제해도 됩니다. -You can also build the `Debug` target only: +`Debug` 타겟만 빌드 할 수도 있습니다: ```bash $ ./script/build.py -c D ``` -After building is done, you can find the `electron` debug binary -under `out/D`. - +빌드가 모두 끝나면 `out/D` 디렉터리에서 `electron` 디버그 바이너리를 찾을 수 있습니다. ## 정리 하기 - -To clean the build files: +빌드 파일들을 정리합니다: ```bash $ ./script/clean.py ``` - ## 문제 해결 -Make sure you have installed all the build dependencies. +개발 종속성 라이브러리들을 제대로 설치했는지 확인하세요. ## 테스트 diff --git a/docs/development/build-instructions-mac-ko.md b/docs/development/build-instructions-mac-ko.md index 13a73ccf5194..6608c2e45266 100644 --- a/docs/development/build-instructions-mac-ko.md +++ b/docs/development/build-instructions-mac-ko.md @@ -6,8 +6,7 @@ * [Xcode](https://developer.apple.com/technologies/tools/) >= 5.1 * [node.js](http://nodejs.org) (external). -If you are using the python downloaded by Homebrew, you also need to install -following python modules: +만약 Homebrew를 이용해 파이선을 설치했다면 다음 파이선 모듈도 같이 설치해야 합니다: * pyobjc @@ -19,9 +18,8 @@ $ git clone https://github.com/atom/electron.git ## 부트 스트랩 -The bootstrap script will download all necessary build dependencies and create -build project files. Notice that we're using `ninja` to build Electron so -there is no Xcode project generated. +부트스트랩 스크립트는 필수적인 빌드 종속성 라이브러리들을 모두 다운로드하고 프로젝트 파일을 생성합니다. +참고로 Electron은 빌드 툴체인으로 `ninja`를 사용하므로 Xcode 프로젝트는 생성되지 않습니다. ```bash $ cd electron @@ -30,24 +28,23 @@ $ ./script/bootstrap.py -v ## 빌드 하기 -Build both `Release` and `Debug` targets: +`Release` 와 `Debug` 두 타겟 모두 빌드 합니다: ```bash $ ./script/build.py ``` -You can also only build the `Debug` target: +`Debug` 타겟만 빌드 할 수도 있습니다: ```bash $ ./script/build.py -c D ``` -After building is done, you can find `Electron.app` under `out/D`. +빌드가 모두 끝나면 `out/D` 디렉터리에서 `Electron.app` 실행 파일을 찾을 수 있습니다. ## 32비트 지원 -Electron can only be built for 64bit target on OS X, and there is no plan to -support 32bit OS X in future. +Electron은 현재 OS X 64비트 빌드만 지원하고 있습니다. 그리고 앞으로도 OS X 32비트는 지원할 계획이 없습니다. ## 테스트 diff --git a/docs/development/build-instructions-windows-ko.md b/docs/development/build-instructions-windows-ko.md index 492ec824f7be..3611bcddf722 100644 --- a/docs/development/build-instructions-windows-ko.md +++ b/docs/development/build-instructions-windows-ko.md @@ -1,25 +1,23 @@ -# 빌드 설명서 (Windows) +# 빌드 설명서 (Windows) ## 빌드전 요구 사항 -* Windows 7 / Server 2008 R2 or higher -* Visual Studio 2013 - [download VS 2013 Community Edition for - free](http://www.visualstudio.com/products/visual-studio-community-vs) +* Windows 7 / Server 2008 R2 또는 최신 버전 +* Visual Studio 2013 - [VS 2013 커뮤니티 에디션 무료 다운로드](http://www.visualstudio.com/products/visual-studio-community-vs) * [Python 2.7](http://www.python.org/download/releases/2.7/) * [Node.js](http://nodejs.org/download/) * [git](http://git-scm.com) +아직 Windows를 설치하지 않았다면 [modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads)에서 Electron을 빌드할 수 있는 timebombed Windows 버전을 확인할 수 있습니다. + If you don't have a Windows installation at the moment, [modern.ie](https://www.modern.ie/en-us/virtualization-tools#downloads) has timebombed versions of Windows that you can use to build Electron. -The building of Electron is done entirely with command-line scripts, so you -can use any editor you like to develop Electron, but it also means you can -not use Visual Studio for the development. Support of building with Visual -Studio will come in the future. +Electron은 전적으로 command-line 스크립트를 사용하여 빌드합니다. 그렇기에 Electron을 개발하는데 아무런 에디터나 사용할 수 있습니다. +하지만 이 말은 Visual Studio를 개발을 위해 사용할 수 없다는 말이 됩니다. 나중에 Visual Studio를 이용한 빌드 방법도 제공할 예정입니다. -**Note:** Even though Visual Studio is not used for building, it's still -**required** because we need the build toolchains it provided. +**참고:** Visual Studio가 빌드에 사용되지 않더라도 제공된 빌드 툴체인이 **필수적으로** 사용되므로 여전히 필요합니다. ## 코드 가져오기 @@ -29,9 +27,8 @@ git clone https://github.com/atom/electron.git ## 부트 스트랩 -The bootstrap script will download all necessary build dependencies and create -build project files. Notice that we're using `ninja` to build Electron so -there is no Visual Studio project generated. +부트스트랩 스크립트는 필수적인 빌드 종속성 라이브러리들을 모두 다운로드하고 프로젝트 파일을 생성합니다. +참고로 Electron은 빌드 툴체인으로 `ninja`를 사용하므로 Visual Studio 프로젝트는 생성되지 않습니다. ```powershell cd electron @@ -40,30 +37,29 @@ python script\bootstrap.py -v ## 빌드 하기 -Build both Release and Debug targets: +`Release` 와 `Debug` 두 타겟 모두 빌드 합니다: ```powershell python script\build.py ``` -You can also only build the Debug target: +`Debug` 타겟만 빌드 할 수도 있습니다: ```powershell python script\build.py -c D ``` -After building is done, you can find `atom.exe` under `out\D`. +빌드가 모두 끝나면 `out/D` 디렉터리에서 `atom.exe` 실행 파일을 찾을 수 있습니다. ## 64비트 빌드 -To build for the 64bit target, you need to pass `--target_arch=x64` when running -the bootstrap script: +64비트를 타겟으로 빌드 하려면 부트스트랩 스크립트를 실행할 때 `--target_arch=x64` 인자를 같이 넘겨주면 됩니다: ```powershell python script\bootstrap.py -v --target_arch=x64 ``` -The other building steps are exactly the same. +다른 빌드 단계도 정확하게 같습니다. ## 테스트 @@ -75,17 +71,15 @@ python script\test.py ### Command xxxx not found -If you encountered an error like `Command xxxx not found`, you may try to use -the `VS2012 Command Prompt` console to execute the build scripts. +만약 `Command xxxx not found`와 같은 형식의 에러가 발생했다면 `VS2012 Command Prompt` 콘솔로 빌드 스크립트를 실행해볼 필요가 있습니다. ### Fatal internal compiler error: C1001 -Make sure you have the latest Visual Studio update installed. +Visual Studio가 업데이트까지 완벽하게 설치된 최신버전인지 확인하세요. ### Assertion failed: ((handle))->activecnt >= 0 -If building under Cygwin, you may see `bootstrap.py` failed with following -error: +Cygwin에서 빌드 할 경우 `bootstrap.py` 스크립트가 다음의 에러와 함께 빌드에 실패할 수 있습니다: ``` Assertion failed: ((handle))->activecnt >= 0, file src\win\pipe.c, line 1430 @@ -102,9 +96,8 @@ Traceback (most recent call last): subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 3 ``` -This is caused by a bug when using Cygwin python and Win32 node together. The -solution is to use the Win32 python to execute the bootstrap script (supposing -you have installed python under `C:\Python27`): +이 버그는 Cygwin python과 Win32 node를 같이 사용할 경우 발생합니다. +부트스트랩 스크립트에서 Win32 python을 사용함으로써 이 문제를 해결할 수 있습니다 (`C:\Python27` 디렉터리에 python이 설치되었다는 것을 가정하면): ```bash /cygdrive/c/Python27/python.exe script/bootstrap.py @@ -112,11 +105,11 @@ you have installed python under `C:\Python27`): ### LNK1181: cannot open input file 'kernel32.lib' -Try reinstalling 32bit node.js. +32bit node.js를 다시 설치하세요. ### Error: ENOENT, stat 'C:\Users\USERNAME\AppData\Roaming\npm' -Simply making that directory [should fix the problem](http://stackoverflow.com/a/25095327/102704): +간단하게 해당 디렉터리를 생성하면 [문제가 해결될 겁니다](http://stackoverflow.com/a/25095327/102704): ```powershell mkdir ~\AppData\Roaming\npm @@ -124,5 +117,4 @@ mkdir ~\AppData\Roaming\npm ### node-gyp is not recognized as an internal or external command -You may get this error if you are using Git Bash for building, you should use -PowerShell or VS2012 Command Prompt instead. +Git Bash로 빌드 했을 때 이러한 에러가 발생할 수 있습니다. 반드시 PowerShell이나 VS2012 Command Prompt에서 빌드를 진행해야 합니다. diff --git a/docs/development/build-system-overview-ko.md b/docs/development/build-system-overview-ko.md index 4967b28c6426..92fd50008529 100644 --- a/docs/development/build-system-overview-ko.md +++ b/docs/development/build-system-overview-ko.md @@ -1,64 +1,51 @@ -# 빌드 시스템 개요 +# 빌드 시스템 개요 -Electron uses `gyp` for project generation, and `ninja` for building, project -configurations can be found in `.gyp` and `.gypi` files. +Electron은 프로젝트 생성을 위해 `gyp`를 사용하며 `ninja`를 이용하여 빌드합니다. +프로젝트 설정은 `.gyp` 와 `.gypi` 파일에서 볼 수 있습니다. -## Gyp 파일들 +## gyp 파일들 -Following `gyp` files contain the main rules of building Electron: +Electron을 빌드 할 때 `gyp` 파일들은 다음과 같은 규칙을 따릅니다: -* `atom.gyp` defines how Electron itself is built. -* `common.gypi` adjusts the build configurations of Node to make it build - together with Chromium. -* `vendor/brightray/brightray.gyp` defines how `brightray` is built, and - includes the default configurations of linking with Chromium. -* `vendor/brightray/brightray.gypi` includes general build configurations about - building. +* `atom.gyp`는 Electron의 빌드 과정 자체를 정의합니다. +* `common.gypi`는 Node가 Chromium과 함께 빌드될 수 있도록 조정한 빌드 설정입니다. +* `vendor/brightray/brightray.gyp`는 `brightray`의 빌드 과정을 정의하고 Chromium과의 링킹에 대한 기본적인 설정을 포함합니다. +* `vendor/brightray/brightray.gypi`는 빌드에 대한 일반적인 설정이 포함되어 있습니다. ## 구성요소 빌드 -Since Chromium is quite a large project, the final linking stage would take -quite a few minutes, making it hard for development. In order to solve this, -Chromium introduced the "component build", which builds each component as a -separate shared library, making linking very quick but sacrificing file size -and performance. +Chromium은 꽤나 큰 프로젝트입니다. 이 때문에 최종 링킹 작업은 상당한 시간이 소요될 수 있습니다. +이러한 문제로 인해 개발 시 빌드 작업을 까다롭게 만듭니다. 이 문제를 해결하기 위해 Chromium은 "component build"를 도입했습니다. +이는 각각의 컴포넌트를 각각 따로 분리하여 공유 라이브러리로 빌드 합니다. 이렇게 되면 링킹작업은 매우 빨라지지만 파일 크기와 성능이 느려집니다. -In Electron we took a very similar approach: for `Debug` builds, the binary -will be linked to shared library version of Chromium's components to achieve -fast linking time; for `Release` builds, the binary will be linked to the static -library versions, so we can have the best possible binary size and performance. +Electron도 상당히 비슷한 접근을 했습니다: +`Debug`빌드 시 바이너리는 공유 라이브러리 버전의 Chromium 컴포넌트를 사용해서 링크 속도를 높이고 +`Release`빌드 시엔 정적 라이브러리 버전의 컴포넌트를 사용합니다. +이렇게 각 빌드의 단점을 상호 보완하여 디버그 시 빌드 속도는 향상되고 배포판 빌드 시 공유 라이브러리의 단점은 제거했습니다. ## 부트스트랩 최소화 -All of Chromium's prebuilt binaries are downloaded when running the bootstrap -script. By default both static libraries and shared libraries will be -downloaded and the final size should be between 800MB and 2GB according to the -platform. +모든 사전 빌드 된 Chromium 바이너리들은 부트스트랩 스크립트가 실행될 때 다운로드됩니다. +기본적으로 공유 라이브러리와 정적 라이브러리 모두 다운로드되며 최종 전체 파일 크기는 플랫폼에 따라 800MB에서 2GB까지 차지합니다. -If you only want to build Electron quickly for testing or development, you -can only download the shared library versions by passing the `--dev` parameter: +만약 빠르게 Electron의 개발 또는 테스트만 하고 싶다면 `--dev` 플래그를 추가하여 공유 라이브러리만 다운로드할 수 있습니다: ```bash $ ./script/bootstrap.py --dev $ ./script/build.py -c D ``` -## Two-phrase 프로젝트 생성 +## 프로젝트 생성 (two-phrase) -Electron links with different sets of libraries in `Release` and `Debug` -builds, however `gyp` doesn't support configuring different link settings for -different configurations. +Electron은 `Release`와 `Debug` 빌드가 서로 다른 라이브러리 링크 방식을 사용합니다. +그러나 `gyp`는 따로 빌드 설정을 분리하여 라이브러리 링크 방식을 정의하는 것을 지원하지 않습니다. -To work around this Electron uses a `gyp` variable -`libchromiumcontent_component` to control which link settings to use, and only -generates one target when running `gyp`. +이러한 문제를 해결하기 위해 Electron은 링크 설정을 제어하는 `gyp` 변수 `libchromiumcontent_component`를 사용하고 `gyp`를 실행할 때 단 하나의 타겟만을 생성합니다. ## 타겟 이름 -Unlike most projects that use `Release` and `Debug` as target names, Electron -uses `R` and `D` instead. This is because `gyp` randomly crashes if there is -only one `Release` or `Debug` build configuration is defined, and Electron has -to only generate one target for one time as stated above. +많은 프로젝트에서 타겟 이름을 `Release` 와 `Debug`를 사용하는데 반해 Electron은 `R`과 `D`를 대신 사용합니다. +이유는 가끔 알 수 없는 이유(randomly)로 `Release` 와 `Debug` 중 하나만 빌드 설정에 정의되어 있을때 `gyp`가 크래시를 일으키는데 +전술한 바와 같이 Electron은 한번에 한개의 타겟만을 생성할 수 있기 때문입니다. -This only affects developers, if you are only building Electron for rebranding -you are not affected. +이 문제는 개발자에게만 영향을 미칩니다. 만약 단순히 Electron을 rebranding 하기 위해 빌드 한다면 이 문제에 신경 쓸 필요가 없습니다. diff --git a/docs/development/coding-style-ko.md b/docs/development/coding-style-ko.md index fc2d1f498dfa..92aa3b4ed173 100644 --- a/docs/development/coding-style-ko.md +++ b/docs/development/coding-style-ko.md @@ -8,15 +8,15 @@ C++과 Python스크립트는 Chromium의 [코딩 스타일](http://www.chromium. ## CoffeeScript -CoffeeScript의 경우 GitHub의 [스타일 가이드](https://github.com/styleguide/javascript)를 따릅니다, 동시에 다음 규칙도 따릅니다: +CoffeeScript의 경우 GitHub의 [스타일 가이드](https://github.com/styleguide/javascript)를 따릅니다. 동시에 다음 규칙도 따릅니다: -* Google의 코딩 스타일에도 맞추기 위해, 파일의 끝에는 **절대** 개행을 삽입해선 안됩니다. +* Google의 코딩 스타일에도 맞추기 위해 파일의 끝에는 **절대** 개행을 삽입해선 안됩니다. * 파일 이름의 공백은 `_`대신에 `-`을 사용하여야 합니다. 예를 들어 `file_name.coffee`를 -`file-name.coffee`로 고쳐야합니다, 왜냐하면 [github/atom](https://github.com/github/atom) 에서 사용되는 모듈의 이름은 -보통 `module-name`형식이기 때문입니다, 이 규칙은 '.coffee' 파일에만 적용됩니다. +`file-name.coffee`로 고쳐야합니다. 왜냐하면 [github/atom](https://github.com/github/atom) 에서 사용되는 모듈의 이름은 +보통 `module-name`형식이기 때문입니다. 이 규칙은 '.coffee' 파일에만 적용됩니다. ## API 이름 -새로운 API를 만들 땐, getter, setter스타일 대신 jQuery의 one-function스타일을 사용해야 합니다. 예를 들어, +새로운 API를 만들 땐 getter, setter스타일 대신 jQuery의 one-function스타일을 사용해야 합니다. 예를 들어 `.getText()`와 `.setText(text)`대신에 `.text([text])`형식으로 설계하면 됩니다. 포럼에 이 문제에 대한 [논의](https://github.com/atom/electron/issues/46)가 있습니다. diff --git a/docs/development/source-code-directory-structure-ko.md b/docs/development/source-code-directory-structure-ko.md index 8b768b115748..f0c9cde40780 100644 --- a/docs/development/source-code-directory-structure-ko.md +++ b/docs/development/source-code-directory-structure-ko.md @@ -39,8 +39,8 @@ Electron의 소스 코드는 몇 개의 파트로 분리되어 있습니다. 우 ## 그외 디렉터리 구조 * **script** - 개발목적으로 사용되는 빌드, 패키징, 테스트, 기타등을 실행하는 스크립트. -* **tools** - gyp 파일에서 사용되는 헬퍼 스크립트, `script`와는 다르게 유저로부터 직접 실행되지 않는 스크립트들을 이곳에 넣습니다. -* **vendor** - 소스코드의 서드파티 종속성 코드, 소스 코드 디렉터리가 겹쳐 혼란을 일으킬 수 있기 때문에, +* **tools** - gyp 파일에서 사용되는 헬퍼 스크립트 `script`와는 다르게 유저로부터 직접 실행되지 않는 스크립트들을 이곳에 넣습니다. +* **vendor** - 소스코드의 서드파티 종속성 코드 소스 코드 디렉터리가 겹쳐 혼란을 일으킬 수 있기 때문에 우리는 `third_party`와 같은 Chromium 소스 코드 디렉터리에서 사용된 폴더 이름을 사용하지 않았습니다. * **node_modules** - 빌드에 사용되는 node 서드파티 모듈. * **out** - `ninja`의 임시 출력 디렉터리. diff --git a/docs/tutorial/application-distribution-ko.md b/docs/tutorial/application-distribution-ko.md index 43d9ce7f695f..a1bb5bc65044 100644 --- a/docs/tutorial/application-distribution-ko.md +++ b/docs/tutorial/application-distribution-ko.md @@ -23,12 +23,12 @@ electron/resources/app └── index.html ``` -그리고 `Electron.app`을 실행하면 (Linux에선 `electron` Windows에선 `electron.exe`입니다), Electron은 해당 앱을 실행시킵니다. +그리고 `Electron.app`을 실행하면(Linux에선 `electron` Windows에선 `electron.exe`입니다) Electron은 해당 앱을 실행시킵니다. 최종 사용자에게는 이 `electron` 폴더(Electron.app)를 배포하면 됩니다. ## asar로 앱 패키징 하기 -소스파일 전체를 복사해서 배포하는 것과는 별개로, [asar](https://github.com/atom/asar) 아카이브를 통해 +소스파일 전체를 복사해서 배포하는 것과는 별개로 [asar](https://github.com/atom/asar) 아카이브를 통해 어플리케이션의 소스코드가 사용자에게 노출되는 것을 방지할 수 있습니다. `asar` 아카이브를 사용할 땐 단순히 `app` 폴더 대신에 어플리케이션을 패키징한 `app.asar` 파일로 대체하면됩니다. @@ -52,7 +52,7 @@ electron/resources/ ## 다운로드한 바이너리의 리소스를 앱에 맞게 수정하기 -어플리케이션을 Electron에 번들링한 후, 해당 어플리케이션에 맞게 리브랜딩 할 수 있습니다. +어플리케이션을 Electron에 번들링한 후 해당 어플리케이션에 맞게 리브랜딩 할 수 있습니다. ### Windows diff --git a/docs/tutorial/application-packaging-ko.md b/docs/tutorial/application-packaging-ko.md index 31314a1c9c0c..da72a9b2954a 100644 --- a/docs/tutorial/application-packaging-ko.md +++ b/docs/tutorial/application-packaging-ko.md @@ -1,6 +1,6 @@ # 어플리케이션 패키징 -어플리케이션의 리소스와 소스코드를 유저로부터 보호하기 위해, 약간의 구조 변경으로 어플리케이션을 [asar][asar] 아카이브로 패키징 할 수 있습니다. +어플리케이션의 리소스와 소스코드를 유저로부터 보호하기 위해 약간의 구조 변경으로 어플리케이션을 [asar][asar] 아카이브로 패키징 할 수 있습니다. ## `asar` 아카이브 생성 @@ -23,7 +23,7 @@ $ asar pack your-app app.asar ## `asar` 아카이브 사용하기 -Electron은 두가지의 API를 가지고 있습니다: Node.js로 부터 제공된 Node API, Chromium으로부터 제공된 Web API. +Electron은 Node.js로 부터 제공된 Node API와 Chromium으로부터 제공된 Web API 두가지의 API를 가지고 있습니다. 두 API 모두 `asar`에서 읽어들일 수 있도록 지원합니다. ### Node API @@ -31,7 +31,7 @@ Electron은 두가지의 API를 가지고 있습니다: Node.js로 부터 제공 `fs.readFile` 와 `require` 같은 Node API들을 지원하기 위해 Electron에선 `asar` 아카이브가 가상의 디렉터리 구조를 가지도록 패치했습니다. 그래서 아카이브 내부에서 리소스들을 정상적인 파일 시스템처럼 접근할 수 있습니다. -예를들어, `/path/to`라는 경로에 `example.asar`라는 아카이브가 있다고 가정하면: +예를들어 `/path/to`라는 경로에 `example.asar`라는 아카이브가 있다고 가정하면: ```bash $ asar list /path/to/example.asar @@ -73,10 +73,10 @@ win.loadUrl('file:///path/to/example.asar/static/index.html'); ### Web API -웹 페이지 내에선, 아카이브 내의 파일을 `file:` 프로토콜을 사용하여 요청할 수 있습니다. +웹 페이지 내에선 아카이브 내의 파일을 `file:` 프로토콜을 사용하여 요청할 수 있습니다. 이 또한 Node API와 같이 가상 디렉터리 구조를 가집니다. -예를들어, jQuery의 `$.get`을 사용하여 파일을 가져올 수 있습니다: +예를들어 jQuery의 `$.get`을 사용하여 파일을 가져올 수 있습니다: ```html