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

EN translation for view plugin dev doc #2240

Merged
merged 6 commits into from
Mar 31, 2018

Conversation

cemremengu
Copy link
Contributor

@cemremengu cemremengu commented Mar 19, 2018

Added en translation for view plugin dev doc #363

@cemremengu cemremengu changed the title Added en translation for view plugin dev doc EN translation for view plugin dev doc Mar 19, 2018
@codecov
Copy link

codecov bot commented Mar 19, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2240   +/-   ##
=======================================
  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 348ff18...54eec15. Read the comment docs.


In most cases, we need to read the data, render the template and then present it to the user. The framework does not force the use of some template engine. The developer selects the [template](../core/view.md). For details, see [Template Rendering](../core/view.md).

Copy link
Contributor

Choose a reason for hiding this comment

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

  • some template engine -> one template engine(某种)
  • The developer selects the template -> the developer can select the template by theirselves (ps:这一句和前一句不应该隔开,前后两句为完整的一句)


```bash
Egg-view-ejs
Copy link
Contributor

Choose a reason for hiding this comment

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

首字母和中文保持一致?


* Follow the [plugin development specification](./plugin.md)
* According to convention, plugin names start with `egg-view-`
Copy link
Contributor

Choose a reason for hiding this comment

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

plugin names start with -> the name of plugin starts with

* Follow the [plugin development specification](./plugin.md)
* According to convention, plugin names start with `egg-view-`
* `package.json` is configured as follows. Plugin names are named after the template engine, such as ejs
Copy link
Contributor

Choose a reason for hiding this comment

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

plugin names -> the names of plugin


`json { "name": "egg-view-ejs", "eggPlugin": { "name": "ejs" }, "keywords": [ "egg", "egg-plugin", "egg-view", "ejs" ], }`

Copy link
Contributor

Choose a reason for hiding this comment

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

这个代码格式乱掉了

};
```

Copy link
Contributor

Choose a reason for hiding this comment

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

代码首字母大写了


* filename: is the path to the complete file. The framework determines if the file exists when it looks for the file. It does not need to be processed here.
* locals: The data needed for rendering. The data comes from `app.locals`, `ctx.locals` and calls `render` methods. The framework also has built-in `ctx`, `request`, `ctx.helper` objects.
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 是 形容词,改成 built in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

* locals: The data needed for rendering. The data comes from `app.locals`, `ctx.locals` and calls `render` methods. The framework also has built-in `ctx`, `request`, `ctx.helper` objects.
* viewOptions: The incoming configuration of the user, which overrides the default configuration of the template engine. This can be considered based on the characteristics of the template engine. For example, the cache is enabled by default, and a page does not need to be cached.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • which overrides -> which can override
  • and a page-> but a page(为转折关系)

The framework provides `ctx.helper` for developer use, but in some cases we want to override the helper method and only take effect when the template is rendered.

In template rendering, we often need to output a user-supplied html fragment, usually using the `helper.shtml` provided by the `egg-security` plugin.
Copy link
Contributor

Choose a reason for hiding this comment

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

感觉句子不太顺,建议:
In template rendering, we often need to output a user-supplied html fragment, in which case, we usually use the helper.shtml provided by the egg-security plugin

[egg-security]: https://github.com/eggjs/egg-security
[egg-view-nunjucks]: https://github.com/eggjs/egg-view-nunjucks
[egg-view-ejs]: https://github.com/eggjs/egg-view-ejs
Copy link
Contributor

Choose a reason for hiding this comment

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

部分代码片段首字母大写了

@@ -23,49 +23,61 @@ Egg-view-ejs
## Plugin naming convention

* Follow the [plugin development specification](./plugin.md)
* According to convention, plugin names start with `egg-view-`
* `package.json` is configured as follows. Plugin names are named after the template engine, such as ejs
* According to the convention, the name of the plugins start with `egg-view-`
Copy link
Contributor

Choose a reason for hiding this comment

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

the name of plugins start with -> the names of plugins start with

@@ -75,7 +87,7 @@ The three parameters of the `render` method are

* filename: is the path to the complete file. The framework determines if the file exists when it looks for the file. It does not need to be processed here.
* locals: The data needed for rendering. The data comes from `app.locals`, `ctx.locals` and calls `render` methods. The framework also has built-in `ctx`, `request`, `ctx.helper` objects.
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 是形容词,这里的语义是“内置了” 为动词,故需要分开写

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't agree. You might be confused by thinking in Chinese. 😄 but I will do as you say since you have the authority here.

See this for example: https://www.treehugger.com/bikes/cyclevision-bike-helmet-has-built-cameras-front-and-rear.html

@SunShinewyf
Copy link
Contributor

done~ @atian25

@popomore popomore merged commit e4531e5 into eggjs:master Mar 31, 2018
popomore pushed a commit that referenced this pull request Mar 31, 2018
docs: EN translation for view plugin dev doc (#2240)
@cemremengu cemremengu deleted the view-dev-en-doc branch March 31, 2018 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants