Skip to content

Commit

Permalink
Synchronize translation
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Aug 21, 2018
1 parent 790c137 commit b2cc831
Show file tree
Hide file tree
Showing 19 changed files with 4,902 additions and 709 deletions.
171 changes: 2 additions & 169 deletions docs/locales/zh/LC_MESSAGES/adv_topics.po
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: GINO 0.5.8\n"
"Project-Id-Version: GINO 0.7.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 23:28+0800\n"
"POT-Creation-Date: 2018-08-21 12:19+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Language-Team: Chinese (https://www.transifex.com/decentfox-studio/teams/84194/zh/)\n"
"MIME-Version: 1.0\n"
Expand All @@ -20,170 +20,3 @@ msgstr ""
#: ../../adv_topics.rst:2
msgid "Advanced Topics"
msgstr ""

#: ../../adv_topics.rst:4
msgid "**THIS IS A WIP**"
msgstr ""

#: ../../adv_topics.rst:7
msgid "Transaction and Context"
msgstr ""

#: ../../adv_topics.rst:9
msgid ""
"In normal cases when ``db`` is bound to a pool, you can start a transaction "
"through ``db`` directly:"
msgstr ""

#: ../../adv_topics.rst:17
msgid ""
"As you can see from the unpacked arguments, ``db.transaction()`` acquired a "
"connection and started a transaction in one go. It is identical to do it "
"separately:"
msgstr ""

#: ../../adv_topics.rst:27
msgid ""
"There is an alternative to do this without ``async with``, but this may be "
"changed in next version, as discussed in #59. Also, ``tx`` is always "
"``None`` for now."
msgstr ""

#: ../../adv_topics.rst:31
msgid ""
"Because GINO offers query APIs on not only connections but also model "
"classes and objects and even query objects, it would be too much trouble "
"passing connection object around when dealing with transactions. Therefore "
"GINO offers an optional feature to automatically manage connection objects, "
"by enabling a builtin task local hack before any tasks are created:"
msgstr ""

#: ../../adv_topics.rst:42
msgid ""
"This switch creates a local storage for each coroutine, where "
"``db.acquire()`` shall store the connection object. Hence executions within "
"the acquire context will be able to make use of the same connection right in"
" the local storage. Furthermore, nested ``db.acquire()`` will simply return "
"the same connection. This allows ``db.transaction()`` to be nested in the "
"same way that asyncpg ``conn.transaction()`` does it - to use database save "
"points."
msgstr ""

#: ../../adv_topics.rst:55
msgid ""
"If nested transactions or reused connections are not expected, you can "
"explicitly use ``db.acquire(reuse=False)`` or "
"``db.transaction(reuse=False)`` to borrow new connections from the pool. "
"Non-reused connections are stacked, they will be returned to the pool in the"
" reversed order as they were borrowed. Local storage covers between "
"different tasks that are awaited in a chain, it is theoretically safe in "
"most cases. However it is still some sort of a hack, but it would be like "
"this before Python officially supports task local storage in PEP 550."
msgstr ""

#: ../../adv_topics.rst:66
msgid "Sanic Support"
msgstr ""

#: ../../adv_topics.rst:68
msgid ""
"To integrate with Sanic_, a few configurations needs to be set in "
"``app.config`` (with default value though):"
msgstr ""

#: ../../adv_topics.rst:71
msgid "DB_HOST: if not set, ``localhost``"
msgstr ""

#: ../../adv_topics.rst:72
msgid "DB_PORT: if not set, ``5432``"
msgstr ""

#: ../../adv_topics.rst:73
msgid "DB_USER: if not set, ``postgres``"
msgstr ""

#: ../../adv_topics.rst:74
msgid "DB_PASSWORD: if not set, empty string"
msgstr ""

#: ../../adv_topics.rst:75
msgid "DB_DATABASE: if not set, ``postgres``"
msgstr ""

#: ../../adv_topics.rst:76
msgid "DB_POOL_MIN_SIZE: if not set, 5"
msgstr ""

#: ../../adv_topics.rst:77
msgid "DB_POOL_MAX_SIZE: if not set, 10"
msgstr ""

#: ../../adv_topics.rst:79
msgid "An example:"
msgstr ""

#: ../../adv_topics.rst:94
msgid ""
"After ``db.init_app``, a connection pool with configured settings shall be "
"created and bound to ``db`` when Sanic server is started, and closed on "
"stop. Furthermore, a lazy connection context is created on each request, and"
" released on response. That is to say, within Sanic request handlers, you "
"can directly access db by e.g. ``User.get(1)``, everything else is settled: "
"database pool is created on server start, connection is lazily borrowed from"
" pool on the first database access and shared within the rest of the same "
"request handler, and automatically returned to the pool on response."
msgstr ""

#: ../../adv_topics.rst:103
msgid ""
"Please be noted that, in the async world, ``await`` may block unpredictably "
"for a long time. When this world is crossing RDBMS pools and transactions, "
"it is a very dangerous bite for performance, even causing disasters "
"sometimes. Therefore we recommend, during the time enjoying fast "
"development, do pay special attention to the scope of transactions and "
"borrowed connections, make sure that transactions are closed as soon as "
"possible, and connections are not taken for unnecessarily long time. As for "
"the Sanic support, if you want to release the concrete connection in the "
"request context before response is reached, just do it like this:"
msgstr ""

#: ../../adv_topics.rst:118
msgid ""
"Or if you prefer not to use the contextual lazy connection in certain "
"handlers, prefer explicitly manage the connection lifetime, you can always "
"borrow a new connection by setting ``reuse=False``:"
msgstr ""

