-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
The maintainers of this repository would appreciate it if you could provide more information. |
Codecov Report
@@ 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.
|
docs/source/en/tutorials/socketio.md
Outdated
## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的 NodeJs还是用Node.js 吧,和中文版保持一致
docs/source/en/tutorials/socketio.md
Outdated
|
||
* namespace: define the namespace by means of configuration | ||
- middleware: every socket connection to establish / disconnect, every message / data transfer pretreatment |
There was a problem hiding this comment.
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
docs/source/en/tutorials/socketio.md
Outdated
* 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conbothtroller -> controller
docs/source/en/tutorials/socketio.md
Outdated
- 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 |
There was a problem hiding this comment.
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
docs/source/en/tutorials/socketio.md
Outdated
``` | ||
|
||
** Open the plugin: ** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open -> enable
docs/source/en/tutorials/socketio.md
Outdated
#### 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一整句和中文意思好像不是很贴合
docs/source/en/tutorials/socketio.md
Outdated
return async (ctx, next) => { | ||
if (true) { | ||
ctx.socket.disconnet(); |
There was a problem hiding this comment.
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() 中文文档的这个单词也错了,可以一并处理一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还没有修改
docs/source/en/tutorials/socketio.md
Outdated
#### Packet | ||
|
||
Packets can be used to preprocess the message or to decrypt an encrypted message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“在生产环境中,通常用于对消息做预处理” 这一句是不是漏了
docs/source/en/tutorials/socketio.md
Outdated
### Controller | ||
|
||
A controller deals with the events sent by the client. Since it inherits the `egg.Contoller`, it has the following member objects: |
There was a problem hiding this comment.
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); | ||
}; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文中后面还有好多内容,好像没有翻译完?
There was a problem hiding this comment.
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 😄
docs/source/en/tutorials/socketio.md
Outdated
``` | ||
|
||
** Enabling the plugin: ** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling->Enable
docs/source/en/tutorials/socketio.md
Outdated
- `disconnecting` doing the disconnect | ||
- `disconnect` connection has disconnected. | ||
- `error` Error occured |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
occured->occurred, 中文的好像也错了,一并改一下~
docs/source/en/tutorials/socketio.md
Outdated
#### 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. |
There was a problem hiding this comment.
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
docs/source/en/tutorials/socketio.md
Outdated
Ctx.app.io.of('/').to(room).emit('online', { msg: 'welcome', id: ctx.socket.id }); | ||
Await next(); | ||
Console.log('disconnection!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几行的代码首字母为啥要大写?
docs/source/en/tutorials/socketio.md
Outdated
## Examples | ||
|
||
Here we use [egg-socket.io] to do a small example of supporting p2p chat |
There was a problem hiding this comment.
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
docs/source/en/tutorials/socketio.md
Outdated
Window.socket = socket; | ||
}; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的代码片段首字母都大写了?
docs/source/en/tutorials/socketio.md
Outdated
Console.log('res from server: %s!', msg); | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
docs/source/en/tutorials/socketio.md
Outdated
}, | ||
}; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
docs/source/en/tutorials/socketio.md
Outdated
|
||
P2P communication, data exchange through exchange | ||
|
There was a problem hiding this comment.
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
docs/source/en/tutorials/socketio.md
Outdated
[socket.io]: https://socket.io | ||
[egg-socket.io]: https://github.com/eggjs/egg-socket.io | ||
[uws]: https://github.com/uWebSockets/uWebSockets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码片段首字母大写,可以注意一下~
There was a problem hiding this comment.
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
@atian25 可以合并了~ |
docs: EN translation for socketio tutorial doc (#2167)
This PR is intended to provide an translation for
/tutorials/socketio.md
missing in #363