Skip to content

Commit 7bd6cd2

Browse files
committed
restore wrongly overridden translation
1 parent d2ee0c0 commit 7bd6cd2

File tree

17 files changed

+59
-66
lines changed

17 files changed

+59
-66
lines changed

website/i18n/ja/docusaurus-plugin-content-docs/version-0.21/advanced-topics/optimizations.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
title: 'Optimizations & Best Practices'
2+
title: '最適化とベストプラクティス'
33
sidebar_label: Optimizations
44
description: 'Make your app faster'
55
---
66

7-
## Using smart pointers effectively
7+
## 効果的にスマートポインタを使う
88

9-
**Note: if you're unsure about some of the terms used in this section, the Rust Book has a useful
10-
[chapter about smart pointers](https://doc.rust-lang.org/book/ch15-00-smart-pointers.html).**
9+
**注意: このセクションで使われている用語がわからなければ Rust book は
10+
[スマートポインタについての章](https://doc.rust-lang.org/book/ch15-00-smart-pointers.html)
11+
があり、非常に有用です。**
1112

1213
To avoid cloning large amounts of data to create props when re-rendering, we can use
1314
smart pointers to only clone a reference to the data instead of the data itself. If you pass

website/i18n/ja/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/lifecycle.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 'Lifecycle'
3-
description: 'Components and their lifecycle hooks'
2+
title: 'ライフサイクル'
3+
description: 'コンポーネントとそのライフサイクルフック'
44
---
55

66
The `Component` trait has a number of methods which need to be implemented; Yew will call these at different

website/i18n/ja/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/properties.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ title: 'Properties'
33
description: 'Parent to child communication'
44
---
55

6-
Properties enable child and parent components to communicate with each other.
6+
プロパティは、子コンポーネントと親コンポーネントが互いに通信できるようにします。
77
Every component has an associated properties type which describes what is passed down from the parent.
88
In theory, this can be any type that implements the `Properties` trait, but in practice, there is no
99
reason for it to be anything but a struct where each field represents a property.
1010

11-
## Derive macro
11+
## マクロの継承
1212

13-
Instead of implementing the `Properties` trait yourself, you should use `#[derive(Properties)]` to
14-
automatically generate the implementation instead.
13+
`Properties`を自分で実装しようとせず、代わりに`#[derive(Properties)]`を使ってください。
1514
Types for which you derive `Properties` must also implement `PartialEq`.
1615

1716
### Field attributes

website/i18n/ja/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/refs.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
title: 'Refs'
3-
description: 'Out-of-band DOM access'
2+
title: Refs
3+
description: Out-of-band DOM access
44
---
55

6-
The `ref` keyword can be used inside of any HTML element or component to get the DOM `Element` that
7-
the item is attached to. This can be used to make changes to the DOM outside of the `view` lifecycle
8-
method.
6+
`ref`は、任意の HTML 要素やコンポーネントの内部で、割り当てられている DOM`Element`を取得するために使用することができます。
7+
これは、`view` ライフサイクルメソッドの外で DOM に変更を加えるために使用できます。
98

10-
This is useful for getting ahold of canvas elements, or scrolling to different sections of a page.
9+
これは、キャンバスの要素を取得したり、ページの異なるセクションにスクロールしたりするのに便利です。
1110
For example, using a `NodeRef` in a component's `rendered` method allows you to make draw calls to
1211
a canvas element after it has been rendered from `view`.
1312

14-
The syntax is:
13+
構文は以下の通りです:
1514

1615
```rust
1716
use web_sys::Element;

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/how-it-works.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: 'How it works'
3-
description: 'Low level details about the framework'
3+
description: '有关框架的底层细节'
44
---
55

6-
# Low-level library internals
6+
# 底层库的内部细节
77

88
## Under the hood of the `html!` macro
99

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/optimizations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: 'Optimizations & Best Practices'
2+
title: '性能优化与最佳实践'
33
sidebar_label: Optimizations
4-
description: 'Make your app faster'
4+
description: 加速你的应用程序
55
---
66

77
## Using smart pointers effectively

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/callbacks.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: 'Callbacks'
2+
title: '回调(Callbacks)'
3+
description: 'ComponentLink 和 Callbacks'
34
---
45

56
## Callbacks
67

7-
Callbacks are used to communicate with services, agents, and parent components within Yew.
8-
Internally their type is just `Fn` wrapped in `Rc` to allow them to be cloned.
8+
Callbacks 用于与 Yew 中的 services,agents 和父组件进行通信。它们仅仅是个 `Fn`,并由 `Rc` 包裹以允许被克隆。
99

10-
They have an `emit` function that takes their `<IN>` type as an argument and converts that to a message expected by its destination. If a callback from a parent is provided in props to a child component, the child can call `emit` on the callback in its `update` lifecycle hook to send a message back to its parent. Closures or Functions provided as props inside the `html!` macro are automatically converted to Callbacks.
10+
它们有一个 `emit` 函数,该函数将它的 `<IN>` 类型作为参数并将其转换为目标所期望的消息。如果一个回调从父组件中通过 props 提供给子组件,则子组件可以在其 `update` 生命周期钩子中对该回调调用 `emit`,以将消息发送回父组件。在 `html!` 宏内被提供作为 props 的闭包或函数会自动转换为 Callbacks
1111

1212
A simple use of a callback might look something like this:
1313

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/lifecycle.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
2-
title: 'Lifecycle'
3-
description: 'Components and their lifecycle hooks'
2+
title: '生命周期'
3+
description: '组件及其生命周期钩子'
44
---
55

6-
The `Component` trait has a number of methods which need to be implemented; Yew will call these at different
7-
stages in the lifecycle of a component.
6+
`Component` trait 有许多需要实现的方法;Yew 会在组件生命周期的不同阶段调用这些方法。
87

9-
## Lifecycle
8+
## 生命周期
109

1110
:::important contribute
1211
`Contribute to our docs:` [Add a diagram of the component lifecycle](https://github.com/yewstack/yew/issues/1915)
1312
:::
1413

15-
## Lifecycle Methods
14+
## 生命周期方法
1615

1716
### Create
1817

19-
When a component is created, it receives properties from its parent component and is stored within
20-
the `Context<Self>` that is passed down to the `create` method. The properties can be used to
21-
initialize the component's state and the "link" can be used to register callbacks or send messages to the component.
18+
当一个组件被创建时,它会从其父组件接收属性(properties)并存储在传递给 `create` 方法的 `Context<Self>` 中。
19+
属性(properties)可用于初始化组件的状态,"link"可用于注册回调或向组件发送消息。
2220

2321
```rust
2422
use yew::{Component, Context, html, Html, Properties};

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/properties.mdx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
2-
title: 'Properties'
3-
description: 'Parent to child communication'
2+
title: '属性(Properties'
3+
description: '父组件到子组件的通信'
44
---
55

6-
Properties enable child and parent components to communicate with each other.
7-
Every component has an associated properties type which describes what is passed down from the parent.
8-
In theory, this can be any type that implements the `Properties` trait, but in practice, there is no
9-
reason for it to be anything but a struct where each field represents a property.
6+
Properties 用于父级到子组件的通信。
7+
每个组件都有一个关联的属性类型,描述了从父级传递下来的内容。
8+
理论上,这可以是任何实现了 `Properties` trait 的类型,但实际上,
9+
没有理由不使用一个结构体,其中每个字段都代表一个属性。
1010

11-
## Derive macro
11+
## 派生宏
1212

13-
Instead of implementing the `Properties` trait yourself, you should use `#[derive(Properties)]` to
14-
automatically generate the implementation instead.
15-
Types for which you derive `Properties` must also implement `PartialEq`.
13+
不要尝试自己去实现 `Properties`,而是通过使用 `#[derive(Properties)]` 来派生它。
14+
派生 `Properties` 的类型还必须实现 `PartialEq`
1615

1716
### Field attributes
1817

website/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.21/advanced-topics/struct-components/refs.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
---
2-
title: 'Refs'
3-
description: 'Out-of-band DOM access'
2+
title: Refs
3+
description: 超出界限的 DOM 访问
44
---
55

6-
The `ref` keyword can be used inside of any HTML element or component to get the DOM `Element` that
7-
the item is attached to. This can be used to make changes to the DOM outside of the `view` lifecycle
8-
method.
6+
`ref` 关键词可被用在任何 HTML 元素或组件内部以获得该项所附加到的 DOM 元素。这可被用于在 `view` 生命周期方法之外来对 DOM 进行更改。
97

10-
This is useful for getting ahold of canvas elements, or scrolling to different sections of a page.
8+
这对于获取 canvas 元素或者滚动到页面的不同部分是有用的。
119
For example, using a `NodeRef` in a component's `rendered` method allows you to make draw calls to
1210
a canvas element after it has been rendered from `view`.
1311

14-
The syntax is:
12+
语法如下:
1513

1614
```rust
1715
use web_sys::Element;

0 commit comments

Comments
 (0)