Skip to content

Commit

Permalink
cn
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Oct 3, 2020
1 parent 298e664 commit 9e1c43d
Show file tree
Hide file tree
Showing 28 changed files with 1,916 additions and 1 deletion.
81 changes: 81 additions & 0 deletions docs/.tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[main]
host = https://www.transifex.com

[scrypt._build_gettext_contracts]
file_filter = locale/<lang>/LC_MESSAGES/contracts.po
source_file = _build/gettext/contracts.pot
source_lang = en
type = PO

[scrypt._build_gettext_ide]
file_filter = locale/<lang>/LC_MESSAGES/ide.po
source_file = _build/gettext/ide.pot
source_lang = en
type = PO

[scrypt._build_gettext_loop]
file_filter = locale/<lang>/LC_MESSAGES/loop.po
source_file = _build/gettext/loop.pot
source_lang = en
type = PO

[scrypt._build_gettext_ackermann]
file_filter = locale/<lang>/LC_MESSAGES/ackermann.po
source_file = _build/gettext/ackermann.pot
source_lang = en
type = PO

[scrypt._build_gettext_p2pkh]
file_filter = locale/<lang>/LC_MESSAGES/p2pkh.po
source_file = _build/gettext/p2pkh.pot
source_lang = en
type = PO

[scrypt._build_gettext_rpuzzle]
file_filter = locale/<lang>/LC_MESSAGES/rpuzzle.po
source_file = _build/gettext/rpuzzle.pot
source_lang = en
type = PO

[scrypt._build_gettext_intro]
file_filter = locale/<lang>/LC_MESSAGES/intro.po
source_file = _build/gettext/intro.pot
source_lang = en
type = PO

[scrypt._build_gettext_multipartyhashpuzzles]
file_filter = locale/<lang>/LC_MESSAGES/multipartyhashpuzzles.po
source_file = _build/gettext/multipartyhashpuzzles.pot
source_lang = en
type = PO

[scrypt._build_gettext_index]
file_filter = locale/<lang>/LC_MESSAGES/index.po
source_file = _build/gettext/index.pot
source_lang = en
type = PO

[scrypt._build_gettext_rabin]
file_filter = locale/<lang>/LC_MESSAGES/rabin.po
source_file = _build/gettext/rabin.pot
source_lang = en
type = PO

[scrypt._build_gettext_asm]
file_filter = locale/<lang>/LC_MESSAGES/asm.po
source_file = _build/gettext/asm.pot
source_lang = en
type = PO

[scrypt._build_gettext_syntax]
file_filter = locale/<lang>/LC_MESSAGES/syntax.po
source_file = _build/gettext/syntax.pot
source_lang = en
type = PO

[scrypt._build_gettext_functions]
file_filter = locale/<lang>/LC_MESSAGES/functions.po
source_file = _build/gettext/functions.pot
source_lang = en
type = PO

7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@
lexers['solidity'] = SolidityLexer()

# homepage
master_doc = 'index'
master_doc = 'index'

# i19n
gettext_uuid = True
gettext_compact = False
locale_dirs = ['locale/']
Binary file added docs/locale/zh_CN/LC_MESSAGES/ackermann.mo
Binary file not shown.
56 changes: 56 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/ackermann.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2019, sCrypt Inc
# This file is distributed under the same license as the sCrypt package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Edward Liu <574228@qq.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sCrypt\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-30 16:42-0700\n"
"PO-Revision-Date: 2020-10-01 00:49+0000\n"
"Last-Translator: Edward Liu <574228@qq.com>, 2020\n"
"Language-Team: Chinese (China) (https://www.transifex.com/scrypt/teams/113667/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"

# 912f11d9500f4d9382a96b92ae6fc810
#: ../../ackermann.rst:3
msgid "Ackermann Function"
msgstr "阿克曼函数(Ackermann Function)"

# 976f79eac8324ef3b2911d380accb49e
#: ../../ackermann.rst:5
msgid ""
"The Ackermann function is a classic example of a recursive function, notable"
" especially because it is not a primitive recursive function. It grows very "
"quickly in value, as does the size of its call tree. The Ackermann function "
"is usually defined as follows:"
msgstr ""
"阿克曼函数是递归函数的经典示例,特别值得注意的是它并不是一个原始递归函数。它的值增长得非常快,调用树也增长得非常快。阿克曼函数通常定义如下:"

# b14b4ded3a6c436e85f1848bc13645d5
#: ../../ackermann.rst:8
msgid ""
"A(m, n) = \\begin{cases} n+1 & \\mbox{if } m = 0 \\\\ A(m-1, 1) & \\mbox{if "
"} m > 0 \\mbox{ and } n = 0 \\\\ A(m-1, A(m, n-1)) & \\mbox{if } m > 0 "
"\\mbox{ and } n > 0. \\end{cases}"
msgstr ""
"A(m, n) = \\begin{cases} n+1 & \\mbox{if } m = 0 \\\\ A(m-1, 1) & \\mbox{if "
"} m > 0 \\mbox{ and } n = 0 \\\\ A(m-1, A(m, n-1)) & \\mbox{if } m > 0 "
"\\mbox{ and } n > 0. \\end{cases}"

# c380afc23c554d4bbb98953a0ce9b66b
#: ../../ackermann.rst:18
msgid ""
"nCrypt has devised a way to calculate the value of the Ackermann function "
"using `native scripts`_. But it is definitely non-trivial. Below we present "
"a much simpler version."
msgstr "nCrypt设计了一种使用 `原生脚本`_ 计算阿克曼函数值的方法,该方法是非常复杂的。下面我们给出了一个简单得多的版本。"
Binary file added docs/locale/zh_CN/LC_MESSAGES/asm.mo
Binary file not shown.
120 changes: 120 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/asm.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2019, sCrypt Inc
# This file is distributed under the same license as the sCrypt package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Edward Liu <574228@qq.com>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: sCrypt\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-30 16:42-0700\n"
"PO-Revision-Date: 2020-10-01 00:49+0000\n"
"Last-Translator: Edward Liu <574228@qq.com>, 2020\n"
"Language-Team: Chinese (China) (https://www.transifex.com/scrypt/teams/113667/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"

# 0f4aa1bb8bb1442281db08946a9e0b2a
#: ../../asm.rst:3
msgid "Inline Assembly"
msgstr "内联汇编"

# 60a75189b9454e9c9c99513b8298d719
#: ../../asm.rst:4
msgid ""
"Script is a low-level language and acts as assembly for the `Bitcoin Virtual"
" Machine <https://medium.com/@xiaohuiliu/introduction-to-bitcoin-smart-"
"contracts-9c0ea37dc757>`_. Usually, developers do not have to deal with it "
"directly and can use high-level languages like sCrypt. However, there are "
"cases where using Script is desirable. For example, customized script is "
"optimized and thus more efficient than script generated by sCrypt. Or script"
" is generated using external tools (like `MiniForth "
"<https://powping.com/posts/95e53a7305ad9d333d072575946d0cfd0d6321f40af40f9c66c70955ada94e58>`_)"
" and needs to be integrated into sCrypt."
msgstr ""
"脚本是一种低级语言,可以看作是 `比特币虚拟机 <https://medium.com/@xiaohuiliu/introduction-to-"
"bitcoin-smart-contracts-9c0ea37dc757>`_ "
"的汇编语言。通常,开发人员不用直接使用它,而是用像sCrypt这样的高级语言。但有些情况下用脚本语言更合适。例如,直接写出更优化的脚本,比用sCrypt生成的更高效。或者脚本是用外部工具(如"
" `MiniForth "
"<https://powping.com/posts/95e53a7305ad9d333d072575946d0cfd0d6321f40af40f9c66c70955ada94e58>`_"
" )生成的,想集成到sCrypt中。"

