# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, Xorbits Inc.
# This file is distributed under the same license as the Xinference package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Xinference \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-07 15:03+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"

#: ../../source/development/contributing_codebase.rst:3
msgid "Contributing to the code base"
msgstr "代码库开发指南"

#: ../../source/development/contributing_codebase.rst:6
msgid "Table of contents:"
msgstr "目录"

#: ../../source/development/contributing_codebase.rst:9
msgid "Code standards"
msgstr "代码规范"

#: ../../source/development/contributing_codebase.rst:11
msgid ""
"Writing good code is not just about what you write. It is also about "
"*how* you write it. During Continuous Integration testing, several tools "
"will be run to check your code for stylistic errors. Good style is a "
"requirement for submitting code to Xinference."
msgstr ""
"写出好的代码不仅在于你写了什么，更在于你是如何写的。在持续集成测试期间，会有多个工具来检查您的代码是否存在风格错误。良好的编程风格是提交代码到 "
"Xinference 的要求之一。"

#: ../../source/development/contributing_codebase.rst:15
msgid ""
"In addition, it is important that we do not make sudden changes to the "
"code that could have the potential to break a lot of user code as a "
"result. Therefore we need it to be as backwards compatible as possible to"
" avoid mass breakages."
msgstr "此外，不要对代码进行突然的更改，这可能会导致大量用户代码出现问题。所以，我们需要尽可能地保持向后兼容，以避免大规模的故障。"

#: ../../source/development/contributing_codebase.rst:20
msgid "Autofixing formatting errors"
msgstr "自动修复格式错误"

#: ../../source/development/contributing_codebase.rst:22
msgid ""
"Moreover, Continuous Integration will run code formatting checks like "
"``black``, ``flake8``, ``isort``, and others using `pre-commit hooks "
"<https://pre-commit.com/>`_ Any warnings generated by these checks will "
"cause the Continuous Integration to fail. Therefore, it is advisable to "
"run the check yourself before submitting code. This can be done by "
"installing ``pre-commit``::"
msgstr "此外，持续集成将使用 `pre-commit hooks <https://pre-commit.com/>`_ 运行诸如 ``black`"
"`、``flake8``、``isort`` 等代码格式检查工具。任何由这些检查生成的警告都将导致持续集成失败。因此，建议在提交代码之前自行"
"运行这些检查。可以通过在 Xinference 仓库的根目录下安装 ``pre-commit`` 来完成这一操作::"

#: ../../source/development/contributing_codebase.rst:30
msgid "and then running::"
msgstr "然后执行命令::"

#: ../../source/development/contributing_codebase.rst:34
msgid ""
"from the root of the Xinference repository. This setup ensures that all "
"styling checks are automatically executed each time you commit changes "
"without your needing to run each one manually. In addition, using ``pre-"
"commit`` will also allow you to more easily remain up-to-date with our "
"code checks as they change."
msgstr ""
"安装好了以后就能确保每次提交更改时都会自动执行所有样式检查，无需手动逐个运行。"
"此外，使用 ``pre-commit`` 也能让您更轻松地在我们的代码检查发生更改的时候保持同步。"

#: ../../source/development/contributing_codebase.rst:39
msgid ""
"Note that if needed, you can skip these checks with ``git commit --no-"
"verify``."
msgstr "请注意，如果需要，您可以通过使用 ``git commit --no-verify`` 命令来跳过这些检查。"

#: ../../source/development/contributing_codebase.rst:41
msgid ""
"If you don't want to use ``pre-commit`` as part of your workflow, you can"
" still use it to run its checks with::"
msgstr "如果您不想将 ``pre-commit`` 作为工作流程的一部分，仍然可以运行如下命令来使用它进行检查::"

#: ../../source/development/contributing_codebase.rst:46
#: ../../source/development/contributing_codebase.rst:52
msgid "without needing to have done ``pre-commit install`` beforehand."
msgstr "而不需要事先执行 ``pre-commit install``。"

#: ../../source/development/contributing_codebase.rst:48
msgid ""
"If you want to run checks on all recently committed files on "
"upstream/main you can use::"
msgstr "如果您想在所有最近提交的文件上运行检查，您可以使用以下命令::"

#: ../../source/development/contributing_codebase.rst:56
msgid ""
"You may consider periodically running ``pre-commit gc`` to clean up repos"
" which are no longer used."
msgstr "您可以考虑定期运行 ``pre-commit gc`` 命令来清理不再使用的存储库。"

