File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333
3434os .system ('mkdir -p cpython/locales/es/' )
3535os .system ('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES' )
36+ os .system ('ln -nfs `pwd`/CONTRIBUTING.rst cpython/Doc/CONTRIBUTING.rst' )
3637
3738gettext_compact = False
3839locale_dirs = ['../locales' , 'cpython/locales' ] # relative to the sourcedir
3940
4041def setup (app ):
42+
43+ def add_contributing_banner (app , doctree ):
44+ """
45+ Insert a banner at the top of the index.
46+
47+ This way, we can easily communicate people to help with the translation,
48+ pointing them to different resources.
49+ """
50+ from docutils import nodes , core
51+
52+ message = '¡Ayúdanos a traducir la documentación oficial de Python al Español! ' \
53+ f'Más información en `Como contribuir </es/{ version } /CONTRIBUTING.html>`_'
54+
55+ paragraph = core .publish_doctree (message )[0 ]
56+ banner = nodes .warning (ids = ['contributing-banner' ])
57+ banner .append (paragraph )
58+
59+ for document in doctree .traverse (nodes .document ):
60+ document .insert (0 , banner )
61+
4162 # Change the sourcedir programmatically because Read the Docs always call it with `.`
4263 app .srcdir = 'cpython/Doc'
64+
65+ app .connect ('doctree-read' , add_contributing_banner )
You can’t perform that action at this time.
0 commit comments