Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: translation for basic plugin #2166

Merged
merged 3 commits into from
Mar 19, 2018
Merged

Conversation

cemremengu
Copy link
Contributor

@cemremengu cemremengu commented Mar 5, 2018

This PR is intended to provide an translation for /basics/plugin.md missing in #363

I am not sure about the part

** Note: **

* `plugin.default.js` does not exists. Use `local` for dev environments.

* Use this feature only in the application layer. Do not use it in the framework layer.

@codecov
Copy link

codecov bot commented Mar 5, 2018

Codecov Report

Merging #2166 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2166   +/-   ##
=======================================
  Coverage   99.59%   99.59%           
=======================================
  Files          29       29           
  Lines         749      749           
=======================================
  Hits          746      746           
  Misses          3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9005c86...0eba90a. Read the comment docs.

@atian25 atian25 requested a review from SunShinewyf March 6, 2018 12:14
* What are the differences/relationship between middleware and plugins?
* How do I use a plugin?
* How do I write a plug-in?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plug-in ->plugin

To sum up, we need a more powerful mechanism to manage, orchestrate those relatively independent business logic.

### The relationship between middleware and plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中文是:"中间件、插件、应用的关系", 漏了一个 ”应用“


* `{Boolean} enable` - Whether to enable this plugin, the default is true
* `{String} package` -`npm` module name, plugin via `npm` module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后半句不通顺,改为 plugin is imported via npm module

### Enabling/Disabling plugins

Built in the upper framework of the plugin, the application does not need to use the package or path configuration, you only need to specify enable or not:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句话逻辑有点不正确,改为:the application does not need to use the package or path configuration when use the plugin built in the upper framework


```js
// For the built-in plug-in, you can use the following simple way to turn on or off
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plug-in -> plugin

```

This way, `npm i --production` in the production environment does not need to download the`egg-dev` package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way -> in the way

### Package name and path

* The `package` is introduced in the `npm` require style which is the most common way to import
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the npm require style 改为 in the npm way ,require 感觉冗余

## Plugin list

* Framework default built-in enterprise applications [Common plug-in](https://eggjs.org/zh-cn/plugins/):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

built-in 是个形容词,在这里应该为动词才对 builds in

@cemremengu
Copy link
Contributor Author

Ping @SunShinewyf

### Enabling/Disabling plugins

The application does not need the package or path configuration when using the plugins built in the framework. You only need to specify whether they are enabled or not:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the framework -> the upper framework

@SunShinewyf
Copy link
Contributor

把这个改了就可以合并了哈~

@cemremengu
Copy link
Contributor Author

@SunShinewyf done

@SunShinewyf
Copy link
Contributor

@atian25

@atian25 atian25 changed the title Added doc for basic plugin docs: translation for basic plugin Mar 18, 2018
@fengmk2 fengmk2 merged commit d5f9059 into eggjs:master Mar 19, 2018
popomore pushed a commit that referenced this pull request Mar 19, 2018
docs: translation for basic plugin (#2166)
@cemremengu cemremengu deleted the doc-basics-plugin branch March 19, 2018 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants