Skip to content

Commit be88de1

Browse files
authored
Merge branch '3.12' into cgi
2 parents 6042228 + aabd070 commit be88de1

File tree

8 files changed

+146
-45
lines changed

8 files changed

+146
-45
lines changed

.overrides/faq.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ repositorio principal de la traducción). Se hace de la siguiente manera::
204204

205205
Luego nos vamos a nuestra rama local, confirmamos e impactamos esos cambios::
206206

207-
git checkout 3.11
208-
git merge upstream/3.11
209-
git push origin 3.11
207+
git checkout 3.12
208+
git merge upstream/3.12
209+
git push origin 3.12
210210

211211
¡Eso es todo!
212212

.overrides/progress.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ y otras estadísticas.
1010

1111
.. note::
1212

13-
Estas listas se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``3.11``.
13+
Estas listas se actualiza automáticamente cuando Pull Requests se *mergean* a la rama ``3.12``.
1414

1515

1616
En progreso

.overrides/upgrade-python-version.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
3939
.. note:: This is important, so the later ``make build`` step will not reset
4040
the cpython submodule to the previous hash on the old branch.
4141

42+
#. Create a virtual environment and install the dependencies of the project::
43+
44+
python -m venv env
45+
source env/bin/activate # Windows: env\Scripts\activate.bat
46+
pip install -r requirements.txt
47+
4248
#. Verify that the docs build with the new versions you changed from
4349
``requirements.txt`` mainly the sphinx version::
4450

@@ -53,21 +59,14 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
5359

5460
#. Clean possible garbage (form previous builds)::
5561

56-
rm -rf _build ../python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst
62+
rm -rf _build ../python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst reviewers-guide.rst
5763

5864
.. note::
5965

6066
The 'python-docs-es-pot' is a temporary directory that is created
6167
in the next step. It's included here because it might be a leftover
6268
from previous attempts on your machine.
6369

64-
#. Create a virtual environment and install the dependencies of the project::
65-
66-
python -m venv env
67-
source env/bin/activate # Windows: env\Scripts\activate.bat
68-
pip install -r requirements.txt
69-
70-
7170
#. Create the .po files from the new source code. This will generate all the .po files for version 3.11::
7271

7372
SPHINX_GETTEXT=True sphinx-build -j auto -b gettext -d _build/doctrees . ../python-docs-es-pot
@@ -114,9 +113,16 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
114113
of the new branch is done. So prepare a cup of any hot beverage
115114
and fix them.
116115

117-
Once the process is completely and you are happy with the results,
118-
there are a few extra steps to finish the process::
116+
**Once the process is completely and you are happy with the results,
117+
there are a few extra steps to finish the process**
118+
119+
#. Upgrade GitHub Actions to use Python 3.12, by updating Python version to 3.12 in the ``.github/workflows/main.yml`` file.
119120

120-
#. Upgrade GitHub Actions to use Python 3.12
121+
#. Update the *Read the Docs* project to use 3.12 in the build and also as default branch/version.
122+
123+
#. Commit all the newly created files locally.
124+
125+
#. Create branch 3.12 in the repository in order to merge changes there.
126+
127+
#. Inside the github project settings, set 3.12 branch as the default branch for the repository.
121128

122-
#. Update Read the Docs project to use 3.12 in the build and also as default branch/version

TRANSLATORS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Carlos Bernad (@carlos-bernad)
4343
Carlos Enrique Carrasco Varas (@KrlitosForever)
4444
Carlos Joel Delgado Pizarro (@c0x6a)
4545
Carlos Martel Lamas (@Letram)
46+
Carlos Mena Pérez (@carlosm00)
4647
Catalina Arrey Amunátegui (@CatalinaArrey)
4748
Claudia Millán Nebot (@clacri @cheshireminima)
4849
Constanza Areal (@geekcoty)
@@ -158,6 +159,7 @@ Lis
158159
Lucas Miranda
159160
Luciano Bovio (@lbovio)
160161
Luis A. Gonzalez (@sublian)
162+
Luis Enriquez Torres (@lenriquezt)
161163
Luis Llave (@llaveluis)
162164
Luis Sánchez (@LuisAISanchez)
163165
Maia
@@ -238,4 +240,4 @@ Xavi Francisco (@srxavi)
238240
Xavi Rambla Centellas (@xavirambla)
239241
Yennifer Paola Herrera Ariza (@Yenniferh)
240242
Yohanna Padrino (@Yo-hanaPR)
241-
zejiran
243+
zejiran

library/audioop.po

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ msgstr ""
1111
"Project-Id-Version: Python 3.8\n"
1212
"Report-Msgid-Bugs-To: \n"
1313
"POT-Creation-Date: 2023-10-12 19:43+0200\n"
14-
"PO-Revision-Date: 2022-11-21 16:07-0300\n"
14+
"PO-Revision-Date: 2023-12-22 11:47+0100\n"
1515
"Last-Translator: Sofía Denner <sofi.denner@gmail.com>\n"
16-
"Language: es\n"
1716
"Language-Team: python-doc-es\n"
18-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
17+
"Language: es\n"
1918
"MIME-Version: 1.0\n"
2019
"Content-Type: text/plain; charset=utf-8\n"
2120
"Content-Transfer-Encoding: 8bit\n"
21+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2222
"Generated-By: Babel 2.13.0\n"
23+
"X-Generator: Poedit 3.1.1\n"
2324

2425
#: ../Doc/library/audioop.rst:2
2526
msgid ":mod:`audioop` --- Manipulate raw audio data"
@@ -446,16 +447,16 @@ msgstr ""
446447

447448
#: ../Doc/library/audioop.rst:24
448449
msgid "Intel/DVI ADPCM"
449-
msgstr ""
450+
msgstr "Intel/DVI ADPCM"
450451

451452
#: ../Doc/library/audioop.rst:24
452453
msgid "ADPCM, Intel/DVI"
453-
msgstr ""
454+
msgstr "ADPCM, Intel/DVI"
454455

455456
#: ../Doc/library/audioop.rst:24
456457
msgid "a-LAW"
457-
msgstr ""
458+
msgstr "a-LAW"
458459

459460
#: ../Doc/library/audioop.rst:24
460461
msgid "u-LAW"
461-
msgstr ""
462+
msgstr "u-LAW"

library/collections.abc.po

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ msgstr ""
1111
"Project-Id-Version: Python 3.8\n"
1212
"Report-Msgid-Bugs-To: \n"
1313
"POT-Creation-Date: 2023-10-12 19:43+0200\n"
14-
"PO-Revision-Date: 2022-12-08 16:15-0300\n"
14+
"PO-Revision-Date: 2023-12-11 20:13+0100\n"
1515
"Last-Translator: Sofía Denner <sofi.denner@gmail.com>\n"
16-
"Language: es_AR\n"
1716
"Language-Team: python-doc-es\n"
18-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
17+
"Language: es_AR\n"
1918
"MIME-Version: 1.0\n"
2019
"Content-Type: text/plain; charset=utf-8\n"
2120
"Content-Transfer-Encoding: 8bit\n"
21+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
2222
"Generated-By: Babel 2.13.0\n"
23+
"X-Generator: Poedit 3.0.1\n"
2324

2425
#: ../Doc/library/collections.abc.rst:2
2526
msgid ":mod:`collections.abc` --- Abstract Base Classes for Containers"
@@ -35,15 +36,14 @@ msgid "**Source code:** :source:`Lib/_collections_abc.py`"
3536
msgstr "**Código fuente:** :source:`Lib/_collections_abc.py`"
3637

3738
#: ../Doc/library/collections.abc.rst:23
38-
#, fuzzy
3939
msgid ""
4040
"This module provides :term:`abstract base classes <abstract base class>` "
4141
"that can be used to test whether a class provides a particular interface; "
4242
"for example, whether it is :term:`hashable` or whether it is a mapping."
4343
msgstr ""
4444
"Este módulo proporciona :term:`clases base abstractas <abstract base class>` "
4545
"que pueden usarse para probar si una clase proporciona una interfaz "
46-
"específica; por ejemplo, si es hashable o si es un mapeo."
46+
"específica; por ejemplo, si es :term:`hashable` o si es un mapeo."
4747

4848
#: ../Doc/library/collections.abc.rst:27
4949
msgid ""
@@ -459,14 +459,12 @@ msgid "``aclose``, ``__aiter__``, ``__anext__``"
459459
msgstr "``aclose``, ``__aiter__``, ``__anext__``"
460460

461461
#: ../Doc/library/collections.abc.rst:180
462-
#, fuzzy
463462
msgid ":class:`Buffer` [1]_"
464-
msgstr ":class:`Iterator` [1]_"
463+
msgstr ":class:`Buffer` [1]_"
465464

466465
#: ../Doc/library/collections.abc.rst:180
467-
#, fuzzy
468466
msgid "``__buffer__``"
469-
msgstr "``__iter__``"
467+
msgstr "``__buffer__``"
470468

