Explorar o código

Sphinx: Also use env variable to get RTD instance language

ReadTheDocs properly overrides `language` via's sphinx-build's
`-D language=value` parameter, but when we do the initial parsing
of `conf.py` it still uses the original value, so our custom logic
for Weblate badges was not working.
Rémi Verschelde %!s(int64=6) %!d(string=hai) anos
pai
achega
fa77d5735f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      conf.py

+ 1 - 1
conf.py

@@ -40,7 +40,7 @@ if env_tags != None:
        tags.add(tag.strip())
 
 # Language / i18n
-language = 'en'
+language = os.getenv('RTD_LANGUAGE', 'en')
 is_i18n = tags.has('i18n')
 
 exclude_patterns = ['_build']