3535os .system ('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES' )
3636
3737
38- # Override all the files from ``.overrides`` directory
39- import glob
40- for root , dirs , files in os .walk ('.overrides' ):
41- for fname in files :
42- if fname == 'README.rst' and root == '.overrides' :
43- continue
44- destroot = root .replace ('.overrides' , '' ).lstrip ('/' )
45- outputdir = os .path .join (
46- 'cpython' ,
47- 'Doc' ,
48- destroot ,
49- fname ,
50- )
51- os .system (f'ln -nfs `pwd`/{ root } /{ fname } { outputdir } ' )
38+ if not os .environ .get ('SPHINX_GETTEXT' ) == 'True' :
39+ # Override all the files from ``.overrides`` directory
40+ import glob
41+ for root , dirs , files in os .walk ('.overrides' ):
42+ for fname in files :
43+ if fname == 'README.rst' and root == '.overrides' :
44+ continue
45+ destroot = root .replace ('.overrides' , '' ).lstrip ('/' )
46+ outputdir = os .path .join (
47+ 'cpython' ,
48+ 'Doc' ,
49+ destroot ,
50+ fname ,
51+ )
52+ os .system (f'ln -nfs `pwd`/{ root } /{ fname } { outputdir } ' )
5253
5354gettext_compact = False
5455locale_dirs = ['../locales' , 'cpython/locales' ] # relative to the sourcedir
@@ -62,6 +63,12 @@ def add_contributing_banner(app, doctree):
6263 This way, we can easily communicate people to help with the translation,
6364 pointing them to different resources.
6465 """
66+
67+ if app .builder .format != 'html' :
68+ # Do not include the banner when building with other formats
69+ # (this is useful when using -b gettext)
70+ return
71+
6572 from docutils import nodes , core
6673
6774 message = '¡Ayúdanos a traducir la documentación oficial de Python al Español! ' \
0 commit comments