-
Notifications
You must be signed in to change notification settings - Fork 4
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
translation: declaration-files/By Example.md #46
Conversation
e3d7f90
to
0f6d492
Compare
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.
请在中英文之间添加空格
|
||
_Documentation_ | ||
_文档_ |
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.
Please use *
rather than _
for italic styling
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.
I don't see this one and all the similar ones convention in https://github.com/ts-zh-docs/TypeScript-Website/blob/v2/docs/translation-guide.md, could you point the related rule?
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.
mdn/translated-content#17745 (comment)
The link referenced by @yin1999 is a dead link now. The main point of that is that _
cannot make Chinese words italic, it can only make English words italic @Jeffzholy
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.
The original changes are correct for the italics
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.
|
||
_Code_ | ||
_代码_ |
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.
_代码_ | |
*代码* |
@@ -27,9 +24,9 @@ console.log("The computed greeting is:" + result); | |||
let count = myLib.numberOfGreetings; | |||
``` | |||
|
|||
_Declaration_ | |||
_声明_ |
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.
_声明_ | |
*声明* |
|
||
_Documentation_ | ||
_文档_ |
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.
_文档_ | |
*文档* |
|
||
```ts | ||
let x: Widget = getWidget(43); | ||
|
||
let arr: Widget[] = getWidget("all of them"); | ||
``` | ||
|
||
_Declaration_ | ||
_声明_ |
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.
_声明_ | |
*声明* |
|
||
_Documentation_ | ||
_文档_ |
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.
_文档_ | |
*文档* |
|
||
> When specifying a greeting, you must pass a `GreetingSettings` object. | ||
> This object has the following properties: | ||
> 指定问候语时,你必须传递一个`GreetingSettings`对象。 |
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.
> 指定问候语时,你必须传递一个`GreetingSettings`对象。 | |
> 指定问候语时,你必须传递 `GreetingSettings` 对象。 |
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 should be a space between Chinese word and English word
}); | ||
``` | ||
|
||
_Declaration_ | ||
_声明_ |
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.
_声明_ | |
*声明* |
|
||
_Documentation_ | ||
_文档_ |
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.
_文档_ | |
*文档* |
|
||
> Anywhere a greeting is expected, you can provide a `string`, a function returning a `string`, or a `Greeter` instance. | ||
> 任何需要问候语的地方,你都可以提供一个`string`,一个返回`string`的函数,或一个`Greeter`实例。 |
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.
> 任何需要问候语的地方,你都可以提供一个`string`,一个返回`string`的函数,或一个`Greeter`实例。 | |
> 任何需要问候语的地方,你都可以提供 `string`,返回 `string` 的函数,或 `Greeter` 实例。 |
@@ -114,34 +111,34 @@ greet(getGreeting); | |||
greet(new MyGreeter()); | |||
``` | |||
|
|||
_Declaration_ | |||
_声明_ |
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.
_声明_ | |
*声明* |
|
||
_Documentation_ | ||
_文档_ |
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.
_文档_ | |
*文档* |
@@ -231,21 +228,20 @@ declare var foo: number; | |||
|
|||
## Global Functions | |||
|
|||
_Documentation_ | |||
_文档_ |
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.
_文档_ | |
*文档* |
|
||
> You can call the function `greet` with a string to show a greeting to the user. | ||
> 你可以用一个字符串调用函数`greet`来向用户显示问候语。 |
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.
> 你可以用一个字符串调用函数`greet`来向用户显示问候语。 | |
> 你可以将字符串传给函数 `greet` 来向用户显示问候语。 |
|
||
_Code_ | ||
_代码_ |
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.
_代码_ | |
*代码* |
|
||
```ts | ||
greet("hello, world"); | ||
``` | ||
|
||
_Declaration_ | ||
_声明_ |
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.
_声明_ | |
*声明* |
|
||
Use `declare function` to declare functions. | ||
使用`declare function`来声明函数。 |
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.
使用`declare function`来声明函数。 | |
使用 `declare function` 来声明函数。 |
|
||
> The global variable `myLib` has a function `makeGreeting` for creating greetings, | ||
> and a property `numberOfGreetings` indicating the number of greetings made so far. | ||
> 全局变量`myLib`有一个用于创建问候语的函数`makeGreeting`,以及一个表示到目前为止已经制造的问候语数量的属性`numberOfGreetings`。 |
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.
> 全局变量`myLib`有一个用于创建问候语的函数`makeGreeting`,以及一个表示到目前为止已经制造的问候语数量的属性`numberOfGreetings`。 | |
> 全局变量 `myLib` 有一个用于创建问候语的函数 `makeGreeting`,以及表示到目前为止已经创建的问候语数量的属性 `numberOfGreetings`。 |
Thank you @Jeffzholy |
No description provided.