Skip to content

Commit 192e7cf

Browse files
committed
merged
2 parents 88660d4 + 5b04cda commit 192e7cf

16 files changed

+881
-280
lines changed

CONTRIBUTING.rst renamed to .overrides/CONTRIBUTING.rst

+15-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Actualmente se puede colaborar utilizando una de las dos siguientes formas que:
99
#. Utilizando el repositorio de GitHub y el editor poedit_
1010
#. Realizando traducciones directamente en Transifex
1111

12-
1312
.. note::
1413

1514
Si tienes cualquier duda, puedes enviarnos un email a docs-es@python.org.
@@ -18,14 +17,12 @@ Actualmente se puede colaborar utilizando una de las dos siguientes formas que:
1817
Desde GitHub
1918
------------
2019

21-
#. Crea un fork del repositorio.
20+
#. Crea un fork del repositorio_.
2221

2322
.. note::
2423

2524
Puedes consular la `ayuda oficial de GitHub`_, si lo deseas.
2625

27-
.. _ayuda oficial de GitHub: https://help.github.com/es/github/getting-started-with-github/fork-a-repo
28-
2926
#. Clona el repositorio::
3027

3128
git clone git@github.com:<TU-USUARIO>/python-docs-es.git
@@ -38,6 +35,10 @@ Desde GitHub
3835

3936
git remote add upstream https://github.com/pycampes/python-docs-es.git
4037

38+
#. Crea una branch nueva en base al artículo en el que vayas a trabajar.
39+
40+
git checkout -b traduccion_glosario
41+
4142
#. Mira que archivo necesita ser traducido. El siguiente comando te mostrará una lista de archivos y los porcentajes traducidos.
4243
Elige uno que no esté completo::
4344

@@ -48,20 +49,17 @@ Desde GitHub
4849
#. Cuando hayas terminado tu sesión, debes guardar tus cambios y enviarlos a GitHub de nuevo::
4950

5051
git commit -am 'Traducido archivo {nombre de archivo}'
51-
git push origin update-translation
52+
git push origin traduccion_glosario
53+
54+
#. No olvides añadir tu nombre al archivo TRANSLATORS si no lo has hecho todavía.
55+
Los nombres se encuentran ordenados alfabéticamente por apellido.
5256

5357
#. Luego ve a tu página de GitHub y propone hacer un Pull Request
5458

5559
.. note::
5660

5761
Puedes consultar la `ayuda oficial de GitHub para crear un Pull Request`_ si lo deseas.
5862

59-
.. _ayuda oficial de GitHub para crear un Pull Request: https://help.github.com/es/github/collaborating-with-issues-and-pull-requests/about-pull-requests
60-
61-
62-
.. _poedit: https://poedit.net/
63-
64-
6563

6664
Previsualizar los cambios
6765
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -94,3 +92,9 @@ Utilizando Transifex
9492
--------------------
9593

9694
ToDo.
95+
96+
97+
.. _repositorio: https://github.com/PyCampES/python-docs-es
98+
.. _ayuda oficial de GitHub: https://help.github.com/es/github/getting-started-with-github/fork-a-repo
99+
.. _ayuda oficial de GitHub para crear un Pull Request: https://help.github.com/es/github/collaborating-with-issues-and-pull-requests/about-pull-requests
100+
.. _poedit: https://poedit.net/

.overrides/README.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Overrides
2+
=========
3+
4+
This directory is recursively copied into `cpython/Doc`.
5+
It needs to have the same structure than `cpython/Doc`.
6+
7+
It allows us
8+
9+
- to have our own `CONTRIBUTING.rst` guide
10+
- change the index sidebar with links that are interesting for translators
11+
- etc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{%- if show_source and has_source and sourcename %}
2+
<div role="note" aria-label="source link">
3+
<h3>{{ _('This Page') }}</h3>
4+
<ul class="this-page-menu">
5+
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li>
6+
<li>
7+
<a href="https://github.com/PyCampES/python-docs-es/blob/{{ version }}/{{ sourcename|replace('.rst.txt', '.po') }}"
8+
rel="nofollow">{{ _('Show Source') }}
9+
</a>
10+
</li>
11+
</ul>
12+
</div>
13+
{%- endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<h3>¡Ayúdanos a traducir!</h3>
2+
<ul>
3+
<li><a href="CONTRIBUTING.html">Guía para contribuir</a></li>
4+
</ul>
5+
6+
<h3>Recursos</h3>
7+
<ul>
8+
<li><a href="https://mail.python.org/mailman3/lists/docs-es.python.org/">Lista de correos</a></li>
9+
<li><a href="https://t.me/python_docs_es">Canal de Télegram</a></li>
10+
<li><a href="https://github.com/PyCampES/python-docs-es">Repositorio GitHub</a></li>
11+
</ul>

.overrides/translation-memory.rst

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
=======================
2+
Memoria de traducción
3+
=======================
4+
5+
6+
Esta página contiene la Memoria de Traducción, con todos los términos que hemos ido teniendo dudas,
7+
y coordinamos cuál era la mejor traducción dado el contexto.
8+
9+
Si quieres ver cómo se ha utilizado un término anteriormente, puedes utilizar la herramienta
10+
``find_in_po.py`` que muestra dónde se usó ese término: original y traducción lado a lado:
11+
12+
.. code-block:: text
13+
14+
$ python scripts/find_in_po.py docstring
15+
╒════════════════════════════════════════════════════════════════════════════════════════════════╤═══════════════════════════════════════════════════════════════════════════════════════════════╕
16+
│ The first statement of the function body can optionally be a string literal; this string │ La primera sentencia del cuerpo de la función puede ser opcionalmente una cadena de texto │
17+
│ literal is the function's documentation string, or :dfn:`docstring`. (More about docstrings │ literal; esta es la cadena de texto de documentación de la función, o :dfn:`docstring`. │
18+
│ can be found in the section :ref:`tut-docstrings`.) There are tools which use docstrings to │ (Puedes encontrar más acerca de docstrings en la sección :ref:`tut-docstrings`.). Existen │
19+
│ automatically produce online or printed documentation, or to let the user interactively browse │ herramientas que usan las ``docstrings`` para producir documentación imprimible o disponible │
20+
│ through code; it's good practice to include docstrings in code that you write, so make a habit │ en línea, o para dejar que los usuarios busquen interactivamente a través del código; es una │
21+
│ of it. │ buena práctica incluir ``docstrings`` en el código que escribes, y hacerlo un buen hábito. │
22+
├────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────┤
23+
│ Here is an example of a multi-line docstring:: │ Este es un ejemplo de un ``docstring`` multi-línea:: │
24+
├────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────┤
25+
│ Use docstrings. │ Usar ``docstrings``. │
26+
├────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────┤
27+
28+
29+
Éstos son las palabras que hemos coordinado hasta el momento:
30+
31+
32+
loop
33+
Bucle. ``tutorial/controlflow.po``
34+
35+
handle exception
36+
Gestionar excepción. ``tutorial/inputoutput.po``
37+
38+
docstring
39+
docstring. ``library/idle.po``

TRANSLATORS

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Raúl Cumplido (@raulcd)
12
Nicolás Demarchi (@gilgamezh)
23
Manuel Kaufmann (@humitos)
34
María Andrea Vignau (@mavignau @marian-vignau)
5+
Marco Richetta (@marcorichetta)

conf.py

+22-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
sys.path.append(os.path.abspath('cpython/Doc'))
2222
from conf import *
2323

24-
version = '3.7'
25-
release = '3.7.7'
24+
# Call patchlevel with the proper path to get the version from
25+
# instead of hardcoding it
26+
import patchlevel
27+
version, release = patchlevel.get_header_version_info(os.path.abspath('cpython/Doc'))
2628

2729
project = 'Python en Español'
2830
copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y')
@@ -33,7 +35,22 @@
3335