#: ../../adv_topics.rst:128
msgid ""
"Or if you prefer not to use the builtin request-scoped lazy connection at "
"all, you can simply turn it off:"
msgstr ""

#: ../../adv_topics.rst:137
msgid "JSON Property"
msgstr ""

#: ../../adv_topics.rst:139
msgid ""
"PostgreSQL started to support native JSON type since 9.2, and became more "
"feature complete in 9.4. JSON is ideal to store varying key-value data. GINO"
" offers objective support for this scenario, requiring PostgreSQL 9.5 for "
"now."
msgstr ""

#: ../../adv_topics.rst:157
msgid ""
"``nickname`` and ``age`` look just like normal columns, but they are "
"actually key-value pairs in the ``profile`` column. ``profile`` is the "
"default column name for JSON properties, you can specify a different name by"
" offering the argument ``column_name`` when defining a JSON property. "
"Actually multiple JSON columns are allowed, storing different JSON "
"properties as needed. Also, both ``JSON`` and ``JSONB`` can be used, "
"depending on your choice. For example:"
msgstr ""

#: ../../adv_topics.rst:183
msgid "JSON properties work like normal columns too:"
msgstr ""
7 changes: 4 additions & 3 deletions docs/locales/zh/LC_MESSAGES/api.po
Expand Up @@ -6,10 +6,11 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: GINO 0.5.8\n"
"Project-Id-Version: GINO 0.7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 23:28+0800\n"
"POT-Creation-Date: 2018-04-19 10:35+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: fantix <fantix.king@gmail.com>, 2018\n"
"Language-Team: Chinese (https://www.transifex.com/decentfox-studio/teams/84194/zh/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -19,4 +20,4 @@ msgstr ""

#: ../../api.rst:2
msgid "API Reference"
msgstr ""
msgstr "API 参考"
53 changes: 39 additions & 14 deletions docs/locales/zh/LC_MESSAGES/authors.po
Expand Up @@ -6,10 +6,11 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: GINO 0.5.8\n"
"Project-Id-Version: GINO 0.7.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07 23:28+0800\n"
"POT-Creation-Date: 2018-08-21 12:19+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Daisy Dai <daichen.daisy@gmail.com>, 2018\n"
"Language-Team: Chinese (https://www.transifex.com/decentfox-studio/teams/84194/zh/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand All @@ -19,52 +20,76 @@ msgstr ""

#: ../../../AUTHORS.rst:3
msgid "Credits"
msgstr ""
msgstr "制作人员"

#: ../../../AUTHORS.rst:6
msgid "Development Lead"
msgstr ""
msgstr "主要制作人"

#: ../../../AUTHORS.rst:8
msgid "Fantix King <fantix.king@gmail.com>"
msgstr ""
msgstr "王川 <fantix.king@gmail.com>"

#: ../../../AUTHORS.rst:11
msgid "Contributors"
msgstr ""
msgstr "贡献者"

#: ../../../AUTHORS.rst:13
msgid "Tony Wang <wwwjfy@gmail.com>"
msgstr ""
msgstr "王沐雨 <wwwjfy@gmail.com>"

#: ../../../AUTHORS.rst:14
msgid "Neal Wang <qdzzyb2015@gamil.com>"
msgstr ""
msgstr "王林基 <qdzzyb2015@gmail.com>"

#: ../../../AUTHORS.rst:15
msgid "Binghan Li <lbhsot@163.com>"
msgstr ""
msgstr "李冰含 <lbhsot@163.com>"

#: ../../../AUTHORS.rst:16
msgid "Vladimir Goncharov <dev.zelta@gmail.com>"
msgstr ""
msgstr "Vladimir Goncharov <dev.zelta@gmail.com>"

#: ../../../AUTHORS.rst:17
msgid "Kinware <oss@kinware.com>"
msgstr ""
msgstr "Kinware <oss@kinware.com>"

#: ../../../AUTHORS.rst:18
msgid "Kentoseth <kentoseth@devcroo.com>"
msgstr ""
msgstr "Kentoseth <kentoseth@devcroo.com>"

#: ../../../AUTHORS.rst:19
msgid "Ádám Barancsuk <adam.barancsuk@gmail.com>"
msgstr ""
msgstr "Ádám Barancsuk <adam.barancsuk@gmail.com>"

#: ../../../AUTHORS.rst:20
msgid "Sergey Kovalev <s_kovalev@wargaming.net>"
msgstr ""
msgstr "Sergey Kovalev <s_kovalev@wargaming.net>"

#: ../../../AUTHORS.rst:21
msgid "jonahfang"
msgstr "jonahfang"

#: ../../../AUTHORS.rst:22
msgid "Yurii Shtrikker <nbb.unitto@gmail.com>"
msgstr ""

#: ../../../AUTHORS.rst:23
msgid "Nicolas Crocfer <ncrocfer@gmail.com>"
msgstr ""

#: ../../../AUTHORS.rst:24
msgid "Denys Badzo <badzyo360@gmail.com>"
msgstr ""

#: ../../../AUTHORS.rst:25
msgid "Pavol Vargovcik <pavol.vargovcik@gmail.com>"
msgstr ""

#: ../../../AUTHORS.rst:28
msgid ""
"Special thanks to my wife Daisy and her outsourcing company `DecentFoX "
"Studio`_, for offering me the opportunity to build this project. We are open"
" for global software project outsourcing on Python, iOS and Android "
"development."
msgstr ""

0 comments on commit b2cc831

Please sign in to comment.