Updated Branches: refs/heads/master 94215bf29 -> d314e59f9
generate .mo files in all available languages Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3bd46e20 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3bd46e20 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3bd46e20 Branch: refs/heads/master Commit: 3bd46e20aa74b5a13501c90c8da574eee0e8882d Parents: 94215bf Author: Masakazu Kitajo <[email protected]> Authored: Sat Nov 2 17:09:00 2013 +0900 Committer: Masakazu Kitajo <[email protected]> Committed: Thu Nov 7 22:44:07 2013 +0900 ---------------------------------------------------------------------- doc/conf.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3bd46e20/doc/conf.py ---------------------------------------------------------------------- diff --git a/doc/conf.py b/doc/conf.py index 535999a..794cbe0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -76,6 +76,24 @@ release = '4.1.x' # 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) +## End of HACK # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used:
