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

translation: declaration-files/By Example.md #46

Merged
merged 3 commits into from
Feb 5, 2024
Merged

Conversation

Jeffzholy
Copy link
Member

No description provided.

Copy link
Member

@awxiaoxian2020 awxiaoxian2020 left a comment

Choose a reason for hiding this comment

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

请在中英文之间添加空格


_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

@hanyujie2002 hanyujie2002 Feb 3, 2024

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

Copy link

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

Copy link
Member

Choose a reason for hiding this comment

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

docs/documentation/zh/declaration-files/By Example.md Outdated Show resolved Hide resolved

_Code_
_代码_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_代码_
*代码*

@@ -27,9 +24,9 @@ console.log("The computed greeting is:" + result);
let count = myLib.numberOfGreetings;
```

_Declaration_
_声明_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_声明_
*声明*


_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*


```ts
let x: Widget = getWidget(43);

let arr: Widget[] = getWidget("all of them");
```

_Declaration_
_声明_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_声明_
*声明*


_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*

docs/documentation/zh/declaration-files/By Example.md Outdated Show resolved Hide resolved

> When specifying a greeting, you must pass a `GreetingSettings` object.
> This object has the following properties:
> 指定问候语时,你必须传递一个`GreetingSettings`对象。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 指定问候语时,你必须传递一个`GreetingSettings`对象。
> 指定问候语时,你必须传递 `GreetingSettings` 对象。

Copy link
Member

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_
_声明_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_声明_
*声明*


_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*


> Anywhere a greeting is expected, you can provide a `string`, a function returning a `string`, or a `Greeter` instance.
> 任何需要问候语的地方,你都可以提供一个`string`,一个返回`string`的函数,或一个`Greeter`实例。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 任何需要问候语的地方,你都可以提供一个`string`一个返回`string`的函数,或一个`Greeter`实例。
> 任何需要问候语的地方,你都可以提供 `string`返回 `string` 的函数,`Greeter` 实例。

@@ -114,34 +111,34 @@ greet(getGreeting);
greet(new MyGreeter());
```

_Declaration_
_声明_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_声明_
*声明*

docs/documentation/zh/declaration-files/By Example.md Outdated Show resolved Hide resolved

_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*

@@ -231,21 +228,20 @@ declare var foo: number;

## Global Functions

_Documentation_
_文档_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_文档_
*文档*


> You can call the function `greet` with a string to show a greeting to the user.
> 你可以用一个字符串调用函数`greet`来向用户显示问候语。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 你可以用一个字符串调用函数`greet`来向用户显示问候语。
> 你可以将字符串传给函数 `greet` 来向用户显示问候语。


_Code_
_代码_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_代码_
*代码*


```ts
greet("hello, world");
```

_Declaration_
_声明_
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_声明_
*声明*


Use `declare function` to declare functions.
使用`declare function`来声明函数。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
使用`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`。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> 全局变量`myLib`有一个用于创建问候语的函数`makeGreeting`以及一个表示到目前为止已经制造的问候语数量的属性`numberOfGreetings`
> 全局变量 `myLib` 有一个用于创建问候语的函数 `makeGreeting`以及表示到目前为止已经创建的问候语数量的属性 `numberOfGreetings`

@hanyujie2002
Copy link
Member

@Jeffzholy Jeffzholy changed the title translation: declaration-files/introduction.md translation: declaration-files/By Example.md Feb 1, 2024
@hanyujie2002
Copy link
Member

Thank you @Jeffzholy

@hanyujie2002 hanyujie2002 merged commit 07eba65 into main Feb 5, 2024
2 checks passed
@hanyujie2002 hanyujie2002 deleted the zhen-translation branch February 5, 2024 06:51
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.

4 participants