Skip to content

Commit b6af7d9

Browse files
trans: how venv work (#609)
* trans: venv * feat: trans venv * feat: trans venv * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com> * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com> * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com> * Update library/venv.po Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com> * trans: format * fix: ``#!`` to \"shebang\" * fix: 修正語句、標點符號 * fix: 修正語句 * chore(library/venv): format with powrap * fix(library/venv): fix incorrect translation --------- Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
1 parent 50a2f20 commit b6af7d9

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

library/venv.po

+30-4
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,23 @@ msgid ""
238238
"activation script is platform-specific (:samp:`{<venv>}` must be replaced by "
239239
"the path to the directory containing the virtual environment):"
240240
msgstr ""
241+
"虛擬環境可以透過位於二進位檔案目錄中的腳本「啟用」(在 POSIX 上為 ``bin``;"
242+
"在 Windows 上為 ``Scripts``)這會將該目錄加入到你的 :envvar:`PATH`,當你運"
243+
"行 :program:`python` 時就會調用該環境的直譯器並且執行已安裝的腳本,而不需要使"
244+
"用完整的路徑。啟動腳本的方式因平台而異(:samp:`{<venv>}` 需要替換成包含虛擬環"
245+
"境的目錄路徑)"
241246

242247
#: ../../library/venv.rst:71
243248
msgid "Platform"
244249
msgstr "平台"
245250

246251
#: ../../library/venv.rst:71
247252
msgid "Shell"
248-
msgstr ""
253+
msgstr "Shell"
249254

250255
#: ../../library/venv.rst:71
251256
msgid "Command to activate virtual environment"
252-
msgstr ""
257+
msgstr "啟動虛擬環境的指令"
253258

254259
#: ../../library/venv.rst:73
255260
msgid "POSIX"
@@ -305,13 +310,13 @@ msgstr ":samp:`PS C:\\\\> {<venv>}\\\\Scripts\\\\Activate.ps1`"
305310

306311
#: ../../library/venv.rst:86
307312
msgid ":program:`fish` and :program:`csh` activation scripts."
308-
msgstr ""
313+
msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。"
309314

310315
#: ../../library/venv.rst:89
311316
msgid ""
312317
"PowerShell activation scripts installed under POSIX for PowerShell Core "
313318
"support."
314-
msgstr ""
319+
msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。"
315320

316321
#: ../../library/venv.rst:93
317322
msgid ""
@@ -320,6 +325,9 @@ msgid ""
320325
"invoking Python. Furthermore, all scripts installed in the environment "
321326
"should be runnable without activating it."
322327
msgstr ""
328+
"你不用特別開啟虛擬環境,你可以在調用 Python 時指定該環境下 Python 直譯器的完"
329+
"整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運"
330+
"行。"
323331

324332
#: ../../library/venv.rst:99
325333
msgid ""
@@ -332,6 +340,12 @@ msgid ""
332340
"window should run it with the correct interpreter without the environment "
333341
"needing to be activated or on the :envvar:`PATH`."
334342
msgstr ""
343+
"為了實現這一點,安裝在虛擬環境中的腳本會有一個 \"shebang\" 列,此列指向該環境"
344+
"的 Python 直譯器,例如: :samp:`#!/{<path-to-venv>}/bin/python`。這代表無論 :"
345+
"envvar:`PATH` 的值為何,該腳本都會在直譯器上運行。在 Windows 上,如果你安裝"
346+
"了 :ref:`launcher`,則支援 \"shebang\" 列處理。因此,在 Windows 檔案總管"
347+
"(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :"
348+
"envvar:`PATH` 的情況下正確地運行。"
335349

336350
#: ../../library/venv.rst:108
337351
msgid ""
@@ -341,6 +355,9 @@ msgid ""
341355
"VIRTUAL_ENV` cannot be relied upon to determine whether a virtual "
342356
"environment is being used."
343357
msgstr ""
358+
"當虛擬環境被啟用時,:envvar:`!VIRTUAL_ENV` 環境變數會被設置為該環境的路徑。由"
359+
"於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來"
360+
"判斷是否正在使用虛擬環境。"
344361

345362
#: ../../library/venv.rst:114
346363
msgid ""
@@ -357,13 +374,22 @@ msgid ""
357374
"directory of it, you should recreate the environment in its new location. "
358375
"Otherwise, software installed into the environment may not work as expected."
359376
msgstr ""
377+
"因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含"
378+
"環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用"
379+
"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt``"
380+
"的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所"
381+
"需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重"
382+
"新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新"
383+
"位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。"
360384

361385
#: ../../library/venv.rst:128
362386
msgid ""
363387
"You can deactivate a virtual environment by typing ``deactivate`` in your "
364388
"shell. The exact mechanism is platform-specific and is an internal "
365389
"implementation detail (typically, a script or shell function will be used)."
366390
msgstr ""
391+
"你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異,"
392+
"是內部實作的細節(通常會使用腳本或是 shell 函式)"
367393

368394
#: ../../library/venv.rst:136
369395
msgid "API"

0 commit comments

Comments
 (0)