diff --git a/.gitignore b/.gitignore index c7839f4379e..e98af41b79a 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ config.h doc/Doxyfile doc/html/ doc/docbuild/ +doc/locale/pot MYMETA.* pm_to_blib diff --git a/doc/conf.py b/doc/conf.py index 535999a8e74..c3244bff4fe 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -76,6 +76,25 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None +locale_dirs = ['locale/'] +gettext_compact = False + +## HACK for Read-the-Docs +## Generate .mo files just in time +if os.environ.get('READTHEDOCS') == 'True': + import polib + print "Generating .mo files", + for locale_dir in locale_dirs: + for path, dummy, filenames in os.walk(locale_dir): + for filename in filenames: + po_file = os.path.join(path, filename) + base, ext = os.path.splitext(po_file) + if ext == ".po": + mo_file = base + ".mo" + po = polib.pofile(po_file) + po.save_as_mofile(fpath=mo_file) + print "done" +## End of HACK # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/doc/pip_requirements.txt b/doc/pip_requirements.txt new file mode 100644 index 00000000000..3deddc6a3df --- /dev/null +++ b/doc/pip_requirements.txt @@ -0,0 +1,2 @@ +polib>=1.0.3 +