471469
#: ../Doc/library/collections.abc.rst:185
472470
msgid "Footnotes"
@@ -599,6 +597,10 @@ msgid ""
599597
"union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For "
600598
"use as an ABC, prefer :class:`Sequence` or :class:`collections.abc.Buffer`."
601599
msgstr ""
600+
"La ABC :class:`ByteString` está obsoleta. Para usar con ``type hints``, "
601+
"mejor use una unión del tipo ``bytes | bytearray``, o :class:`collections."
602+
"abc.Buffer`. Para usar como una ABC, mejor use :class:`Sequence` o :class:"
603+
"`collections.abc.Buffer`."
602604

603605
#: ../Doc/library/collections.abc.rst:285
604606
msgid "ABCs for read-only and mutable sets."
@@ -701,6 +703,8 @@ msgid ""
701703
"ABC for classes that provide the :meth:`~object.__buffer__` method, "
702704
"implementing the :ref:`buffer protocol <bufferobjects>`. See :pep:`688`."
703705
msgstr ""
706+
"ABC para clases que proveen el método :meth:`~object.__buffer__`, "
707+
"implementando el :ref:`protocolo búfer <bufferobjects>`. Ver :pep:`688`."
704708

705709
#: ../Doc/library/collections.abc.rst:364
706710
msgid "Examples and Recipes"
@@ -769,7 +773,6 @@ msgstr ""
769773
"las otras operaciones seguirán automáticamente su ejemplo."
770774

771775
#: ../Doc/library/collections.abc.rst:421
772-
#, fuzzy
773776
msgid ""
774777
"The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash "
775778
"value for the set; however, :meth:`__hash__` is not defined because not all "
@@ -779,9 +782,10 @@ msgid ""
779782
msgstr ""
780783
"El mixin :class:`Set` proporciona un método :meth:`_hash` para calcular un "
781784
"valor hash para el conjunto; sin embargo, :meth:`__hash__` no está definido "
782-
"porque no todos los conjuntos son encadenados o inmutables. Para agregar "
783-
"capacidad de encadenamiento en conjuntos que usan mixin, herede de ambos :"
784-
"meth:`Set` y :meth:`Hashable`, luego defina ``__hash__ = Set._hash``."
785+
"porque no todos los conjuntos son :term:`hashable` o inmutables. Para "
786+
"agregar la capacidad de encadenamiento en conjuntos usando métodos mixin, "
787+
"herede de ambos :meth:`Set` y :meth:`Hashable`, luego defina ``__hash__ = "
788+
"Set._hash``."
785789

786790
#: ../Doc/library/collections.abc.rst:429
787791
msgid ""

library/warnings.po

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,11 @@ msgid ":exc:`ResourceWarning`"
280280
msgstr ":exc:`ResourceWarning`"
281281

282282
#: ../Doc/library/warnings.rst:107
283-
#, fuzzy
284283
msgid ""
285284
"Base category for warnings related to resource usage (ignored by default)."
286285
msgstr ""
287-
"Categoría base para las advertencias relacionadas con el uso de los recursos."
286+
"Categoría base para las advertencias relacionadas con el uso de los recursos "
287+
"(ignorada por defecto)."
288288

289289
#: ../Doc/library/warnings.rst:111
290290
msgid ""
@@ -806,14 +806,13 @@ msgstr ""
806806
"usado por funciones de envoltura escritas en Python, como esta::"
807807

808808
#: ../Doc/library/warnings.rst:413
809-
#, fuzzy
810809
msgid ""
811810
"This makes the warning refer to ``deprecated_api``'s caller, rather than to "
812811
"the source of ``deprecated_api`` itself (since the latter would defeat the "
813812
"purpose of the warning message)."
814813
msgstr ""
815-
"Esto hace que la advertencia se refiera al invocador de :func:`deprecation`, "
816-
"en lugar de a la fuente de :func:`deprecation` en sí (ya que esta última "
814+
"Esto hace que la advertencia se refiera al invocador de ``deprecated_api``, "
815+
"en lugar de a la fuente de ``deprecated_api`` en sí (ya que esta última "
817816
"perdería el propósito del mensaje de advertencia)."
818817

