From 2ccf5909bf276c10121204d5e15162a26482ea72 Mon Sep 17 00:00:00 2001 From: rockleona Date: Sat, 8 Jul 2023 16:55:13 +0800 Subject: [PATCH 1/7] Working on API venv.rst:140 to venv.rst:173 --- library/venv.po | 1334 ++++++++++++++++++++++++----------------------- 1 file changed, 679 insertions(+), 655 deletions(-) diff --git a/library/venv.po b/library/venv.po index afe3f38074..68c0a2b7ea 100644 --- a/library/venv.po +++ b/library/venv.po @@ -1,655 +1,679 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2018-05-23 16:15+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/venv.rst:2 -msgid ":mod:`venv` --- Creation of virtual environments" -msgstr "" - -#: ../../library/venv.rst:12 -msgid "**Source code:** :source:`Lib/venv/`" -msgstr "**原始碼:**\\ :source:`Lib/venv/`" - -#: ../../library/venv.rst:21 -msgid "" -"The :mod:`!venv` module supports creating lightweight \"virtual " -"environments\", each with their own independent set of Python packages " -"installed in their :mod:`site` directories. A virtual environment is created " -"on top of an existing Python installation, known as the virtual " -"environment's \"base\" Python, and may optionally be isolated from the " -"packages in the base environment, so only those explicitly installed in the " -"virtual environment are available." -msgstr "" - -#: ../../library/venv.rst:29 -msgid "" -"When used from within a virtual environment, common installation tools such " -"as `pip`_ will install Python packages into a virtual environment without " -"needing to be told to do so explicitly." -msgstr "" - -#: ../../library/venv.rst:33 -msgid "See :pep:`405` for more background on Python virtual environments." -msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" - -#: ../../library/venv.rst:37 -msgid "" -"`Python Packaging User Guide: Creating and using virtual environments " -"`__" -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: ../../library/venv.rst:43 -msgid "Creating virtual environments" -msgstr "" - -#: ../../using/venv-create.inc:1 -msgid "" -"Creation of :ref:`virtual environments ` is done by executing the " -"command ``venv``::" -msgstr "" - -#: ../../using/venv-create.inc:6 -msgid "" -"Running this command creates the target directory (creating any parent " -"directories that don't exist already) and places a ``pyvenv.cfg`` file in it " -"with a ``home`` key pointing to the Python installation from which the " -"command was run (a common name for the target directory is ``.venv``). It " -"also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a " -"copy/symlink of the Python binary/binaries (as appropriate for the platform " -"or arguments used at environment creation time). It also creates an " -"(initially empty) ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, " -"this is ``Lib\\site-packages``). If an existing directory is specified, it " -"will be re-used." -msgstr "" - -#: ../../using/venv-create.inc:17 -msgid "" -"``pyvenv`` was the recommended tool for creating virtual environments for " -"Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." -msgstr "" - -#: ../../using/venv-create.inc:22 -msgid "" -"The use of ``venv`` is now recommended for creating virtual environments." -msgstr "" - -#: ../../using/venv-create.inc:27 -msgid "On Windows, invoke the ``venv`` command as follows::" -msgstr "" - -#: ../../using/venv-create.inc:31 -msgid "" -"Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables for " -"your :ref:`Python installation `::" -msgstr "" - -#: ../../using/venv-create.inc:36 -msgid "The command, if run with ``-h``, will show the available options::" -msgstr "" - -#: ../../using/venv-create.inc:70 -msgid "" -"Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " -"PyPI" -msgstr "" - -#: ../../using/venv-create.inc:73 -msgid "" -"Installs pip by default, added the ``--without-pip`` and ``--copies`` " -"options" -msgstr "" - -#: ../../using/venv-create.inc:77 -msgid "" -"In earlier versions, if the target directory already existed, an error was " -"raised, unless the ``--clear`` or ``--upgrade`` option was provided." -msgstr "" - -#: ../../using/venv-create.inc:82 -msgid "" -"While symlinks are supported on Windows, they are not recommended. Of " -"particular note is that double-clicking ``python.exe`` in File Explorer will " -"resolve the symlink eagerly and ignore the virtual environment." -msgstr "" - -#: ../../using/venv-create.inc:87 -msgid "" -"On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " -"script by setting the execution policy for the user. You can do this by " -"issuing the following PowerShell command:" -msgstr "" - -#: ../../using/venv-create.inc:91 -msgid "" -"PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" -msgstr "" - -#: ../../using/venv-create.inc:93 -msgid "" -"See `About Execution Policies `_ for more information." -msgstr "" - -#: ../../using/venv-create.inc:97 -msgid "" -"The created ``pyvenv.cfg`` file also includes the ``include-system-site-" -"packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" -"packages`` option, ``false`` otherwise." -msgstr "" - -#: ../../using/venv-create.inc:101 -msgid "" -"Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " -"invoked to bootstrap ``pip`` into the virtual environment." -msgstr "" - -#: ../../using/venv-create.inc:104 -msgid "" -"Multiple paths can be given to ``venv``, in which case an identical virtual " -"environment will be created, according to the given options, at each " -"provided path." -msgstr "" - -#: ../../library/venv.rst:50 -msgid "How venvs work" -msgstr "" - -#: ../../library/venv.rst:52 -msgid "" -"When a Python interpreter is running from a virtual environment, :data:`sys." -"prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " -"environment, whereas :data:`sys.base_prefix` and :data:`sys." -"base_exec_prefix` point to those of the base Python used to create the " -"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " -"determine if the current interpreter is running from a virtual environment." -msgstr "" - -#: ../../library/venv.rst:61 -msgid "" -"A virtual environment may be \"activated\" using a script in its binary " -"directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`python` will " -"invoke the environment's Python interpreter and you can run installed " -"scripts without having to use their full path. The invocation of the " -"activation script is platform-specific (:samp:`{}` must be replaced by " -"the path to the directory containing the virtual environment):" -msgstr "" - -#: ../../library/venv.rst:71 -msgid "Platform" -msgstr "平台" - -#: ../../library/venv.rst:71 -msgid "Shell" -msgstr "" - -#: ../../library/venv.rst:71 -msgid "Command to activate virtual environment" -msgstr "" - -#: ../../library/venv.rst:73 -msgid "POSIX" -msgstr "POSIX" - -#: ../../library/venv.rst:73 -msgid "bash/zsh" -msgstr "bash/zsh" - -#: ../../library/venv.rst:73 -msgid ":samp:`$ source {}/bin/activate`" -msgstr ":samp:`$ source {}/bin/activate`" - -#: ../../library/venv.rst:75 -msgid "fish" -msgstr "fish" - -#: ../../library/venv.rst:75 -msgid ":samp:`$ source {}/bin/activate.fish`" -msgstr ":samp:`$ source {}/bin/activate.fish`" - -#: ../../library/venv.rst:77 -msgid "csh/tcsh" -msgstr "csh/tcsh" - -#: ../../library/venv.rst:77 -msgid ":samp:`$ source {}/bin/activate.csh`" -msgstr ":samp:`$ source {}/bin/activate.csh`" - -#: ../../library/venv.rst:79 ../../library/venv.rst:83 -msgid "PowerShell" -msgstr "PowerShell" - -#: ../../library/venv.rst:79 -msgid ":samp:`$ {}/bin/Activate.ps1`" -msgstr ":samp:`$ {}/bin/Activate.ps1`" - -#: ../../library/venv.rst:81 -msgid "Windows" -msgstr "Windows" - -#: ../../library/venv.rst:81 -msgid "cmd.exe" -msgstr "cmd.exe" - -#: ../../library/venv.rst:81 -msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" - -#: ../../library/venv.rst:83 -msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" - -#: ../../library/venv.rst:86 -msgid ":program:`fish` and :program:`csh` activation scripts." -msgstr "" - -#: ../../library/venv.rst:89 -msgid "" -"PowerShell activation scripts installed under POSIX for PowerShell Core " -"support." -msgstr "" - -#: ../../library/venv.rst:93 -msgid "" -"You don't specifically *need* to activate a virtual environment, as you can " -"just specify the full path to that environment's Python interpreter when " -"invoking Python. Furthermore, all scripts installed in the environment " -"should be runnable without activating it." -msgstr "" - -#: ../../library/venv.rst:99 -msgid "" -"In order to achieve this, scripts installed into virtual environments have a " -"\"shebang\" line which points to the environment's Python interpreter, i.e. :" -"samp:`#!/{}/bin/python`. This means that the script will run " -"with that interpreter regardless of the value of :envvar:`!PATH`. On " -"Windows, \"shebang\" line processing is supported if you have the :ref:" -"`launcher` installed. Thus, double-clicking an installed script in a Windows " -"Explorer window should run it with the correct interpreter without the " -"environment needing to be activated or on the :envvar:`!PATH`." -msgstr "" - -#: ../../library/venv.rst:108 -msgid "" -"When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " -"environment variable is set to the path of the environment. Since explicitly " -"activating a virtual environment is not required to use it, :envvar:`!" -"VIRTUAL_ENV` cannot be relied upon to determine whether a virtual " -"environment is being used." -msgstr "" - -#: ../../library/venv.rst:114 -msgid "" -"Because scripts installed in environments should not expect the environment " -"to be activated, their shebang lines contain the absolute paths to their " -"environment's interpreters. Because of this, environments are inherently non-" -"portable, in the general case. You should always have a simple means of " -"recreating an environment (for example, if you have a requirements file " -"``requirements.txt``, you can invoke ``pip install -r requirements.txt`` " -"using the environment's ``pip`` to install all of the packages needed by the " -"environment). If for any reason you need to move the environment to a new " -"location, you should recreate it at the desired location and delete the one " -"at the old location. If you move an environment because you moved a parent " -"directory of it, you should recreate the environment in its new location. " -"Otherwise, software installed into the environment may not work as expected." -msgstr "" - -#: ../../library/venv.rst:128 -msgid "" -"You can deactivate a virtual environment by typing ``deactivate`` in your " -"shell. The exact mechanism is platform-specific and is an internal " -"implementation detail (typically, a script or shell function will be used)." -msgstr "" - -#: ../../library/venv.rst:136 -msgid "API" -msgstr "API" - -#: ../../library/venv.rst:140 -msgid "" -"The high-level method described above makes use of a simple API which " -"provides mechanisms for third-party virtual environment creators to " -"customize environment creation according to their needs, the :class:" -"`EnvBuilder` class." -msgstr "" - -#: ../../library/venv.rst:148 -msgid "" -"The :class:`EnvBuilder` class accepts the following keyword arguments on " -"instantiation:" -msgstr "" - -#: ../../library/venv.rst:151 -msgid "" -"``system_site_packages`` -- a Boolean value indicating that the system " -"Python site-packages should be available to the environment (defaults to " -"``False``)." -msgstr "" - -#: ../../library/venv.rst:154 -msgid "" -"``clear`` -- a Boolean value which, if true, will delete the contents of any " -"existing target directory, before creating the environment." -msgstr "" - -#: ../../library/venv.rst:157 -msgid "" -"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " -"Python binary rather than copying." -msgstr "" - -#: ../../library/venv.rst:160 -msgid "" -"``upgrade`` -- a Boolean value which, if true, will upgrade an existing " -"environment with the running Python - for use when that Python has been " -"upgraded in-place (defaults to ``False``)." -msgstr "" - -#: ../../library/venv.rst:164 -msgid "" -"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " -"the virtual environment. This uses :mod:`ensurepip` with the ``--default-" -"pip`` option." -msgstr "" - -#: ../../library/venv.rst:168 -msgid "" -"``prompt`` -- a String to be used after virtual environment is activated " -"(defaults to ``None`` which means directory name of the environment would be " -"used). If the special string ``\".\"`` is provided, the basename of the " -"current directory is used as the prompt." -msgstr "" - -#: ../../library/venv.rst:173 -msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" -msgstr "" - -#: ../../library/venv.rst:175 ../../library/venv.rst:350 -msgid "Added the ``with_pip`` parameter" -msgstr "新增 ``with_pip`` 參數" - -#: ../../library/venv.rst:178 ../../library/venv.rst:353 -msgid "Added the ``prompt`` parameter" -msgstr "新增 ``prompt`` 參數" - -#: ../../library/venv.rst:181 ../../library/venv.rst:356 -msgid "Added the ``upgrade_deps`` parameter" -msgstr "新增 ``upgrade_deps`` 參數" - -#: ../../library/venv.rst:184 -msgid "" -"Creators of third-party virtual environment tools will be free to use the " -"provided :class:`EnvBuilder` class as a base class." -msgstr "" - -#: ../../library/venv.rst:187 -msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "" - -#: ../../library/venv.rst:191 -msgid "" -"Create a virtual environment by specifying the target directory (absolute or " -"relative to the current directory) which is to contain the virtual " -"environment. The ``create`` method will either create the environment in " -"the specified directory, or raise an appropriate exception." -msgstr "" - -#: ../../library/venv.rst:197 -msgid "" -"The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " -"available for subclass customization::" -msgstr "" - -#: ../../library/venv.rst:212 -msgid "" -"Each of the methods :meth:`ensure_directories`, :meth:" -"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" -"meth:`post_setup` can be overridden." -msgstr "" - -#: ../../library/venv.rst:218 -msgid "" -"Creates the environment directory and all necessary subdirectories that " -"don't already exist, and returns a context object. This context object is " -"just a holder for attributes (such as paths) for use by the other methods. " -"If the :class:`EnvBuilder` is created with the arg ``clear=True``, contents " -"of the environment directory will be cleared and then all necessary " -"subdirectories will be recreated." -msgstr "" - -#: ../../library/venv.rst:225 -msgid "" -"The returned context object is a :class:`types.SimpleNamespace` with the " -"following attributes:" -msgstr "" - -#: ../../library/venv.rst:228 -msgid "" -"``env_dir`` - The location of the virtual environment. Used for " -"``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:231 -msgid "" -"``env_name`` - The name of the virtual environment. Used for " -"``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:234 -msgid "" -"``prompt`` - The prompt to be used by the activation scripts. Used for " -"``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:237 -msgid "" -"``executable`` - The underlying Python executable used by the virtual " -"environment. This takes into account the case where a virtual environment is " -"created from another virtual environment." -msgstr "" - -#: ../../library/venv.rst:241 -msgid "``inc_path`` - The include path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:243 -msgid "``lib_path`` - The purelib path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:245 -msgid "``bin_path`` - The script path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:247 -msgid "" -"``bin_name`` - The name of the script path relative to the virtual " -"environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " -"(see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:251 -msgid "" -"``env_exe`` - The name of the Python interpreter in the virtual environment. " -"Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" -"`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:255 -msgid "" -"``env_exec_cmd`` - The name of the Python interpreter, taking into account " -"filesystem redirections. This can be used to run Python in the virtual " -"environment." -msgstr "" - -#: ../../library/venv.rst:260 -msgid "" -"The attribute ``lib_path`` was added to the context, and the context object " -"was documented." -msgstr "" - -#: ../../library/venv.rst:264 -msgid "" -"The *venv* :ref:`sysconfig installation scheme ` is used " -"to construct the paths of the created directories." -msgstr "" - -#: ../../library/venv.rst:271 -msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." -msgstr "" - -#: ../../library/venv.rst:275 -msgid "" -"Creates a copy or symlink to the Python executable in the environment. On " -"POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " -"``python`` and ``python3`` will be created pointing to that executable, " -"unless files with those names already exist." -msgstr "" - -#: ../../library/venv.rst:282 -msgid "" -"Installs activation scripts appropriate to the platform into the virtual " -"environment." -msgstr "" - -#: ../../library/venv.rst:287 -msgid "" -"Upgrades the core venv dependency packages (currently ``pip`` and " -"``setuptools``) in the environment. This is done by shelling out to the " -"``pip`` executable in the environment." -msgstr "" - -#: ../../library/venv.rst:295 -msgid "" -"A placeholder method which can be overridden in third party implementations " -"to pre-install packages in the virtual environment or perform other post-" -"creation steps." -msgstr "" - -#: ../../library/venv.rst:299 -msgid "" -"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " -"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " -"running from a build in the source tree." -msgstr "" - -#: ../../library/venv.rst:304 -msgid "" -"Windows copies the redirector scripts as part of :meth:`setup_python` " -"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " -"symlinks, the original executables will be linked." -msgstr "" - -#: ../../library/venv.rst:309 -msgid "" -"In addition, :class:`EnvBuilder` provides this utility method that can be " -"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " -"assist in installing custom scripts into the virtual environment." -msgstr "" - -#: ../../library/venv.rst:315 -msgid "" -"*path* is the path to a directory that should contain subdirectories " -"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " -"directory in the environment. The contents of \"common\" and the directory " -"corresponding to :data:`os.name` are copied after some text replacement of " -"placeholders:" -msgstr "" - -#: ../../library/venv.rst:321 -msgid "" -"``__VENV_DIR__`` is replaced with the absolute path of the environment " -"directory." -msgstr "" - -#: ../../library/venv.rst:324 -msgid "" -"``__VENV_NAME__`` is replaced with the environment name (final path segment " -"of environment directory)." -msgstr "" - -#: ../../library/venv.rst:327 -msgid "" -"``__VENV_PROMPT__`` is replaced with the prompt (the environment name " -"surrounded by parentheses and with a following space)" -msgstr "" - -#: ../../library/venv.rst:330 -msgid "" -"``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " -"``bin`` or ``Scripts``)." -msgstr "" - -#: ../../library/venv.rst:333 -msgid "" -"``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " -"executable." -msgstr "" - -#: ../../library/venv.rst:336 -msgid "" -"The directories are allowed to exist (for when an existing environment is " -"being upgraded)." -msgstr "" - -#: ../../library/venv.rst:339 -msgid "There is also a module-level convenience function:" -msgstr "" - -#: ../../library/venv.rst:345 -msgid "" -"Create an :class:`EnvBuilder` with the given keyword arguments, and call " -"its :meth:`~EnvBuilder.create` method with the *env_dir* argument." -msgstr "" - -#: ../../library/venv.rst:360 -msgid "An example of extending ``EnvBuilder``" -msgstr "" - -#: ../../library/venv.rst:362 -msgid "" -"The following script shows how to extend :class:`EnvBuilder` by implementing " -"a subclass which installs setuptools and pip into a created virtual " -"environment::" -msgstr "" - -#: ../../library/venv.rst:581 -msgid "" -"This script is also available for download `online `_." -msgstr "" - -#: ../../library/venv.rst:14 -msgid "Environments" -msgstr "Environments (環境)" - -#: ../../library/venv.rst:14 -msgid "virtual" -msgstr "virtual (虛擬)" +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2022, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: Python 3.11\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"PO-Revision-Date: 2018-05-23 16:15+0000\n" +"Last-Translator: Adrian Liaw \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../../library/venv.rst:2 +msgid ":mod:`venv` --- Creation of virtual environments" +msgstr "" + +#: ../../library/venv.rst:12 +msgid "**Source code:** :source:`Lib/venv/`" +msgstr "**原始碼:**\\ :source:`Lib/venv/`" + +#: ../../library/venv.rst:21 +msgid "" +"The :mod:`!venv` module supports creating lightweight \"virtual " +"environments\", each with their own independent set of Python packages " +"installed in their :mod:`site` directories. A virtual environment is created " +"on top of an existing Python installation, known as the virtual " +"environment's \"base\" Python, and may optionally be isolated from the " +"packages in the base environment, so only those explicitly installed in the " +"virtual environment are available." +msgstr "" + +#: ../../library/venv.rst:29 +msgid "" +"When used from within a virtual environment, common installation tools such " +"as `pip`_ will install Python packages into a virtual environment without " +"needing to be told to do so explicitly." +msgstr "" + +#: ../../library/venv.rst:33 +msgid "See :pep:`405` for more background on Python virtual environments." +msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" + +#: ../../library/venv.rst:37 +msgid "" +"`Python Packaging User Guide: Creating and using virtual environments " +"`__" +msgstr "" + +#: ../../includes/wasm-notavail.rst:3 +msgid ":ref:`Availability `: not Emscripten, not WASI." +msgstr "" + +#: ../../includes/wasm-notavail.rst:5 +msgid "" +"This module does not work or is not available on WebAssembly platforms " +"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " +"more information." +msgstr "" + +#: ../../library/venv.rst:43 +msgid "Creating virtual environments" +msgstr "" + +#: ../../using/venv-create.inc:1 +msgid "" +"Creation of :ref:`virtual environments ` is done by executing the " +"command ``venv``::" +msgstr "" + +#: ../../using/venv-create.inc:6 +msgid "" +"Running this command creates the target directory (creating any parent " +"directories that don't exist already) and places a ``pyvenv.cfg`` file in it " +"with a ``home`` key pointing to the Python installation from which the " +"command was run (a common name for the target directory is ``.venv``). It " +"also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a " +"copy/symlink of the Python binary/binaries (as appropriate for the platform " +"or arguments used at environment creation time). It also creates an " +"(initially empty) ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, " +"this is ``Lib\\site-packages``). If an existing directory is specified, it " +"will be re-used." +msgstr "" + +#: ../../using/venv-create.inc:17 +msgid "" +"``pyvenv`` was the recommended tool for creating virtual environments for " +"Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." +msgstr "" + +#: ../../using/venv-create.inc:22 +msgid "" +"The use of ``venv`` is now recommended for creating virtual environments." +msgstr "" + +#: ../../using/venv-create.inc:27 +msgid "On Windows, invoke the ``venv`` command as follows::" +msgstr "" + +#: ../../using/venv-create.inc:31 +msgid "" +"Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables for " +"your :ref:`Python installation `::" +msgstr "" + +#: ../../using/venv-create.inc:36 +msgid "The command, if run with ``-h``, will show the available options::" +msgstr "" + +#: ../../using/venv-create.inc:70 +msgid "" +"Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " +"PyPI" +msgstr "" + +#: ../../using/venv-create.inc:73 +msgid "" +"Installs pip by default, added the ``--without-pip`` and ``--copies`` " +"options" +msgstr "" + +#: ../../using/venv-create.inc:77 +msgid "" +"In earlier versions, if the target directory already existed, an error was " +"raised, unless the ``--clear`` or ``--upgrade`` option was provided." +msgstr "" + +#: ../../using/venv-create.inc:82 +msgid "" +"While symlinks are supported on Windows, they are not recommended. Of " +"particular note is that double-clicking ``python.exe`` in File Explorer will " +"resolve the symlink eagerly and ignore the virtual environment." +msgstr "" + +#: ../../using/venv-create.inc:87 +msgid "" +"On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " +"script by setting the execution policy for the user. You can do this by " +"issuing the following PowerShell command:" +msgstr "" + +#: ../../using/venv-create.inc:91 +msgid "" +"PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" +msgstr "" + +#: ../../using/venv-create.inc:93 +msgid "" +"See `About Execution Policies `_ for more information." +msgstr "" + +#: ../../using/venv-create.inc:97 +msgid "" +"The created ``pyvenv.cfg`` file also includes the ``include-system-site-" +"packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" +"packages`` option, ``false`` otherwise." +msgstr "" + +#: ../../using/venv-create.inc:101 +msgid "" +"Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " +"invoked to bootstrap ``pip`` into the virtual environment." +msgstr "" + +#: ../../using/venv-create.inc:104 +msgid "" +"Multiple paths can be given to ``venv``, in which case an identical virtual " +"environment will be created, according to the given options, at each " +"provided path." +msgstr "" + +#: ../../library/venv.rst:50 +msgid "How venvs work" +msgstr "" + +#: ../../library/venv.rst:52 +msgid "" +"When a Python interpreter is running from a virtual environment, :data:`sys." +"prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " +"environment, whereas :data:`sys.base_prefix` and :data:`sys." +"base_exec_prefix` point to those of the base Python used to create the " +"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " +"determine if the current interpreter is running from a virtual environment." +msgstr "" + +#: ../../library/venv.rst:61 +msgid "" +"A virtual environment may be \"activated\" using a script in its binary " +"directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " +"directory to your :envvar:`!PATH`, so that running :program:`python` will " +"invoke the environment's Python interpreter and you can run installed " +"scripts without having to use their full path. The invocation of the " +"activation script is platform-specific (:samp:`{}` must be replaced by " +"the path to the directory containing the virtual environment):" +msgstr "" + +#: ../../library/venv.rst:71 +msgid "Platform" +msgstr "平台" + +#: ../../library/venv.rst:71 +msgid "Shell" +msgstr "" + +#: ../../library/venv.rst:71 +msgid "Command to activate virtual environment" +msgstr "" + +#: ../../library/venv.rst:73 +msgid "POSIX" +msgstr "POSIX" + +#: ../../library/venv.rst:73 +msgid "bash/zsh" +msgstr "bash/zsh" + +#: ../../library/venv.rst:73 +msgid ":samp:`$ source {}/bin/activate`" +msgstr ":samp:`$ source {}/bin/activate`" + +#: ../../library/venv.rst:75 +msgid "fish" +msgstr "fish" + +#: ../../library/venv.rst:75 +msgid ":samp:`$ source {}/bin/activate.fish`" +msgstr ":samp:`$ source {}/bin/activate.fish`" + +#: ../../library/venv.rst:77 +msgid "csh/tcsh" +msgstr "csh/tcsh" + +#: ../../library/venv.rst:77 +msgid ":samp:`$ source {}/bin/activate.csh`" +msgstr ":samp:`$ source {}/bin/activate.csh`" + +#: ../../library/venv.rst:79 ../../library/venv.rst:83 +msgid "PowerShell" +msgstr "PowerShell" + +#: ../../library/venv.rst:79 +msgid ":samp:`$ {}/bin/Activate.ps1`" +msgstr ":samp:`$ {}/bin/Activate.ps1`" + +#: ../../library/venv.rst:81 +msgid "Windows" +msgstr "Windows" + +#: ../../library/venv.rst:81 +msgid "cmd.exe" +msgstr "cmd.exe" + +#: ../../library/venv.rst:81 +msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" +msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" + +#: ../../library/venv.rst:83 +msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" +msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" + +#: ../../library/venv.rst:86 +msgid ":program:`fish` and :program:`csh` activation scripts." +msgstr "" + +#: ../../library/venv.rst:89 +msgid "" +"PowerShell activation scripts installed under POSIX for PowerShell Core " +"support." +msgstr "" + +#: ../../library/venv.rst:93 +msgid "" +"You don't specifically *need* to activate a virtual environment, as you can " +"just specify the full path to that environment's Python interpreter when " +"invoking Python. Furthermore, all scripts installed in the environment " +"should be runnable without activating it." +msgstr "" + +#: ../../library/venv.rst:99 +msgid "" +"In order to achieve this, scripts installed into virtual environments have a " +"\"shebang\" line which points to the environment's Python interpreter, i.e. :" +"samp:`#!/{}/bin/python`. This means that the script will run " +"with that interpreter regardless of the value of :envvar:`!PATH`. On " +"Windows, \"shebang\" line processing is supported if you have the :ref:" +"`launcher` installed. Thus, double-clicking an installed script in a Windows " +"Explorer window should run it with the correct interpreter without the " +"environment needing to be activated or on the :envvar:`!PATH`." +msgstr "" + +#: ../../library/venv.rst:108 +msgid "" +"When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " +"environment variable is set to the path of the environment. Since explicitly " +"activating a virtual environment is not required to use it, :envvar:`!" +"VIRTUAL_ENV` cannot be relied upon to determine whether a virtual " +"environment is being used." +msgstr "" + +#: ../../library/venv.rst:114 +msgid "" +"Because scripts installed in environments should not expect the environment " +"to be activated, their shebang lines contain the absolute paths to their " +"environment's interpreters. Because of this, environments are inherently non-" +"portable, in the general case. You should always have a simple means of " +"recreating an environment (for example, if you have a requirements file " +"``requirements.txt``, you can invoke ``pip install -r requirements.txt`` " +"using the environment's ``pip`` to install all of the packages needed by the " +"environment). If for any reason you need to move the environment to a new " +"location, you should recreate it at the desired location and delete the one " +"at the old location. If you move an environment because you moved a parent " +"directory of it, you should recreate the environment in its new location. " +"Otherwise, software installed into the environment may not work as expected." +msgstr "" + +#: ../../library/venv.rst:128 +msgid "" +"You can deactivate a virtual environment by typing ``deactivate`` in your " +"shell. The exact mechanism is platform-specific and is an internal " +"implementation detail (typically, a script or shell function will be used)." +msgstr "" + +#: ../../library/venv.rst:136 +msgid "API" +msgstr "API" + +#: ../../library/venv.rst:140 +msgid "" +"The high-level method described above makes use of a simple API which " +"provides mechanisms for third-party virtual environment creators to " +"customize environment creation according to their needs, the :class:" +"`EnvBuilder` class." +msgstr "" +"將上述提到的高階 method(方法)作為簡單的 API 使用," +"可為第三方虛擬環境創造者提供使用機制," +"並依據他們的需求,客製化創造環境:the :class:" +"`EnvBuilder` class (類別)。" + +#: ../../library/venv.rst:148 +msgid "" +"The :class:`EnvBuilder` class accepts the following keyword arguments on " +"instantiation:" +msgstr "" +"class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數" +"以進行實例化" + +#: ../../library/venv.rst:151 +msgid "" +"``system_site_packages`` -- a Boolean value indicating that the system " +"Python site-packages should be available to the environment (defaults to " +"``False``)." +msgstr "" +"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的" +"Python site-packages 是否可以在環境中可用(預設為" +"false)。" + +#: ../../library/venv.rst:154 +msgid "" +"``clear`` -- a Boolean value which, if true, will delete the contents of any " +"existing target directory, before creating the environment." +msgstr "" +"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除" +"目標路徑內所有存在的內容。" + +#: ../../library/venv.rst:157 +msgid "" +"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " +"Python binary rather than copying." +msgstr "" +"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建立符號連結" +"而不是複製該檔案。" + +#: ../../library/venv.rst:160 +msgid "" +"``upgrade`` -- a Boolean value which, if true, will upgrade an existing " +"environment with the running Python - for use when that Python has been " +"upgraded in-place (defaults to ``False``)." +msgstr "" +"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時" +"為現有的環境進行升級。目的是讓 Python 可以" +"升級到位(預設為 False)。" + +#: ../../library/venv.rst:164 +msgid "" +"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " +"the virtual environment. This uses :mod:`ensurepip` with the ``--default-" +"pip`` option." +msgstr "" +"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至" +"虛擬環境之中。當有 ``--default-pip`` 的選項時," +"會使用 :mod:`ensurepip`。" + +#: ../../library/venv.rst:168 +msgid "" +"``prompt`` -- a String to be used after virtual environment is activated " +"(defaults to ``None`` which means directory name of the environment would be " +"used). If the special string ``\".\"`` is provided, the basename of the " +"current directory is used as the prompt." +msgstr "" +"``prompt`` -- 為一個 String(字串) " +"" +"" +"" + +#: ../../library/venv.rst:173 +msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" +msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本。" + +#: ../../library/venv.rst:175 ../../library/venv.rst:350 +msgid "Added the ``with_pip`` parameter" +msgstr "新增 ``with_pip`` 參數" + +#: ../../library/venv.rst:178 ../../library/venv.rst:353 +msgid "Added the ``prompt`` parameter" +msgstr "新增 ``prompt`` 參數" + +#: ../../library/venv.rst:181 ../../library/venv.rst:356 +msgid "Added the ``upgrade_deps`` parameter" +msgstr "新增 ``upgrade_deps`` 參數" + +#: ../../library/venv.rst:184 +msgid "" +"Creators of third-party virtual environment tools will be free to use the " +"provided :class:`EnvBuilder` class as a base class." +msgstr "" + +#: ../../library/venv.rst:187 +msgid "The returned env-builder is an object which has a method, ``create``:" +msgstr "" + +#: ../../library/venv.rst:191 +msgid "" +"Create a virtual environment by specifying the target directory (absolute or " +"relative to the current directory) which is to contain the virtual " +"environment. The ``create`` method will either create the environment in " +"the specified directory, or raise an appropriate exception." +msgstr "" + +#: ../../library/venv.rst:197 +msgid "" +"The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " +"available for subclass customization::" +msgstr "" + +#: ../../library/venv.rst:212 +msgid "" +"Each of the methods :meth:`ensure_directories`, :meth:" +"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" +"meth:`post_setup` can be overridden." +msgstr "" + +#: ../../library/venv.rst:218 +msgid "" +"Creates the environment directory and all necessary subdirectories that " +"don't already exist, and returns a context object. This context object is " +"just a holder for attributes (such as paths) for use by the other methods. " +"If the :class:`EnvBuilder` is created with the arg ``clear=True``, contents " +"of the environment directory will be cleared and then all necessary " +"subdirectories will be recreated." +msgstr "" +"" + +#: ../../library/venv.rst:225 +msgid "" +"The returned context object is a :class:`types.SimpleNamespace` with the " +"following attributes:" +msgstr "" + +#: ../../library/venv.rst:228 +msgid "" +"``env_dir`` - The location of the virtual environment. Used for " +"``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:231 +msgid "" +"``env_name`` - The name of the virtual environment. Used for " +"``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:234 +msgid "" +"``prompt`` - The prompt to be used by the activation scripts. Used for " +"``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:237 +msgid "" +"``executable`` - The underlying Python executable used by the virtual " +"environment. This takes into account the case where a virtual environment is " +"created from another virtual environment." +msgstr "" + +#: ../../library/venv.rst:241 +msgid "``inc_path`` - The include path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:243 +msgid "``lib_path`` - The purelib path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:245 +msgid "``bin_path`` - The script path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:247 +msgid "" +"``bin_name`` - The name of the script path relative to the virtual " +"environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " +"(see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:251 +msgid "" +"``env_exe`` - The name of the Python interpreter in the virtual environment. " +"Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" +"`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:255 +msgid "" +"``env_exec_cmd`` - The name of the Python interpreter, taking into account " +"filesystem redirections. This can be used to run Python in the virtual " +"environment." +msgstr "" + +#: ../../library/venv.rst:260 +msgid "" +"The attribute ``lib_path`` was added to the context, and the context object " +"was documented." +msgstr "" + +#: ../../library/venv.rst:264 +msgid "" +"The *venv* :ref:`sysconfig installation scheme ` is used " +"to construct the paths of the created directories." +msgstr "" + +#: ../../library/venv.rst:271 +msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." +msgstr "" + +#: ../../library/venv.rst:275 +msgid "" +"Creates a copy or symlink to the Python executable in the environment. On " +"POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " +"``python`` and ``python3`` will be created pointing to that executable, " +"unless files with those names already exist." +msgstr "" + +#: ../../library/venv.rst:282 +msgid "" +"Installs activation scripts appropriate to the platform into the virtual " +"environment." +msgstr "" + +#: ../../library/venv.rst:287 +msgid "" +"Upgrades the core venv dependency packages (currently ``pip`` and " +"``setuptools``) in the environment. This is done by shelling out to the " +"``pip`` executable in the environment." +msgstr "" + +#: ../../library/venv.rst:295 +msgid "" +"A placeholder method which can be overridden in third party implementations " +"to pre-install packages in the virtual environment or perform other post-" +"creation steps." +msgstr "" + +#: ../../library/venv.rst:299 +msgid "" +"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " +"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " +"running from a build in the source tree." +msgstr "" + +#: ../../library/venv.rst:304 +msgid "" +"Windows copies the redirector scripts as part of :meth:`setup_python` " +"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " +"symlinks, the original executables will be linked." +msgstr "" + +#: ../../library/venv.rst:309 +msgid "" +"In addition, :class:`EnvBuilder` provides this utility method that can be " +"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " +"assist in installing custom scripts into the virtual environment." +msgstr "" + +#: ../../library/venv.rst:315 +msgid "" +"*path* is the path to a directory that should contain subdirectories " +"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " +"directory in the environment. The contents of \"common\" and the directory " +"corresponding to :data:`os.name` are copied after some text replacement of " +"placeholders:" +msgstr "" + +#: ../../library/venv.rst:321 +msgid "" +"``__VENV_DIR__`` is replaced with the absolute path of the environment " +"directory." +msgstr "" + +#: ../../library/venv.rst:324 +msgid "" +"``__VENV_NAME__`` is replaced with the environment name (final path segment " +"of environment directory)." +msgstr "" + +#: ../../library/venv.rst:327 +msgid "" +"``__VENV_PROMPT__`` is replaced with the prompt (the environment name " +"surrounded by parentheses and with a following space)" +msgstr "" + +#: ../../library/venv.rst:330 +msgid "" +"``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " +"``bin`` or ``Scripts``)." +msgstr "" + +#: ../../library/venv.rst:333 +msgid "" +"``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " +"executable." +msgstr "" + +#: ../../library/venv.rst:336 +msgid "" +"The directories are allowed to exist (for when an existing environment is " +"being upgraded)." +msgstr "" + +#: ../../library/venv.rst:339 +msgid "There is also a module-level convenience function:" +msgstr "" + +#: ../../library/venv.rst:345 +msgid "" +"Create an :class:`EnvBuilder` with the given keyword arguments, and call " +"its :meth:`~EnvBuilder.create` method with the *env_dir* argument." +msgstr "" + +#: ../../library/venv.rst:360 +msgid "An example of extending ``EnvBuilder``" +msgstr "" + +#: ../../library/venv.rst:362 +msgid "" +"The following script shows how to extend :class:`EnvBuilder` by implementing " +"a subclass which installs setuptools and pip into a created virtual " +"environment::" +msgstr "" + +#: ../../library/venv.rst:581 +msgid "" +"This script is also available for download `online `_." +msgstr "" + +#: ../../library/venv.rst:14 +msgid "Environments" +msgstr "Environments (環境)" + +#: ../../library/venv.rst:14 +msgid "virtual" +msgstr "virtual (虛擬)" From 6def8e31ed998f5ed48f318cd6ce2bd0c018a6f8 Mon Sep 17 00:00:00 2001 From: rockleona Date: Sun, 9 Jul 2023 13:58:58 +0800 Subject: [PATCH 2/7] Fix Typo on venv.rst:140 --- library/venv.po | 1358 +++++++++++++++++++++++------------------------ 1 file changed, 679 insertions(+), 679 deletions(-) diff --git a/library/venv.po b/library/venv.po index 68c0a2b7ea..f9defc0f0c 100644 --- a/library/venv.po +++ b/library/venv.po @@ -1,679 +1,679 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2018-05-23 16:15+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/venv.rst:2 -msgid ":mod:`venv` --- Creation of virtual environments" -msgstr "" - -#: ../../library/venv.rst:12 -msgid "**Source code:** :source:`Lib/venv/`" -msgstr "**原始碼:**\\ :source:`Lib/venv/`" - -#: ../../library/venv.rst:21 -msgid "" -"The :mod:`!venv` module supports creating lightweight \"virtual " -"environments\", each with their own independent set of Python packages " -"installed in their :mod:`site` directories. A virtual environment is created " -"on top of an existing Python installation, known as the virtual " -"environment's \"base\" Python, and may optionally be isolated from the " -"packages in the base environment, so only those explicitly installed in the " -"virtual environment are available." -msgstr "" - -#: ../../library/venv.rst:29 -msgid "" -"When used from within a virtual environment, common installation tools such " -"as `pip`_ will install Python packages into a virtual environment without " -"needing to be told to do so explicitly." -msgstr "" - -#: ../../library/venv.rst:33 -msgid "See :pep:`405` for more background on Python virtual environments." -msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" - -#: ../../library/venv.rst:37 -msgid "" -"`Python Packaging User Guide: Creating and using virtual environments " -"`__" -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: ../../library/venv.rst:43 -msgid "Creating virtual environments" -msgstr "" - -#: ../../using/venv-create.inc:1 -msgid "" -"Creation of :ref:`virtual environments ` is done by executing the " -"command ``venv``::" -msgstr "" - -#: ../../using/venv-create.inc:6 -msgid "" -"Running this command creates the target directory (creating any parent " -"directories that don't exist already) and places a ``pyvenv.cfg`` file in it " -"with a ``home`` key pointing to the Python installation from which the " -"command was run (a common name for the target directory is ``.venv``). It " -"also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a " -"copy/symlink of the Python binary/binaries (as appropriate for the platform " -"or arguments used at environment creation time). It also creates an " -"(initially empty) ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, " -"this is ``Lib\\site-packages``). If an existing directory is specified, it " -"will be re-used." -msgstr "" - -#: ../../using/venv-create.inc:17 -msgid "" -"``pyvenv`` was the recommended tool for creating virtual environments for " -"Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." -msgstr "" - -#: ../../using/venv-create.inc:22 -msgid "" -"The use of ``venv`` is now recommended for creating virtual environments." -msgstr "" - -#: ../../using/venv-create.inc:27 -msgid "On Windows, invoke the ``venv`` command as follows::" -msgstr "" - -#: ../../using/venv-create.inc:31 -msgid "" -"Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables for " -"your :ref:`Python installation `::" -msgstr "" - -#: ../../using/venv-create.inc:36 -msgid "The command, if run with ``-h``, will show the available options::" -msgstr "" - -#: ../../using/venv-create.inc:70 -msgid "" -"Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " -"PyPI" -msgstr "" - -#: ../../using/venv-create.inc:73 -msgid "" -"Installs pip by default, added the ``--without-pip`` and ``--copies`` " -"options" -msgstr "" - -#: ../../using/venv-create.inc:77 -msgid "" -"In earlier versions, if the target directory already existed, an error was " -"raised, unless the ``--clear`` or ``--upgrade`` option was provided." -msgstr "" - -#: ../../using/venv-create.inc:82 -msgid "" -"While symlinks are supported on Windows, they are not recommended. Of " -"particular note is that double-clicking ``python.exe`` in File Explorer will " -"resolve the symlink eagerly and ignore the virtual environment." -msgstr "" - -#: ../../using/venv-create.inc:87 -msgid "" -"On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " -"script by setting the execution policy for the user. You can do this by " -"issuing the following PowerShell command:" -msgstr "" - -#: ../../using/venv-create.inc:91 -msgid "" -"PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" -msgstr "" - -#: ../../using/venv-create.inc:93 -msgid "" -"See `About Execution Policies `_ for more information." -msgstr "" - -#: ../../using/venv-create.inc:97 -msgid "" -"The created ``pyvenv.cfg`` file also includes the ``include-system-site-" -"packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" -"packages`` option, ``false`` otherwise." -msgstr "" - -#: ../../using/venv-create.inc:101 -msgid "" -"Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " -"invoked to bootstrap ``pip`` into the virtual environment." -msgstr "" - -#: ../../using/venv-create.inc:104 -msgid "" -"Multiple paths can be given to ``venv``, in which case an identical virtual " -"environment will be created, according to the given options, at each " -"provided path." -msgstr "" - -#: ../../library/venv.rst:50 -msgid "How venvs work" -msgstr "" - -#: ../../library/venv.rst:52 -msgid "" -"When a Python interpreter is running from a virtual environment, :data:`sys." -"prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " -"environment, whereas :data:`sys.base_prefix` and :data:`sys." -"base_exec_prefix` point to those of the base Python used to create the " -"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " -"determine if the current interpreter is running from a virtual environment." -msgstr "" - -#: ../../library/venv.rst:61 -msgid "" -"A virtual environment may be \"activated\" using a script in its binary " -"directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`python` will " -"invoke the environment's Python interpreter and you can run installed " -"scripts without having to use their full path. The invocation of the " -"activation script is platform-specific (:samp:`{}` must be replaced by " -"the path to the directory containing the virtual environment):" -msgstr "" - -#: ../../library/venv.rst:71 -msgid "Platform" -msgstr "平台" - -#: ../../library/venv.rst:71 -msgid "Shell" -msgstr "" - -#: ../../library/venv.rst:71 -msgid "Command to activate virtual environment" -msgstr "" - -#: ../../library/venv.rst:73 -msgid "POSIX" -msgstr "POSIX" - -#: ../../library/venv.rst:73 -msgid "bash/zsh" -msgstr "bash/zsh" - -#: ../../library/venv.rst:73 -msgid ":samp:`$ source {}/bin/activate`" -msgstr ":samp:`$ source {}/bin/activate`" - -#: ../../library/venv.rst:75 -msgid "fish" -msgstr "fish" - -#: ../../library/venv.rst:75 -msgid ":samp:`$ source {}/bin/activate.fish`" -msgstr ":samp:`$ source {}/bin/activate.fish`" - -#: ../../library/venv.rst:77 -msgid "csh/tcsh" -msgstr "csh/tcsh" - -#: ../../library/venv.rst:77 -msgid ":samp:`$ source {}/bin/activate.csh`" -msgstr ":samp:`$ source {}/bin/activate.csh`" - -#: ../../library/venv.rst:79 ../../library/venv.rst:83 -msgid "PowerShell" -msgstr "PowerShell" - -#: ../../library/venv.rst:79 -msgid ":samp:`$ {}/bin/Activate.ps1`" -msgstr ":samp:`$ {}/bin/Activate.ps1`" - -#: ../../library/venv.rst:81 -msgid "Windows" -msgstr "Windows" - -#: ../../library/venv.rst:81 -msgid "cmd.exe" -msgstr "cmd.exe" - -#: ../../library/venv.rst:81 -msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" - -#: ../../library/venv.rst:83 -msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" - -#: ../../library/venv.rst:86 -msgid ":program:`fish` and :program:`csh` activation scripts." -msgstr "" - -#: ../../library/venv.rst:89 -msgid "" -"PowerShell activation scripts installed under POSIX for PowerShell Core " -"support." -msgstr "" - -#: ../../library/venv.rst:93 -msgid "" -"You don't specifically *need* to activate a virtual environment, as you can " -"just specify the full path to that environment's Python interpreter when " -"invoking Python. Furthermore, all scripts installed in the environment " -"should be runnable without activating it." -msgstr "" - -#: ../../library/venv.rst:99 -msgid "" -"In order to achieve this, scripts installed into virtual environments have a " -"\"shebang\" line which points to the environment's Python interpreter, i.e. :" -"samp:`#!/{}/bin/python`. This means that the script will run " -"with that interpreter regardless of the value of :envvar:`!PATH`. On " -"Windows, \"shebang\" line processing is supported if you have the :ref:" -"`launcher` installed. Thus, double-clicking an installed script in a Windows " -"Explorer window should run it with the correct interpreter without the " -"environment needing to be activated or on the :envvar:`!PATH`." -msgstr "" - -#: ../../library/venv.rst:108 -msgid "" -"When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " -"environment variable is set to the path of the environment. Since explicitly " -"activating a virtual environment is not required to use it, :envvar:`!" -"VIRTUAL_ENV` cannot be relied upon to determine whether a virtual " -"environment is being used." -msgstr "" - -#: ../../library/venv.rst:114 -msgid "" -"Because scripts installed in environments should not expect the environment " -"to be activated, their shebang lines contain the absolute paths to their " -"environment's interpreters. Because of this, environments are inherently non-" -"portable, in the general case. You should always have a simple means of " -"recreating an environment (for example, if you have a requirements file " -"``requirements.txt``, you can invoke ``pip install -r requirements.txt`` " -"using the environment's ``pip`` to install all of the packages needed by the " -"environment). If for any reason you need to move the environment to a new " -"location, you should recreate it at the desired location and delete the one " -"at the old location. If you move an environment because you moved a parent " -"directory of it, you should recreate the environment in its new location. " -"Otherwise, software installed into the environment may not work as expected." -msgstr "" - -#: ../../library/venv.rst:128 -msgid "" -"You can deactivate a virtual environment by typing ``deactivate`` in your " -"shell. The exact mechanism is platform-specific and is an internal " -"implementation detail (typically, a script or shell function will be used)." -msgstr "" - -#: ../../library/venv.rst:136 -msgid "API" -msgstr "API" - -#: ../../library/venv.rst:140 -msgid "" -"The high-level method described above makes use of a simple API which " -"provides mechanisms for third-party virtual environment creators to " -"customize environment creation according to their needs, the :class:" -"`EnvBuilder` class." -msgstr "" -"將上述提到的高階 method(方法)作為簡單的 API 使用," -"可為第三方虛擬環境創造者提供使用機制," -"並依據他們的需求,客製化創造環境:the :class:" -"`EnvBuilder` class (類別)。" - -#: ../../library/venv.rst:148 -msgid "" -"The :class:`EnvBuilder` class accepts the following keyword arguments on " -"instantiation:" -msgstr "" -"class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數" -"以進行實例化" - -#: ../../library/venv.rst:151 -msgid "" -"``system_site_packages`` -- a Boolean value indicating that the system " -"Python site-packages should be available to the environment (defaults to " -"``False``)." -msgstr "" -"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的" -"Python site-packages 是否可以在環境中可用(預設為" -"false)。" - -#: ../../library/venv.rst:154 -msgid "" -"``clear`` -- a Boolean value which, if true, will delete the contents of any " -"existing target directory, before creating the environment." -msgstr "" -"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除" -"目標路徑內所有存在的內容。" - -#: ../../library/venv.rst:157 -msgid "" -"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " -"Python binary rather than copying." -msgstr "" -"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建立符號連結" -"而不是複製該檔案。" - -#: ../../library/venv.rst:160 -msgid "" -"``upgrade`` -- a Boolean value which, if true, will upgrade an existing " -"environment with the running Python - for use when that Python has been " -"upgraded in-place (defaults to ``False``)." -msgstr "" -"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時" -"為現有的環境進行升級。目的是讓 Python 可以" -"升級到位(預設為 False)。" - -#: ../../library/venv.rst:164 -msgid "" -"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " -"the virtual environment. This uses :mod:`ensurepip` with the ``--default-" -"pip`` option." -msgstr "" -"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至" -"虛擬環境之中。當有 ``--default-pip`` 的選項時," -"會使用 :mod:`ensurepip`。" - -#: ../../library/venv.rst:168 -msgid "" -"``prompt`` -- a String to be used after virtual environment is activated " -"(defaults to ``None`` which means directory name of the environment would be " -"used). If the special string ``\".\"`` is provided, the basename of the " -"current directory is used as the prompt." -msgstr "" -"``prompt`` -- 為一個 String(字串) " -"" -"" -"" - -#: ../../library/venv.rst:173 -msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" -msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本。" - -#: ../../library/venv.rst:175 ../../library/venv.rst:350 -msgid "Added the ``with_pip`` parameter" -msgstr "新增 ``with_pip`` 參數" - -#: ../../library/venv.rst:178 ../../library/venv.rst:353 -msgid "Added the ``prompt`` parameter" -msgstr "新增 ``prompt`` 參數" - -#: ../../library/venv.rst:181 ../../library/venv.rst:356 -msgid "Added the ``upgrade_deps`` parameter" -msgstr "新增 ``upgrade_deps`` 參數" - -#: ../../library/venv.rst:184 -msgid "" -"Creators of third-party virtual environment tools will be free to use the " -"provided :class:`EnvBuilder` class as a base class." -msgstr "" - -#: ../../library/venv.rst:187 -msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "" - -#: ../../library/venv.rst:191 -msgid "" -"Create a virtual environment by specifying the target directory (absolute or " -"relative to the current directory) which is to contain the virtual " -"environment. The ``create`` method will either create the environment in " -"the specified directory, or raise an appropriate exception." -msgstr "" - -#: ../../library/venv.rst:197 -msgid "" -"The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " -"available for subclass customization::" -msgstr "" - -#: ../../library/venv.rst:212 -msgid "" -"Each of the methods :meth:`ensure_directories`, :meth:" -"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" -"meth:`post_setup` can be overridden." -msgstr "" - -#: ../../library/venv.rst:218 -msgid "" -"Creates the environment directory and all necessary subdirectories that " -"don't already exist, and returns a context object. This context object is " -"just a holder for attributes (such as paths) for use by the other methods. " -"If the :class:`EnvBuilder` is created with the arg ``clear=True``, contents " -"of the environment directory will be cleared and then all necessary " -"subdirectories will be recreated." -msgstr "" -"" - -#: ../../library/venv.rst:225 -msgid "" -"The returned context object is a :class:`types.SimpleNamespace` with the " -"following attributes:" -msgstr "" - -#: ../../library/venv.rst:228 -msgid "" -"``env_dir`` - The location of the virtual environment. Used for " -"``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:231 -msgid "" -"``env_name`` - The name of the virtual environment. Used for " -"``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:234 -msgid "" -"``prompt`` - The prompt to be used by the activation scripts. Used for " -"``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:237 -msgid "" -"``executable`` - The underlying Python executable used by the virtual " -"environment. This takes into account the case where a virtual environment is " -"created from another virtual environment." -msgstr "" - -#: ../../library/venv.rst:241 -msgid "``inc_path`` - The include path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:243 -msgid "``lib_path`` - The purelib path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:245 -msgid "``bin_path`` - The script path for the virtual environment." -msgstr "" - -#: ../../library/venv.rst:247 -msgid "" -"``bin_name`` - The name of the script path relative to the virtual " -"environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " -"(see :meth:`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:251 -msgid "" -"``env_exe`` - The name of the Python interpreter in the virtual environment. " -"Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" -"`install_scripts`)." -msgstr "" - -#: ../../library/venv.rst:255 -msgid "" -"``env_exec_cmd`` - The name of the Python interpreter, taking into account " -"filesystem redirections. This can be used to run Python in the virtual " -"environment." -msgstr "" - -#: ../../library/venv.rst:260 -msgid "" -"The attribute ``lib_path`` was added to the context, and the context object " -"was documented." -msgstr "" - -#: ../../library/venv.rst:264 -msgid "" -"The *venv* :ref:`sysconfig installation scheme ` is used " -"to construct the paths of the created directories." -msgstr "" - -#: ../../library/venv.rst:271 -msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." -msgstr "" - -#: ../../library/venv.rst:275 -msgid "" -"Creates a copy or symlink to the Python executable in the environment. On " -"POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " -"``python`` and ``python3`` will be created pointing to that executable, " -"unless files with those names already exist." -msgstr "" - -#: ../../library/venv.rst:282 -msgid "" -"Installs activation scripts appropriate to the platform into the virtual " -"environment." -msgstr "" - -#: ../../library/venv.rst:287 -msgid "" -"Upgrades the core venv dependency packages (currently ``pip`` and " -"``setuptools``) in the environment. This is done by shelling out to the " -"``pip`` executable in the environment." -msgstr "" - -#: ../../library/venv.rst:295 -msgid "" -"A placeholder method which can be overridden in third party implementations " -"to pre-install packages in the virtual environment or perform other post-" -"creation steps." -msgstr "" - -#: ../../library/venv.rst:299 -msgid "" -"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " -"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " -"running from a build in the source tree." -msgstr "" - -#: ../../library/venv.rst:304 -msgid "" -"Windows copies the redirector scripts as part of :meth:`setup_python` " -"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " -"symlinks, the original executables will be linked." -msgstr "" - -#: ../../library/venv.rst:309 -msgid "" -"In addition, :class:`EnvBuilder` provides this utility method that can be " -"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " -"assist in installing custom scripts into the virtual environment." -msgstr "" - -#: ../../library/venv.rst:315 -msgid "" -"*path* is the path to a directory that should contain subdirectories " -"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " -"directory in the environment. The contents of \"common\" and the directory " -"corresponding to :data:`os.name` are copied after some text replacement of " -"placeholders:" -msgstr "" - -#: ../../library/venv.rst:321 -msgid "" -"``__VENV_DIR__`` is replaced with the absolute path of the environment " -"directory." -msgstr "" - -#: ../../library/venv.rst:324 -msgid "" -"``__VENV_NAME__`` is replaced with the environment name (final path segment " -"of environment directory)." -msgstr "" - -#: ../../library/venv.rst:327 -msgid "" -"``__VENV_PROMPT__`` is replaced with the prompt (the environment name " -"surrounded by parentheses and with a following space)" -msgstr "" - -#: ../../library/venv.rst:330 -msgid "" -"``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " -"``bin`` or ``Scripts``)." -msgstr "" - -#: ../../library/venv.rst:333 -msgid "" -"``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " -"executable." -msgstr "" - -#: ../../library/venv.rst:336 -msgid "" -"The directories are allowed to exist (for when an existing environment is " -"being upgraded)." -msgstr "" - -#: ../../library/venv.rst:339 -msgid "There is also a module-level convenience function:" -msgstr "" - -#: ../../library/venv.rst:345 -msgid "" -"Create an :class:`EnvBuilder` with the given keyword arguments, and call " -"its :meth:`~EnvBuilder.create` method with the *env_dir* argument." -msgstr "" - -#: ../../library/venv.rst:360 -msgid "An example of extending ``EnvBuilder``" -msgstr "" - -#: ../../library/venv.rst:362 -msgid "" -"The following script shows how to extend :class:`EnvBuilder` by implementing " -"a subclass which installs setuptools and pip into a created virtual " -"environment::" -msgstr "" - -#: ../../library/venv.rst:581 -msgid "" -"This script is also available for download `online `_." -msgstr "" - -#: ../../library/venv.rst:14 -msgid "Environments" -msgstr "Environments (環境)" - -#: ../../library/venv.rst:14 -msgid "virtual" -msgstr "virtual (虛擬)" +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2022, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: Python 3.11\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"PO-Revision-Date: 2018-05-23 16:15+0000\n" +"Last-Translator: Adrian Liaw \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../../library/venv.rst:2 +msgid ":mod:`venv` --- Creation of virtual environments" +msgstr "" + +#: ../../library/venv.rst:12 +msgid "**Source code:** :source:`Lib/venv/`" +msgstr "**原始碼:**\\ :source:`Lib/venv/`" + +#: ../../library/venv.rst:21 +msgid "" +"The :mod:`!venv` module supports creating lightweight \"virtual " +"environments\", each with their own independent set of Python packages " +"installed in their :mod:`site` directories. A virtual environment is created " +"on top of an existing Python installation, known as the virtual " +"environment's \"base\" Python, and may optionally be isolated from the " +"packages in the base environment, so only those explicitly installed in the " +"virtual environment are available." +msgstr "" + +#: ../../library/venv.rst:29 +msgid "" +"When used from within a virtual environment, common installation tools such " +"as `pip`_ will install Python packages into a virtual environment without " +"needing to be told to do so explicitly." +msgstr "" + +#: ../../library/venv.rst:33 +msgid "See :pep:`405` for more background on Python virtual environments." +msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" + +#: ../../library/venv.rst:37 +msgid "" +"`Python Packaging User Guide: Creating and using virtual environments " +"`__" +msgstr "" + +#: ../../includes/wasm-notavail.rst:3 +msgid ":ref:`Availability `: not Emscripten, not WASI." +msgstr "" + +#: ../../includes/wasm-notavail.rst:5 +msgid "" +"This module does not work or is not available on WebAssembly platforms " +"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " +"more information." +msgstr "" + +#: ../../library/venv.rst:43 +msgid "Creating virtual environments" +msgstr "" + +#: ../../using/venv-create.inc:1 +msgid "" +"Creation of :ref:`virtual environments ` is done by executing the " +"command ``venv``::" +msgstr "" + +#: ../../using/venv-create.inc:6 +msgid "" +"Running this command creates the target directory (creating any parent " +"directories that don't exist already) and places a ``pyvenv.cfg`` file in it " +"with a ``home`` key pointing to the Python installation from which the " +"command was run (a common name for the target directory is ``.venv``). It " +"also creates a ``bin`` (or ``Scripts`` on Windows) subdirectory containing a " +"copy/symlink of the Python binary/binaries (as appropriate for the platform " +"or arguments used at environment creation time). It also creates an " +"(initially empty) ``lib/pythonX.Y/site-packages`` subdirectory (on Windows, " +"this is ``Lib\\site-packages``). If an existing directory is specified, it " +"will be re-used." +msgstr "" + +#: ../../using/venv-create.inc:17 +msgid "" +"``pyvenv`` was the recommended tool for creating virtual environments for " +"Python 3.3 and 3.4, and is :ref:`deprecated in Python 3.6 `." +msgstr "" + +#: ../../using/venv-create.inc:22 +msgid "" +"The use of ``venv`` is now recommended for creating virtual environments." +msgstr "" + +#: ../../using/venv-create.inc:27 +msgid "On Windows, invoke the ``venv`` command as follows::" +msgstr "" + +#: ../../using/venv-create.inc:31 +msgid "" +"Alternatively, if you configured the ``PATH`` and ``PATHEXT`` variables for " +"your :ref:`Python installation `::" +msgstr "" + +#: ../../using/venv-create.inc:36 +msgid "The command, if run with ``-h``, will show the available options::" +msgstr "" + +#: ../../using/venv-create.inc:70 +msgid "" +"Add ``--upgrade-deps`` option to upgrade pip + setuptools to the latest on " +"PyPI" +msgstr "" + +#: ../../using/venv-create.inc:73 +msgid "" +"Installs pip by default, added the ``--without-pip`` and ``--copies`` " +"options" +msgstr "" + +#: ../../using/venv-create.inc:77 +msgid "" +"In earlier versions, if the target directory already existed, an error was " +"raised, unless the ``--clear`` or ``--upgrade`` option was provided." +msgstr "" + +#: ../../using/venv-create.inc:82 +msgid "" +"While symlinks are supported on Windows, they are not recommended. Of " +"particular note is that double-clicking ``python.exe`` in File Explorer will " +"resolve the symlink eagerly and ignore the virtual environment." +msgstr "" + +#: ../../using/venv-create.inc:87 +msgid "" +"On Microsoft Windows, it may be required to enable the ``Activate.ps1`` " +"script by setting the execution policy for the user. You can do this by " +"issuing the following PowerShell command:" +msgstr "" + +#: ../../using/venv-create.inc:91 +msgid "" +"PS C:\\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" +msgstr "" + +#: ../../using/venv-create.inc:93 +msgid "" +"See `About Execution Policies `_ for more information." +msgstr "" + +#: ../../using/venv-create.inc:97 +msgid "" +"The created ``pyvenv.cfg`` file also includes the ``include-system-site-" +"packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-" +"packages`` option, ``false`` otherwise." +msgstr "" + +#: ../../using/venv-create.inc:101 +msgid "" +"Unless the ``--without-pip`` option is given, :mod:`ensurepip` will be " +"invoked to bootstrap ``pip`` into the virtual environment." +msgstr "" + +#: ../../using/venv-create.inc:104 +msgid "" +"Multiple paths can be given to ``venv``, in which case an identical virtual " +"environment will be created, according to the given options, at each " +"provided path." +msgstr "" + +#: ../../library/venv.rst:50 +msgid "How venvs work" +msgstr "" + +#: ../../library/venv.rst:52 +msgid "" +"When a Python interpreter is running from a virtual environment, :data:`sys." +"prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " +"environment, whereas :data:`sys.base_prefix` and :data:`sys." +"base_exec_prefix` point to those of the base Python used to create the " +"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " +"determine if the current interpreter is running from a virtual environment." +msgstr "" + +#: ../../library/venv.rst:61 +msgid "" +"A virtual environment may be \"activated\" using a script in its binary " +"directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " +"directory to your :envvar:`!PATH`, so that running :program:`python` will " +"invoke the environment's Python interpreter and you can run installed " +"scripts without having to use their full path. The invocation of the " +"activation script is platform-specific (:samp:`{}` must be replaced by " +"the path to the directory containing the virtual environment):" +msgstr "" + +#: ../../library/venv.rst:71 +msgid "Platform" +msgstr "平台" + +#: ../../library/venv.rst:71 +msgid "Shell" +msgstr "" + +#: ../../library/venv.rst:71 +msgid "Command to activate virtual environment" +msgstr "" + +#: ../../library/venv.rst:73 +msgid "POSIX" +msgstr "POSIX" + +#: ../../library/venv.rst:73 +msgid "bash/zsh" +msgstr "bash/zsh" + +#: ../../library/venv.rst:73 +msgid ":samp:`$ source {}/bin/activate`" +msgstr ":samp:`$ source {}/bin/activate`" + +#: ../../library/venv.rst:75 +msgid "fish" +msgstr "fish" + +#: ../../library/venv.rst:75 +msgid ":samp:`$ source {}/bin/activate.fish`" +msgstr ":samp:`$ source {}/bin/activate.fish`" + +#: ../../library/venv.rst:77 +msgid "csh/tcsh" +msgstr "csh/tcsh" + +#: ../../library/venv.rst:77 +msgid ":samp:`$ source {}/bin/activate.csh`" +msgstr ":samp:`$ source {}/bin/activate.csh`" + +#: ../../library/venv.rst:79 ../../library/venv.rst:83 +msgid "PowerShell" +msgstr "PowerShell" + +#: ../../library/venv.rst:79 +msgid ":samp:`$ {}/bin/Activate.ps1`" +msgstr ":samp:`$ {}/bin/Activate.ps1`" + +#: ../../library/venv.rst:81 +msgid "Windows" +msgstr "Windows" + +#: ../../library/venv.rst:81 +msgid "cmd.exe" +msgstr "cmd.exe" + +#: ../../library/venv.rst:81 +msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" +msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" + +#: ../../library/venv.rst:83 +msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" +msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" + +#: ../../library/venv.rst:86 +msgid ":program:`fish` and :program:`csh` activation scripts." +msgstr "" + +#: ../../library/venv.rst:89 +msgid "" +"PowerShell activation scripts installed under POSIX for PowerShell Core " +"support." +msgstr "" + +#: ../../library/venv.rst:93 +msgid "" +"You don't specifically *need* to activate a virtual environment, as you can " +"just specify the full path to that environment's Python interpreter when " +"invoking Python. Furthermore, all scripts installed in the environment " +"should be runnable without activating it." +msgstr "" + +#: ../../library/venv.rst:99 +msgid "" +"In order to achieve this, scripts installed into virtual environments have a " +"\"shebang\" line which points to the environment's Python interpreter, i.e. :" +"samp:`#!/{}/bin/python`. This means that the script will run " +"with that interpreter regardless of the value of :envvar:`!PATH`. On " +"Windows, \"shebang\" line processing is supported if you have the :ref:" +"`launcher` installed. Thus, double-clicking an installed script in a Windows " +"Explorer window should run it with the correct interpreter without the " +"environment needing to be activated or on the :envvar:`!PATH`." +msgstr "" + +#: ../../library/venv.rst:108 +msgid "" +"When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " +"environment variable is set to the path of the environment. Since explicitly " +"activating a virtual environment is not required to use it, :envvar:`!" +"VIRTUAL_ENV` cannot be relied upon to determine whether a virtual " +"environment is being used." +msgstr "" + +#: ../../library/venv.rst:114 +msgid "" +"Because scripts installed in environments should not expect the environment " +"to be activated, their shebang lines contain the absolute paths to their " +"environment's interpreters. Because of this, environments are inherently non-" +"portable, in the general case. You should always have a simple means of " +"recreating an environment (for example, if you have a requirements file " +"``requirements.txt``, you can invoke ``pip install -r requirements.txt`` " +"using the environment's ``pip`` to install all of the packages needed by the " +"environment). If for any reason you need to move the environment to a new " +"location, you should recreate it at the desired location and delete the one " +"at the old location. If you move an environment because you moved a parent " +"directory of it, you should recreate the environment in its new location. " +"Otherwise, software installed into the environment may not work as expected." +msgstr "" + +#: ../../library/venv.rst:128 +msgid "" +"You can deactivate a virtual environment by typing ``deactivate`` in your " +"shell. The exact mechanism is platform-specific and is an internal " +"implementation detail (typically, a script or shell function will be used)." +msgstr "" + +#: ../../library/venv.rst:136 +msgid "API" +msgstr "API" + +#: ../../library/venv.rst:140 +msgid "" +"The high-level method described above makes use of a simple API which " +"provides mechanisms for third-party virtual environment creators to " +"customize environment creation according to their needs, the :class:" +"`EnvBuilder` class." +msgstr "" +"將上述提到的高階 method(方法)作為簡單的 API 使用," +"可為第三方虛擬環境創造者提供使用機制," +"並依據他們的需求,客製化創造環境::class:" +"`EnvBuilder`(類別)。" + +#: ../../library/venv.rst:148 +msgid "" +"The :class:`EnvBuilder` class accepts the following keyword arguments on " +"instantiation:" +msgstr "" +"class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數" +"以進行實例化" + +#: ../../library/venv.rst:151 +msgid "" +"``system_site_packages`` -- a Boolean value indicating that the system " +"Python site-packages should be available to the environment (defaults to " +"``False``)." +msgstr "" +"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的" +"Python site-packages 是否可以在環境中可用(預設為" +"false)。" + +#: ../../library/venv.rst:154 +msgid "" +"``clear`` -- a Boolean value which, if true, will delete the contents of any " +"existing target directory, before creating the environment." +msgstr "" +"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除" +"目標路徑內所有存在的內容。" + +#: ../../library/venv.rst:157 +msgid "" +"``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " +"Python binary rather than copying." +msgstr "" +"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建立符號連結" +"而不是複製該檔案。" + +#: ../../library/venv.rst:160 +msgid "" +"``upgrade`` -- a Boolean value which, if true, will upgrade an existing " +"environment with the running Python - for use when that Python has been " +"upgraded in-place (defaults to ``False``)." +msgstr "" +"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時" +"為現有的環境進行升級。目的是讓 Python 可以" +"升級到位(預設為 False)。" + +#: ../../library/venv.rst:164 +msgid "" +"``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " +"the virtual environment. This uses :mod:`ensurepip` with the ``--default-" +"pip`` option." +msgstr "" +"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至" +"虛擬環境之中。當有 ``--default-pip`` 的選項時," +"會使用 :mod:`ensurepip`。" + +#: ../../library/venv.rst:168 +msgid "" +"``prompt`` -- a String to be used after virtual environment is activated " +"(defaults to ``None`` which means directory name of the environment would be " +"used). If the special string ``\".\"`` is provided, the basename of the " +"current directory is used as the prompt." +msgstr "" +"``prompt`` -- 為一個 String(字串) " +"" +"" +"" + +#: ../../library/venv.rst:173 +msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" +msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本。" + +#: ../../library/venv.rst:175 ../../library/venv.rst:350 +msgid "Added the ``with_pip`` parameter" +msgstr "新增 ``with_pip`` 參數" + +#: ../../library/venv.rst:178 ../../library/venv.rst:353 +msgid "Added the ``prompt`` parameter" +msgstr "新增 ``prompt`` 參數" + +#: ../../library/venv.rst:181 ../../library/venv.rst:356 +msgid "Added the ``upgrade_deps`` parameter" +msgstr "新增 ``upgrade_deps`` 參數" + +#: ../../library/venv.rst:184 +msgid "" +"Creators of third-party virtual environment tools will be free to use the " +"provided :class:`EnvBuilder` class as a base class." +msgstr "" + +#: ../../library/venv.rst:187 +msgid "The returned env-builder is an object which has a method, ``create``:" +msgstr "" + +#: ../../library/venv.rst:191 +msgid "" +"Create a virtual environment by specifying the target directory (absolute or " +"relative to the current directory) which is to contain the virtual " +"environment. The ``create`` method will either create the environment in " +"the specified directory, or raise an appropriate exception." +msgstr "" + +#: ../../library/venv.rst:197 +msgid "" +"The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " +"available for subclass customization::" +msgstr "" + +#: ../../library/venv.rst:212 +msgid "" +"Each of the methods :meth:`ensure_directories`, :meth:" +"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" +"meth:`post_setup` can be overridden." +msgstr "" + +#: ../../library/venv.rst:218 +msgid "" +"Creates the environment directory and all necessary subdirectories that " +"don't already exist, and returns a context object. This context object is " +"just a holder for attributes (such as paths) for use by the other methods. " +"If the :class:`EnvBuilder` is created with the arg ``clear=True``, contents " +"of the environment directory will be cleared and then all necessary " +"subdirectories will be recreated." +msgstr "" +"" + +#: ../../library/venv.rst:225 +msgid "" +"The returned context object is a :class:`types.SimpleNamespace` with the " +"following attributes:" +msgstr "" + +#: ../../library/venv.rst:228 +msgid "" +"``env_dir`` - The location of the virtual environment. Used for " +"``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:231 +msgid "" +"``env_name`` - The name of the virtual environment. Used for " +"``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:234 +msgid "" +"``prompt`` - The prompt to be used by the activation scripts. Used for " +"``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:237 +msgid "" +"``executable`` - The underlying Python executable used by the virtual " +"environment. This takes into account the case where a virtual environment is " +"created from another virtual environment." +msgstr "" + +#: ../../library/venv.rst:241 +msgid "``inc_path`` - The include path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:243 +msgid "``lib_path`` - The purelib path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:245 +msgid "``bin_path`` - The script path for the virtual environment." +msgstr "" + +#: ../../library/venv.rst:247 +msgid "" +"``bin_name`` - The name of the script path relative to the virtual " +"environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " +"(see :meth:`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:251 +msgid "" +"``env_exe`` - The name of the Python interpreter in the virtual environment. " +"Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" +"`install_scripts`)." +msgstr "" + +#: ../../library/venv.rst:255 +msgid "" +"``env_exec_cmd`` - The name of the Python interpreter, taking into account " +"filesystem redirections. This can be used to run Python in the virtual " +"environment." +msgstr "" + +#: ../../library/venv.rst:260 +msgid "" +"The attribute ``lib_path`` was added to the context, and the context object " +"was documented." +msgstr "" + +#: ../../library/venv.rst:264 +msgid "" +"The *venv* :ref:`sysconfig installation scheme ` is used " +"to construct the paths of the created directories." +msgstr "" + +#: ../../library/venv.rst:271 +msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." +msgstr "" + +#: ../../library/venv.rst:275 +msgid "" +"Creates a copy or symlink to the Python executable in the environment. On " +"POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " +"``python`` and ``python3`` will be created pointing to that executable, " +"unless files with those names already exist." +msgstr "" + +#: ../../library/venv.rst:282 +msgid "" +"Installs activation scripts appropriate to the platform into the virtual " +"environment." +msgstr "" + +#: ../../library/venv.rst:287 +msgid "" +"Upgrades the core venv dependency packages (currently ``pip`` and " +"``setuptools``) in the environment. This is done by shelling out to the " +"``pip`` executable in the environment." +msgstr "" + +#: ../../library/venv.rst:295 +msgid "" +"A placeholder method which can be overridden in third party implementations " +"to pre-install packages in the virtual environment or perform other post-" +"creation steps." +msgstr "" + +#: ../../library/venv.rst:299 +msgid "" +"Windows now uses redirector scripts for ``python[w].exe`` instead of copying " +"the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " +"running from a build in the source tree." +msgstr "" + +#: ../../library/venv.rst:304 +msgid "" +"Windows copies the redirector scripts as part of :meth:`setup_python` " +"instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " +"symlinks, the original executables will be linked." +msgstr "" + +#: ../../library/venv.rst:309 +msgid "" +"In addition, :class:`EnvBuilder` provides this utility method that can be " +"called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " +"assist in installing custom scripts into the virtual environment." +msgstr "" + +#: ../../library/venv.rst:315 +msgid "" +"*path* is the path to a directory that should contain subdirectories " +"\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " +"directory in the environment. The contents of \"common\" and the directory " +"corresponding to :data:`os.name` are copied after some text replacement of " +"placeholders:" +msgstr "" + +#: ../../library/venv.rst:321 +msgid "" +"``__VENV_DIR__`` is replaced with the absolute path of the environment " +"directory." +msgstr "" + +#: ../../library/venv.rst:324 +msgid "" +"``__VENV_NAME__`` is replaced with the environment name (final path segment " +"of environment directory)." +msgstr "" + +#: ../../library/venv.rst:327 +msgid "" +"``__VENV_PROMPT__`` is replaced with the prompt (the environment name " +"surrounded by parentheses and with a following space)" +msgstr "" + +#: ../../library/venv.rst:330 +msgid "" +"``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " +"``bin`` or ``Scripts``)." +msgstr "" + +#: ../../library/venv.rst:333 +msgid "" +"``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " +"executable." +msgstr "" + +#: ../../library/venv.rst:336 +msgid "" +"The directories are allowed to exist (for when an existing environment is " +"being upgraded)." +msgstr "" + +#: ../../library/venv.rst:339 +msgid "There is also a module-level convenience function:" +msgstr "" + +#: ../../library/venv.rst:345 +msgid "" +"Create an :class:`EnvBuilder` with the given keyword arguments, and call " +"its :meth:`~EnvBuilder.create` method with the *env_dir* argument." +msgstr "" + +#: ../../library/venv.rst:360 +msgid "An example of extending ``EnvBuilder``" +msgstr "" + +#: ../../library/venv.rst:362 +msgid "" +"The following script shows how to extend :class:`EnvBuilder` by implementing " +"a subclass which installs setuptools and pip into a created virtual " +"environment::" +msgstr "" + +#: ../../library/venv.rst:581 +msgid "" +"This script is also available for download `online `_." +msgstr "" + +#: ../../library/venv.rst:14 +msgid "Environments" +msgstr "Environments (環境)" + +#: ../../library/venv.rst:14 +msgid "virtual" +msgstr "virtual (虛擬)" From d49110014cc32bf5063a458a1a7307dbd2f0fd77 Mon Sep 17 00:00:00 2001 From: rockleona Date: Sun, 9 Jul 2023 16:16:05 +0800 Subject: [PATCH 3/7] =?UTF-8?q?1.=20Fix=20Typo=20'=E7=9B=AE=E9=8C=84'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2. Finish translate until venv.rst:218 --- library/venv.po | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/library/venv.po b/library/venv.po index f9defc0f0c..6e73f7a229 100644 --- a/library/venv.po +++ b/library/venv.po @@ -361,7 +361,7 @@ msgid "" msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的" "Python site-packages 是否可以在環境中可用(預設為" -"false)。" +"``False``)。" #: ../../library/venv.rst:154 msgid "" @@ -369,7 +369,7 @@ msgid "" "existing target directory, before creating the environment." msgstr "" "``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除" -"目標路徑內所有存在的內容。" +"目標目錄內所有存在的內容。" #: ../../library/venv.rst:157 msgid "" @@ -387,7 +387,7 @@ msgid "" msgstr "" "``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時" "為現有的環境進行升級。目的是讓 Python 可以" -"升級到位(預設為 False)。" +"升級到位(預設為 ``False``)。" #: ../../library/venv.rst:164 msgid "" @@ -399,6 +399,7 @@ msgstr "" "虛擬環境之中。當有 ``--default-pip`` 的選項時," "會使用 :mod:`ensurepip`。" +# fuzzy #: ../../library/venv.rst:168 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " @@ -406,10 +407,10 @@ msgid "" "used). If the special string ``\".\"`` is provided, the basename of the " "current directory is used as the prompt." msgstr "" -"``prompt`` -- 為一個 String(字串) " -"" -"" -"" +"``prompt`` -- 為一個 String(字串),該字串會在虛擬環境啟動時被使用。" +"(預設為 ``None``,代表該環境的目錄名稱會被使用)" +"倘若出現特殊字串 ``\".\"`` ,則當前目錄的 basename" +" 會做為提示路徑使用。" #: ../../library/venv.rst:173 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" @@ -432,10 +433,12 @@ msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." msgstr "" +"第三方虛擬環境工具的創造者可以自由地使用" +" :class:`EnvBuilder` class(類別)作為 base class(基礎類別)使用" #: ../../library/venv.rst:187 msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "" +msgstr "回傳的 env-buuilder 為一個物件,且帶有一個 method(方法):``create``。" #: ../../library/venv.rst:191 msgid "" @@ -444,12 +447,18 @@ msgid "" "environment. The ``create`` method will either create the environment in " "the specified directory, or raise an appropriate exception." msgstr "" +"創造一個虛擬環境並指定目標目錄(絕對路徑或" +"相對路徑到該目錄),也就是在該目錄中容納虛擬環境。" +"``create`` method(方法)將會在指定的目錄下創建環境," +"或是觸發適當的例外。" #: ../../library/venv.rst:197 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" msgstr "" +":class:`EnvBuilder` class(類別)的``create`` method(方法)會闡述" +"可用的 Hooks 以客製化 subclass (子類別)::" #: ../../library/venv.rst:212 msgid "" @@ -457,6 +466,9 @@ msgid "" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" "meth:`post_setup` can be overridden." msgstr "" +"每個 methods(方法) :meth:`ensure_directories`, :meth:" +"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` 及 :" +"meth:`post_setup` 都可以被覆寫." #: ../../library/venv.rst:218 msgid "" @@ -467,7 +479,12 @@ msgid "" "of the environment directory will be cleared and then all necessary " "subdirectories will be recreated." msgstr "" -"" +"創造不存在的環境目錄及必要的子目錄,並回傳一個 context object。" +"這個 context object 只是一個屬性 (例如:路徑) 的所有者" +",可被其他 method(方法)使用。" +"如果 :class:`EnvBuilder` 已被創造且帶有 ``clear=True`` 的引數," +"該環境目錄下的內容將被清空,以及所有必要的" +"子目錄將被重新創造。" #: ../../library/venv.rst:225 msgid "" From be41e5c413cc80b7c96c8771116ba3f559f7847a Mon Sep 17 00:00:00 2001 From: rockleona Date: Sun, 9 Jul 2023 17:45:11 +0800 Subject: [PATCH 4/7] Fix Format with poedit --- library/venv.po | 78 +++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/library/venv.po b/library/venv.po index 6e73f7a229..4a7ce20da5 100644 --- a/library/venv.po +++ b/library/venv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-05-09 00:15+0000\n" -"PO-Revision-Date: 2018-05-23 16:15+0000\n" +"PO-Revision-Date: 2023-07-09 17:41+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: ../../library/venv.rst:2 msgid ":mod:`venv` --- Creation of virtual environments" @@ -340,18 +341,15 @@ msgid "" "customize environment creation according to their needs, the :class:" "`EnvBuilder` class." msgstr "" -"將上述提到的高階 method(方法)作為簡單的 API 使用," -"可為第三方虛擬環境創造者提供使用機制," -"並依據他們的需求,客製化創造環境::class:" -"`EnvBuilder`(類別)。" +"將上述提到的高階 method(方法)作為簡單的 API 使用, 可為第三方虛擬環境創造者" +"提供使用機制, 並依據他們的需求,客製化創造環境: :class:`EnvBuilder`(類" +"別)。" #: ../../library/venv.rst:148 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" -msgstr "" -"class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數" -"以進行實例化" +msgstr "進行實例化時,class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數:" #: ../../library/venv.rst:151 msgid "" @@ -359,25 +357,24 @@ msgid "" "Python site-packages should be available to the environment (defaults to " "``False``)." msgstr "" -"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的" -"Python site-packages 是否可以在環境中可用(預設為" -"``False``)。" +"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的Python " +"site-packages 是否可以在環境中可用(預設為``False``)。" #: ../../library/venv.rst:154 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." msgstr "" -"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除" -"目標目錄內所有存在的內容。" +"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除目" +"標目錄內所有存在的內容。" #: ../../library/venv.rst:157 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." msgstr "" -"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建立符號連結" -"而不是複製該檔案。" +"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建" +"立符號連結而不是複製該檔案。" #: ../../library/venv.rst:160 msgid "" @@ -385,9 +382,8 @@ msgid "" "environment with the running Python - for use when that Python has been " "upgraded in-place (defaults to ``False``)." msgstr "" -"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時" -"為現有的環境進行升級。目的是讓 Python 可以" -"升級到位(預設為 ``False``)。" +"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時為現" +"有的環境進行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" #: ../../library/venv.rst:164 msgid "" @@ -395,11 +391,9 @@ msgid "" "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" "pip`` option." msgstr "" -"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至" -"虛擬環境之中。當有 ``--default-pip`` 的選項時," -"會使用 :mod:`ensurepip`。" +"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至虛擬" +"環境之中。當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -# fuzzy #: ../../library/venv.rst:168 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " @@ -407,14 +401,13 @@ msgid "" "used). If the special string ``\".\"`` is provided, the basename of the " "current directory is used as the prompt." msgstr "" -"``prompt`` -- 為一個 String(字串),該字串會在虛擬環境啟動時被使用。" -"(預設為 ``None``,代表該環境的目錄名稱會被使用)" -"倘若出現特殊字串 ``\".\"`` ,則當前目錄的 basename" -" 會做為提示路徑使用。" +"``prompt`` -- 為一個 String(字串),該字串會在虛擬環境啟動時被使用。(預設" +"為 ``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則當" +"前目錄的 basename 會做為提示路徑使用。" #: ../../library/venv.rst:173 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" -msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本。" +msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本" #: ../../library/venv.rst:175 ../../library/venv.rst:350 msgid "Added the ``with_pip`` parameter" @@ -433,12 +426,12 @@ msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." msgstr "" -"第三方虛擬環境工具的創造者可以自由地使用" -" :class:`EnvBuilder` class(類別)作為 base class(基礎類別)使用" +"第三方虛擬環境工具的創造者可以自由地使用 :class:`EnvBuilder` class(類別)作" +"為 base class(基礎類別)使用." #: ../../library/venv.rst:187 msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "回傳的 env-buuilder 為一個物件,且帶有一個 method(方法):``create``。" +msgstr "回傳的 env-builder 為一個物件,且帶有一個 method(方法)``create``:" #: ../../library/venv.rst:191 msgid "" @@ -447,18 +440,17 @@ msgid "" "environment. The ``create`` method will either create the environment in " "the specified directory, or raise an appropriate exception." msgstr "" -"創造一個虛擬環境並指定目標目錄(絕對路徑或" -"相對路徑到該目錄),也就是在該目錄中容納虛擬環境。" -"``create`` method(方法)將會在指定的目錄下創建環境," -"或是觸發適當的例外。" +"創造一個虛擬環境並指定目標目錄(絕對路徑或相對路徑到該目錄),也就是在該目錄" +"中容納虛擬環境。``create`` method(方法)將會在指定的目錄下創建環境,或是觸發" +"適當的例外。" #: ../../library/venv.rst:197 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" msgstr "" -":class:`EnvBuilder` class(類別)的``create`` method(方法)會闡述" -"可用的 Hooks 以客製化 subclass (子類別)::" +":class:`EnvBuilder` class(類別)的``create`` method(方法)會闡述可用的 " +"Hooks 以客製化 subclass (子類別)::" #: ../../library/venv.rst:212 msgid "" @@ -467,8 +459,8 @@ msgid "" "meth:`post_setup` can be overridden." msgstr "" "每個 methods(方法) :meth:`ensure_directories`, :meth:" -"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` 及 :" -"meth:`post_setup` 都可以被覆寫." +"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` 及 :meth:" +"`post_setup` 都可以被覆寫." #: ../../library/venv.rst:218 msgid "" @@ -479,12 +471,10 @@ msgid "" "of the environment directory will be cleared and then all necessary " "subdirectories will be recreated." msgstr "" -"創造不存在的環境目錄及必要的子目錄,並回傳一個 context object。" -"這個 context object 只是一個屬性 (例如:路徑) 的所有者" -",可被其他 method(方法)使用。" -"如果 :class:`EnvBuilder` 已被創造且帶有 ``clear=True`` 的引數," -"該環境目錄下的內容將被清空,以及所有必要的" -"子目錄將被重新創造。" +"創造不存在的環境目錄及必要的子目錄,並回傳一個 context object。這個 context " +"object 只是一個屬性 (例如:路徑) 的所有者,可被其他 method(方法)使用。如" +"果 :class:`EnvBuilder` 已被創造且帶有 ``clear=True`` 的引數,該環境目錄下的內" +"容將被清空,以及所有必要的子目錄將被重新創造。" #: ../../library/venv.rst:225 msgid "" From 86d0a3678fae7c4dcb3b28f38c27c89c87347a7b Mon Sep 17 00:00:00 2001 From: rockleona Date: Mon, 10 Jul 2023 21:44:25 +0800 Subject: [PATCH 5/7] Fix typo and suggestions --- library/venv.po | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/library/venv.po b/library/venv.po index 3887c3adc4..6474f5e6cc 100644 --- a/library/venv.po +++ b/library/venv.po @@ -368,15 +368,15 @@ msgid "" "customize environment creation according to their needs, the :class:" "`EnvBuilder` class." msgstr "" -"將上述提到的高階 method(方法)作為簡單的 API 使用, 可為第三方虛擬環境創造者" -"提供使用機制, 並依據他們的需求,客製化創造環境: :class:`EnvBuilder`(類" -"別)。" +"將上述提到的高階 method(方法)作為簡單的 API 使用, 可為第三方虛擬環境建立者" +"提供客製化機制, 並依據他們的需求,客製化建立環境: :class:`EnvBuilder` " +"class。" #: ../../library/venv.rst:148 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" -msgstr "進行實例化時,class(類別) :class:`EnvBuilder` 接受下列的關鍵字引數:" +msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" #: ../../library/venv.rst:151 msgid "" @@ -384,15 +384,15 @@ msgid "" "Python site-packages should be available to the environment (defaults to " "``False``)." msgstr "" -"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的Python " -"site-packages 是否可以在環境中可用(預設為``False``)。" +"``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " +"site-packages 是否可以在環境中可用(預設為 ``False``)。" #: ../../library/venv.rst:154 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." msgstr "" -"``clear`` -- 唯一個 Boolean (布林值),如果為 true,則在創造環境之前,刪除目" +"``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目" "標目錄內所有存在的內容。" #: ../../library/venv.rst:157 @@ -400,7 +400,7 @@ msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." msgstr "" -"``symlinks`` -- 唯一個 Boolean (布林值),並表明是否與 Python 二進制檔案建" +"``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建" "立符號連結而不是複製該檔案。" #: ../../library/venv.rst:160 @@ -409,7 +409,7 @@ msgid "" "environment with the running Python - for use when that Python has been " "upgraded in-place (defaults to ``False``)." msgstr "" -"``upgrade`` -- 唯一個 Boolean (布林值),若為 true,則會在執行 Python 時為現" +"``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現" "有的環境進行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" #: ../../library/venv.rst:164 @@ -418,7 +418,7 @@ msgid "" "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" "pip`` option." msgstr "" -"``with_pip`` -- 唯一個 Boolean (布林值),若為 true,則確保 pip 有安裝至虛擬" +"``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬" "環境之中。當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" #: ../../library/venv.rst:168 @@ -434,7 +434,7 @@ msgstr "" #: ../../library/venv.rst:173 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" -msgstr "``upgrade_deps`` -- 更新 base venv 模組至 PyPI 的最新版本" +msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" #: ../../library/venv.rst:175 ../../library/venv.rst:350 msgid "Added the ``with_pip`` parameter" @@ -453,12 +453,12 @@ msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." msgstr "" -"第三方虛擬環境工具的創造者可以自由地使用 :class:`EnvBuilder` class(類別)作" +"第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作" "為 base class(基礎類別)使用." #: ../../library/venv.rst:187 msgid "The returned env-builder is an object which has a method, ``create``:" -msgstr "回傳的 env-builder 為一個物件,且帶有一個 method(方法)``create``:" +msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" #: ../../library/venv.rst:191 msgid "" @@ -467,8 +467,9 @@ msgid "" "environment. The ``create`` method will either create the environment in " "the specified directory, or raise an appropriate exception." msgstr "" -"創造一個虛擬環境並指定目標目錄(絕對路徑或相對路徑到該目錄),也就是在該目錄" -"中容納虛擬環境。``create`` method(方法)將會在指定的目錄下創建環境,或是觸發" +"透過指定將會容納虛擬環境的目標目錄來建立一個虛擬環境(絕對路徑或" +"相對路徑到該目錄),也就是在該目錄中容納虛擬環境。" +"``create`` method 將會在指定的目錄下創建環境,或是觸發" "適當的例外。" #: ../../library/venv.rst:197 @@ -476,7 +477,7 @@ msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" msgstr "" -":class:`EnvBuilder` class(類別)的``create`` method(方法)會闡述可用的 " +":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 " "Hooks 以客製化 subclass (子類別)::" #: ../../library/venv.rst:212 @@ -485,9 +486,9 @@ msgid "" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" "meth:`post_setup` can be overridden." msgstr "" -"每個 methods(方法) :meth:`ensure_directories`, :meth:" -"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` 及 :meth:" -"`post_setup` 都可以被覆寫." +"每個 methods :meth:`ensure_directories`、:meth:" +"`create_configuration`、:meth:`setup_python`、:meth:`setup_scripts` 及 :meth:" +"`post_setup` 都可以被覆寫。" #: ../../library/venv.rst:218 msgid "" @@ -498,10 +499,10 @@ msgid "" "of the environment directory will be cleared and then all necessary " "subdirectories will be recreated." msgstr "" -"創造不存在的環境目錄及必要的子目錄,並回傳一個 context object。這個 context " -"object 只是一個屬性 (例如:路徑) 的所有者,可被其他 method(方法)使用。如" -"果 :class:`EnvBuilder` 已被創造且帶有 ``clear=True`` 的引數,該環境目錄下的內" -"容將被清空,以及所有必要的子目錄將被重新創造。" +"建立還不存在的環境目錄及必要的子目錄,並回傳一個情境物件(context object)。這個情境物件" +"只是一個屬性 (例如:路徑) 的所有者,可被其他 method 使用。如" +"果 :class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內" +"容將被清空,以及所有必要的子目錄將被重新建立。" #: ../../library/venv.rst:225 msgid "" From d860d58e058759de571bfa87acdc5c4f3820a759 Mon Sep 17 00:00:00 2001 From: rockleona Date: Thu, 13 Jul 2023 11:23:56 +0800 Subject: [PATCH 6/7] Update with reviewer's comment --- library/venv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/venv.po b/library/venv.po index 3eba8c781e..ba1e5abbc1 100644 --- a/library/venv.po +++ b/library/venv.po @@ -372,8 +372,8 @@ msgid "" "customize environment creation according to their needs, the :class:" "`EnvBuilder` class." msgstr "" -"將上述提到的高階 method(方法)作為簡單的 API 使用, 可為第三方虛擬環境建立者" -"提供客製化機制, 並依據他們的需求,客製化建立環境: :class:`EnvBuilder` " +"上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者" +"提供可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` " "class。" #: ../../library/venv.rst:148 @@ -389,7 +389,7 @@ msgid "" "``False``)." msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " -"site-packages 是否可以在環境中可用(預設為 ``False``)。" +"site-packages 是否可以在環境中可用(預設為 ``False`` )。" #: ../../library/venv.rst:154 msgid "" From 8a436c441d5ae367f72c13d948181840e9292b69 Mon Sep 17 00:00:00 2001 From: rockleona Date: Thu, 13 Jul 2023 13:49:50 +0800 Subject: [PATCH 7/7] Update with reviewer's comment --- library/venv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/venv.po b/library/venv.po index ba1e5abbc1..64a8512b80 100644 --- a/library/venv.po +++ b/library/venv.po @@ -458,7 +458,7 @@ msgid "" "provided :class:`EnvBuilder` class as a base class." msgstr "" "第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作" -"為 base class(基礎類別)使用." +"為 base class(基底類別)使用." #: ../../library/venv.rst:187 msgid "The returned env-builder is an object which has a method, ``create``:" @@ -473,7 +473,7 @@ msgid "" msgstr "" "透過指定將會容納虛擬環境的目標目錄來建立一個虛擬環境(絕對路徑或" "相對路徑到該目錄),也就是在該目錄中容納虛擬環境。" -"``create`` method 將會在指定的目錄下創建環境,或是觸發" +"``create`` method 將會在指定的目錄下建立環境,或是觸發" "適當的例外。" #: ../../library/venv.rst:197 @@ -513,7 +513,7 @@ msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" msgstr "" -"回傳的內容物件(context object)其型別會是 :class:`types.SimpleNamespace`," +"回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`," "並包含以下屬性:" #: ../../library/venv.rst:228