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: EN translation for socketio tutorial doc #2167

Merged
merged 5 commits into from
Mar 26, 2018

Conversation

cemremengu
Copy link
Contributor

@cemremengu cemremengu commented Mar 5, 2018

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

@request-info
Copy link

request-info bot commented Mar 5, 2018

The maintainers of this repository would appreciate it if you could provide more information.

@codecov
Copy link

codecov bot commented Mar 5, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2167   +/-   ##
=======================================
  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 5b059db...3ab3420. Read the comment docs.

@atian25 atian25 requested a review from SunShinewyf March 6, 2018 12:14
## title: Socket.IO

** Socket.IO ** is a real-time application framework based on NodeJS, which has a wide range of applications including instant messaging, notification and message push, real-time analysis and other scenarios.
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的 NodeJs还是用Node.js 吧,和中文版保持一致


* namespace: define the namespace by means of configuration
 - middleware: every socket connection to establish / disconnect, every message / data transfer pretreatment
Copy link
Contributor

Choose a reason for hiding this comment

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

这一句感觉不太顺,下面的表达方式觉得怎样:
establish / disconnect every socket connection, preprocess every message / data transfer

* namespace: define the namespace by means of configuration
 - middleware: every socket connection to establish / disconnect, every message / data transfer pretreatment
 - conbothtroller: response socket.io event
Copy link
Contributor

Choose a reason for hiding this comment

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

conbothtroller -> controller

 - middleware: every socket connection to establish / disconnect, every message / data transfer pretreatment
 - conbothtroller: response socket.io event
 - router: unified socket.io event and frame routing configuration processing
Copy link
Contributor

Choose a reason for hiding this comment

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

configuration processing -> processign configuration 会好一点
建议整句的句型改成下面: unified the processing configuration of socket.io event and frame routing

```

** Open the plugin: **
Copy link
Contributor

Choose a reason for hiding this comment

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

open -> enable

#### Connection

Once a client is connected, you can execute the desired logic. Authentication/Authorization is usually performed in this step to decide which action to take.
Copy link
Contributor

Choose a reason for hiding this comment

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

这一整句和中文意思好像不是很贴合

return async (ctx, next) => {
if (true) {
ctx.socket.disconnet();
Copy link
Contributor

Choose a reason for hiding this comment

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

ctx.socket.disconnet() -> ctx.socket.disconnect() 中文文档的这个单词也错了,可以一并处理一下

Copy link

Choose a reason for hiding this comment

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

这个还没有修改

#### Packet

Packets can be used to preprocess the message or to decrypt an encrypted message.
Copy link
Contributor

Choose a reason for hiding this comment

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

“在生产环境中,通常用于对消息做预处理” 这一句是不是漏了

### Controller

A controller deals with the events sent by the client. Since it inherits the `egg.Contoller`, it has the following member objects:
Copy link
Contributor

Choose a reason for hiding this comment

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

egg.contoller -> egg.controller 中文文档也错了,一并处理一下

io.of('/').route('server', io.controller.home.server);
};
```
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 Author

@cemremengu cemremengu Mar 15, 2018

Choose a reason for hiding this comment

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

Sorry about this, google translate truncated the text. Added the rest now.

xie xie for your time 😄

@cemremengu
Copy link
Contributor Author

@SunShinewyf 👀

@cemremengu cemremengu changed the title Updated socketio tutorial doc EN translation for socketio tutorial doc Mar 19, 2018
```

** Enabling the plugin: **
Copy link
Contributor

Choose a reason for hiding this comment

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

Enabling->Enable

- `disconnecting` doing the disconnect
- `disconnect` connection has disconnected.
- `error` Error occured
Copy link
Contributor

Choose a reason for hiding this comment

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

occured->occurred, 中文的好像也错了,一并改一下~

#### Namespace (nsp)

The namespace is usually meant to be assigned to different access points or paths. If the client does not specify an nsp, it is assigned to the default namespace "/" by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • an nsp->a nsp
  • the default namespace 和后面的by default有点重复,建议: it is assigned to "/" by default

     Ctx.app.io.of('/').to(room).emit('online', { msg: 'welcome', id: ctx.socket.id });
     Await next();
     Console.log('disconnection!');
Copy link
Contributor

Choose a reason for hiding this comment

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

这几行的代码首字母为啥要大写?

## Examples

Here we use [egg-socket.io] to do a small example of supporting p2p chat
Copy link
Contributor

Choose a reason for hiding this comment

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

of supporting p2p chat 建议改为:which supports p2p chat

   Window.socket = socket;
};
```
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的代码片段首字母都大写了?

   Console.log('res from server: %s!', msg);
});
```
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.

同上


P2P communication, data exchange through exchange

Copy link
Contributor

Choose a reason for hiding this comment

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

这句话感觉和中文不太相符
data exchange of P2P communication is through exchange

[socket.io]: https://socket.io
[egg-socket.io]: https://github.com/eggjs/egg-socket.io
[uws]: https://github.com/uWebSockets/uWebSockets
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 Author

Choose a reason for hiding this comment

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

Didn't understand what you mean here

@SunShinewyf
Copy link
Contributor

@atian25 可以合并了~

@atian25 atian25 changed the title EN translation for socketio tutorial doc docs: EN translation for socketio tutorial doc Mar 26, 2018
@atian25 atian25 merged commit 10327e1 into eggjs:master Mar 26, 2018
@cemremengu cemremengu deleted the socketio-doc branch March 26, 2018 02:46
popomore pushed a commit that referenced this pull request Mar 26, 2018
docs: EN translation for socketio tutorial doc (#2167)
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.

5 participants