35
35
os .system ('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES' )
36
36
37
37
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 } ' )
52
53
53
54
gettext_compact = False
54
55
locale_dirs = ['../locales' , 'cpython/locales' ] # relative to the sourcedir
@@ -62,6 +63,12 @@ def add_contributing_banner(app, doctree):
62
63
This way, we can easily communicate people to help with the translation,
63
64
pointing them to different resources.
64
65
"""
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
+
65
72
from docutils import nodes , core
66
73
67
74
message = '¡Ayúdanos a traducir la documentación oficial de Python al Español! ' \
0 commit comments