# b75bdb093175461da9b63fd756c72c50
#: ../../asm.rst:9
msgid ""
"Script can be embedded directly into sCrypt source code using assembly "
"representation. An sCrypt function can be written in Script and called like "
"a regular sCrypt function."
msgstr "用汇编表示法可以直接把脚本嵌入到sCrypt源代码中。可以用脚本编写sCrypt函数,并像正常的sCrypt函数一样被调用。"

# be3cecb0de45422eb2c03dcf59a1be3e
#: ../../asm.rst:12
msgid "Calling Convention"
msgstr "调用规范"

# bbe83d697e6847549fbae116c8c96f2c
#: ../../asm.rst:13
msgid ""
"For a function to be written in Script, its entire body must be enclosed by "
"``asm`` mode. Function parameters are on top of the stack, in reverse order "
"as declared. For example, for a function with signature ``function foo(int "
"p0, bytes p1, bool p2): int``, ``p2`` will be top of the stack, ``p1`` "
"second from top, and ``p0`` third from top when entering ``asm`` mode. When "
"exiting ``asm`` mode, all parameters must be poped and replaced with a "
"single returned result on top of the stack. All other items in the stack "
"must remain intact."
msgstr ""
"用脚本写的函数,整个函数体要用 ``asm`` 模式括起来。函数参数位于栈顶,与定义顺序相反。比如,当进入 ``asm`` 模式时, 函数 "
"``function foo(int p0, bytes p1, bool p2): int`` 中, ``p2`` 位于栈顶, ``p1`` "
"是从栈顶开始的第二个元素, ``p0`` 是第三个。当退出 ``asm`` 模式时,需要弹出栈里的所有参数,并把返回值放到栈顶。栈里其他元素保持不变。"

# c843e69725124d00b5130fb9e4fe9045
#: ../../asm.rst:18
msgid "Two assembly functions are shown below."
msgstr "下面是两个汇编函数。"

# 5cb60dbb676348a59b0cfcc748e9028d
#: ../../asm.rst:38
msgid "Assembly Variable"
msgstr "汇编变量"

# acb5d7db916b46edbb74c5533abd77eb
#: ../../asm.rst:39
msgid ""
"Variables can be used inside ``asm`` mode by prefix ``$``. Unlike the rest "
"of Script, which is copied verbatim into the final script output, a variable"
" is prefixed by its scope to avoid name collision, uniquely identified by "
"the function and contract it is within. For example, supposed a variable "
"``$var`` is used inside function ``func`` inside contract ``contractFoo``, "
"it will show up in the final script output as ``$contractFoo.func.var``."
msgstr ""
"在 ``asm`` 模式下,可以用 ``$`` "
"前缀来使用变量。其他脚本都是逐字复制到最终脚本输出中的,而汇编变量不是。变量以它的作用域为前缀,这样可以避免重名,由变量所在的合约和函数进行唯一标识。例如,在合约"
" ``contractFoo`` 中的函数 ``func`` 中有个变量 ``$var`` ,在最终脚本输出中会被转换成 "
"``$contractFoo.func.var``。"

# 4e10c560fa5a448495775ff176f21f22
#: ../../asm.rst:43
msgid "An example is shown below."
msgstr "下面展示一个例子。"

# c609dd50356a408fa799829fa5a25fc2
#: ../../asm.rst:58
msgid "Notes"
msgstr "注意"

# f14bef88119f49aaacc01a5db995a2b0
#: ../../asm.rst:59
msgid ""
"Inline assembly bypasses many features of sCrypt such as type checking. "
"Extreme caution has to be taken using this advanced feature. Also it is "
"case-insensitive for compatibility with external tools."
msgstr ""
"内联汇编绕过了sCrypt的许多功能,例如类型检查等。所以使用这个高级功能时要格外小心。此外,该功能在与外部工具的兼容性上是不区分大小写的。"
Binary file added docs/locale/zh_CN/LC_MESSAGES/contracts.mo
Binary file not shown.

0 comments on commit 9e1c43d

Please sign in to comment.