Skip to content

Commit

Permalink
feat(docs): initial semi-automated Chinese translation (#942)
Browse files Browse the repository at this point in the history
Co-authored-by: Novus Nota <[email protected]>
  • Loading branch information
sansx and novusnota authored Oct 30, 2024
1 parent a2a011f commit d50e24c
Show file tree
Hide file tree
Showing 78 changed files with 11,199 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ability to specify a compile-time method ID expression for getters: PR [#922](https://github.com/tact-lang/tact/pull/922) and PR [#932](https://github.com/tact-lang/tact/pull/932)
- Destructuring of structs and messages: PR [#856](https://github.com/tact-lang/tact/pull/856)
- Docs: automatic links to Web IDE from all code blocks: PR [#994](https://github.com/tact-lang/tact/pull/994)
- Docs: initial semi-automated Chinese translation of the documentation: PR [#942](https://github.com/tact-lang/tact/pull/942)

### Changed

Expand Down
8 changes: 8 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
project_id: "723773"
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: 1
files:
- source: /docs/src/content/docs/**/*
translation: /docs/src/content/docs/%two_letters_code%/**/%original_file_name%
ignore:
- /docs/src/content/docs/%two_letters_code%
4 changes: 2 additions & 2 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ template: splash
hero:
tagline: Tact is a new programming language for TON Blockchain that is focused on efficiency and simplicity. It is designed to be easy to learn and use, and to be a good fit for smart contracts. Tact is a statically typed language with a simple syntax and a powerful type system.
image:
dark: ../../../public/logomark-dark.svg
light: ../../../public/logomark-light.svg
dark: /public/logomark-dark.svg
light: /public/logomark-light.svg
alt: Tact logo
actions:
- text: 📚 Book
Expand Down
37 changes: 37 additions & 0 deletions docs/src/content/docs/zh-cn/book/bounced.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: 退信
---

当一个合约发送的信息的反弹标志设置为 true 时,如果信息没有被正确处理,它就会反弹回发送者。当你想确认信息是否被正确处理,如果没有,就可以恢复更改,这个功能非常有用。

## 注意事项

目前,在 TON 中,被退回的报文只有 224 个可用数据位,没有引用。 这意味着您无法从被退回的邮件中恢复大部分数据。 这是 TON 区块链的局限性,将来会得到修复。 Tact helps you to check if your message fits the limit and if not - it will suggest to use a special type modifier `bounced<T>` for the receiver that would construct a partial representation that fits into the required limits.

## 退信接收器

:::caution

目前暂不支持文本消息回退

:::

要接收退回的信息,您需要在合同或特性中定义一个 “退回 ”接收器:

```tact {2-4}
contract MyContract {
bounced(src: bounced<MyMessage>) {
// ...
}
}
```

要手动处理被退回的信息,您可以使用回退定义,直接处理原始的 [`Slice{:tact}`](/book/cells#slices)。请注意,这样的接收器将获得由您的合约产生的**所有**被退回的信息:

```tact /rawMsg: Slice/
contract MyContract {
bounced(src: Slice) {
// ...
}
}
```
444 changes: 444 additions & 0 deletions docs/src/content/docs/zh-cn/book/cells.mdx

Large diffs are not rendered by default.

Loading

0 comments on commit d50e24c

Please sign in to comment.