3436
os.system('mkdir -p cpython/locales/es/')
3537
os.system('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES')
36-
os.system('ln -nfs `pwd`/CONTRIBUTING.rst cpython/Doc/CONTRIBUTING.rst')
38+
39+
40+
# Override all the files from ``.overrides`` directory
41+
import glob
42+
for root, dirs, files in os.walk('.overrides'):
43+
for fname in files:
44+
if fname == 'README.rst' and root == '.overrides':
45+
continue
46+
destroot = root.replace('.overrides', '').lstrip('/')
47+
outputdir = os.path.join(
48+
'cpython',
49+
'Doc',
50+
destroot,
51+
fname,
52+
)
53+
os.system(f'ln -nfs `pwd`/{root}/{fname} {outputdir}')
3754

3855
gettext_compact = False
3956
locale_dirs = ['../locales', 'cpython/locales'] # relative to the sourcedir
@@ -50,8 +67,8 @@ def add_contributing_banner(app, doctree):
5067
from docutils import nodes, core
5168

5269
message = '¡Ayúdanos a traducir la documentación oficial de Python al Español! ' \
53-
f'Puedes encontrar más información en `Como contribuir </es/{version}/CONTRIBUTING.html>`_ ' \
54-
'y así ayudarnos a acercar Python a más personas de habla hispana.'
70+
f'Puedes encontrar más información en `Como contribuir </es/{version}/CONTRIBUTING.html>`_. ' \
71+
'Ayuda a acercar Python a más personas de habla hispana.'
5572

5673
paragraph = core.publish_doctree(message)[0]
5774
banner = nodes.warning(ids=['contributing-banner'])

dict

+9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
argv
2+
array
3+
arrays
24
ASCII
5+
Associates
36
backspace
47
batch
58
C
69
Circus
710
comilla
811
command
12+
Cookbook
913
default
1014
docstring
1115
docstrings
1216
else
1317
Fibonacci
18+
Fourier
1419
Flying
1520
if
1621
import
1722
imprimible
1823
indentación
1924
indentada
25+
Index
2026
inicializar
2127
interactivamente
2228
intermezzo
@@ -27,6 +33,7 @@ Monty
2733
multilínea
2834
multi
2935
option
36+
Package
3037
Perl
3138
Python
3239
python
@@ -42,6 +49,7 @@ referenciada
4249
referenciadas
4350
referenciado
4451
referenciados
52+
Reilly
4553
reordenar
4654
s
4755
seguirle
@@ -55,6 +63,7 @@ sintácticamente
5563
shell
5664
situ
5765
sockets
66+
solucionadores
5867
subíndices
5968
sys
6069
tipado

scripts/find_in_po.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
from glob import glob
5+
import os
6+
from textwrap import fill
7+
8+
import regex
9+
import polib
10+
from tabulate import tabulate
11+
12+
13+
def find_in_po(pattern):
14+
table = []
15+
try:
16+
_, columns = os.popen("stty size", "r").read().split()
17+
available_width = int(columns) // 2 - 3
18+
except:
19+
available_width = 80 // 2 - 3
20+
21+
for file in glob("**/*.po"):
22+
pofile = polib.pofile(file)
23+
for entry in pofile:
24+
if entry.msgstr and regex.search(pattern, entry.msgid):
25+
table.append(
26+
[
27+
fill(entry.msgid, width=available_width),
28+
fill(entry.msgstr, width=available_width),
29+
]
30+
)
31+
print(tabulate(table, tablefmt="fancy_grid"))
32+
33+
34+
def parse_args():
35+
parser = argparse.ArgumentParser(description="Find translated words.")
36+
parser.add_argument("pattern")
37+
return parser.parse_args()
38+
39+
40+
def main():
41+
args = parse_args()
42+
find_in_po(args.pattern)
43+
44+
45+
if __name__ == "__main__":
46+
main()

0 commit comments

Comments
 (0)