819818
#: ../Doc/library/warnings.rst:417
@@ -827,13 +826,25 @@ msgid ""
827826
"stacklevel)``. To cause a warning to be attributed to the caller from "
828827
"outside of the current package you might write::"
829828
msgstr ""
829+
"El parámetro de palabra clave *skip_file_prefixes* se puede utilizar para "
830+
"indicar qué *frames* de pila se ignoran al contar los niveles de pila. Esto "
831+
"puede ser útil cuando desea que la advertencia aparezca siempre en los "
832+
"sitios de llamadas fuera de un paquete cuando una constante *stacklevel* no "
833+
"se ajusta a todas las rutas de llamadas o en otro caso es difícil de "
834+
"mantener. Si se proporciona, debe ser una tupla de cadenas de caracteres. "
835+
"Cuando se proporcionan prefijos, el *stacklevel* se sobreescribe "
836+
"implícitamente con ``max(2, stacklevel)``. Para hacer que se atribuya una "
837+
"advertencia al invocador desde afuera del paquete actual, puede escribir::"
830838

831839
#: ../Doc/library/warnings.rst:440
832840
msgid ""
833841
"This makes the warning refer to both the ``example.lower.one_way()`` and "
834842
"``package.higher.another_way()`` call sites only from calling code living "
835843
"outside of ``example`` package."
836844
msgstr ""
845+
"Esto hace que la advertencia se refiera a ambos lugares de llamada ``example."
846+
"lower.one_way()`` y ``package.higher.another_way()`` únicamente desde el "
847+
"código de llamada que se encuentra fuera del paquete ``example``."
837848

838849
#: ../Doc/library/warnings.rst:444 ../Doc/library/warnings.rst:470
839850
msgid ""
@@ -849,7 +860,7 @@ msgstr "Añadido parámetro *source*."
849860

850861
#: ../Doc/library/warnings.rst:450
851862
msgid "Added *skip_file_prefixes*."
852-
msgstr ""
863+
msgstr "Añadido *skip_file_prefixes*."
853864

854865
#: ../Doc/library/warnings.rst:456
855866
msgid ""
@@ -1026,6 +1037,5 @@ msgid "Added the *action*, *category*, *lineno*, and *append* parameters."
10261037
msgstr "Agrega los parámetros *action*, *category*, *lineno* y *append*."
10271038

10281039
#: ../Doc/library/warnings.rst:9
1029-
#, fuzzy
10301040
msgid "warnings"
1031-
msgstr "Advertencias de prueba"
1041+
msgstr "warnings"

scripts/complete_index.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
"""
2+
Script to identify and complete general index entries with original content.
3+
4+
This script processes .po files, identifies out-of-order entries based on the
5+
source order, and completes them with original content.
6+
7+
Usage:
8+
python script_name.py [list of .po files]
9+
10+
If no list of .po files is provided, the script processes all .po files in the
11+
current directory and its immediate subdirectories.
12+
"""
13+
14+
from pathlib import Path
15+
import sys
16+
17+
import polib
18+
19+
20+
def out_of_order_entries(po_file):
21+
"""
22+
Compare the order of source lines against the order in which they appear in
23+
the file, and return a generator with entries that are out of order.
24+
"""
25+
po_entries = [entry for entry in po_file if not entry.obsolete]
26+
val_max = 0
27+
28+
for entry in po_entries:
29+
source_index = int(entry.occurrences[0][1])
30+
31+
if source_index <= val_max:
32+
yield entry
33+
34+
val_max = max(val_max, source_index)
35+
36+
37+
def complete_index(po_files=None):
38+
"""
39+
Identifies general index entries based on source order and completes them
40+
with original content.
41+
42+
args:
43+
po_files: List of .po files to process. If not provided, it processes
44+
all .po files in the current directory and immediate subdirectories.
45+
"""
46+
47+
# Read .po files
48+
if not po_files:
49+
po_files = Path(".").glob("**/*.po")
50+
51+
for po_file_path in po_files:
52+
53+
try:
54+
po_file = polib.pofile(po_file_path, wrapwidth=79)
55+
56+
# Ask to complete entries out of order with original text
57+
needs_save = False
58+
for entry in out_of_order_entries(po_file):
59+
user_input = input(f"\n{entry}\nIs this a index entry? (y/N):")
60+
if user_input.lower() == "y":
61+
entry.msgstr = entry.msgid
62+
needs_save = True
63+
if needs_save:
64+
po_file.save()
65+
66+
except KeyboardInterrupt:
67+
break
68+
69+
except Exception as e:
70+
print(f"Error! file {po_file_path}: {e}\n")
71+
72+
else:
73+
print(f"\n---\n{po_file_path} processed!\n---")
74+
75+
76+
if __name__ == "__main__":
77+
po_files = sys.argv[1:]
78+
complete_index(po_files)

0 commit comments

Comments
 (0)