#: ../../source/development/contributing_codebase.rst:61
msgid ""
"If you have conflicting installations of ``virtualenv``, if could lead to"
" errors - refer to `here "
"<https://github.com/pypa/virtualenv/issues/1875>`_."
msgstr "如果您安装了冲突的 ``virtualenv`` 版本，可能会导致错误 - 可以参考"
" `这里 <https://github.com/pypa/virtualenv/issues/1875>`_ 。"

#: ../../source/development/contributing_codebase.rst:64
msgid ""
"Also, due to a `bug in virtualenv "
"<https://github.com/pypa/virtualenv/issues/1986>`_, you may run into "
"issues if you're using conda. To solve this, you can downgrade "
"``virtualenv`` to version ``20.0.33``."
msgstr ""
"此外，由于 ``virtualenv`` 中的一个 `错误 <https://github.com/pypa/virtualenv/issues/1986>`_ ，如果您使用 conda，可能会遇到问题。"
"要解决这个问题，您可以将 ``virtualenv`` 降级到版本 ``20.0.33``。"

#: ../../source/development/contributing_codebase.rst:69
msgid "Backwards compatibility"
msgstr "向后兼容"

#: ../../source/development/contributing_codebase.rst:71
msgid ""
"Please try to maintain backward compatibility. If you think breakage is "
"necessary, clearly state why as part of the pull request. Also, be "
"careful when changing method signatures and add deprecation warnings "
"where needed. Also, add the deprecated sphinx directive to the deprecated"
" functions or methods."
msgstr ""
"请尽量保持向后兼容性。如果您认为必须进行更改，请在拉取请求中说明清楚原因。同时，在更改方法签名时要小心，并在需要时添加弃用警告。此外，为弃用的函数或方法添加弃用的"
" sphinx 指令。"

#: ../../source/development/contributing_codebase.rst:76
msgid "You'll also need to"
msgstr "同时你还需要"

#: ../../source/development/contributing_codebase.rst:78
msgid ""
"Write a new test that asserts a warning is issued when calling with the "
"deprecated argument"
msgstr "编写一个新的测试样例，在调用带有弃用参数时会发出警告。"

#: ../../source/development/contributing_codebase.rst:79
msgid "Update all of Xinference existing tests and code to use the new argument"
msgstr "更新所有 Xinference 现有的测试样例和代码，以使用新的参数。"

#: ../../source/development/contributing_codebase.rst:82
msgid "Type hints"
msgstr "类型提示"

#: ../../source/development/contributing_codebase.rst:84
msgid ""
"Xinference strongly encourages the use of :pep:`484` style type hints. "
"New development should contain type hints and pull requests to annotate "
"existing code are accepted as well!"
msgstr "Xinference 强烈鼓励使用 :pep:`484` 风格的类型提示。新的开发应包含类型提示，并且对现有代码进行注释的拉取请求也是可以接受的！"

#: ../../source/development/contributing_codebase.rst:88
msgid "Test-driven development"
msgstr "测试驱动开发"

#: ../../source/development/contributing_codebase.rst:90
msgid ""
"Xinference is serious about testing and strongly encourages contributors "
"to embrace `test-driven development (TDD) <https://en.wikipedia.org/wiki"
"/Test-driven_development>`_. This development process \"relies on the "
"repetition of a very short development cycle: first the developer writes "
"an (initially failing) automated test case that defines a desired "
"improvement or new function, then produces the minimum amount of code to "
"pass that test.\" So, before actually writing any code, you should write "
"your tests. Often the test can be taken from the original GitHub issue. "
"However, it is always worth considering additional use cases and writing "
"corresponding tests."
msgstr ""
"Xinference 非常重视测试，并强烈鼓励贡献者采用 `测试驱动开发(TDD) <https://en.wikipedia.org/wiki"
"/Test-driven_development>`_ 。这种开发过程 "
"\"依赖于非常短的开发周期的重复：首先，开发者编写一个（初始为失败的）自动化测试样例来定义所需的改进或新功能，然后用最少的代码来通过该测试。\"因此，在实际编写任何代码之前，您应该编写您的测试样例。通常，测试样例可以从原始的"
" GitHub issue 中获取。然而，值得考虑额外的情况并编写相应的测试样例。"

#: ../../source/development/contributing_codebase.rst:99
msgid ""
"Adding tests is frequently requested after code is pushed to Xinference. "
"Thus, it is worth getting in the habit of writing tests ahead of time so "
"this is never an issue."
msgstr "在将代码推送到 Xinference 之后，经常会要求添加测试样例。因此，养成提前编写测试样例的习惯非常重要，这样就不会出现问题。"

#~ msgid "Pre-commit"
#~ msgstr "Pre-commit"

