From 3bd46e20aa74b5a13501c90c8da574eee0e8882d Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Sat, 2 Nov 2013 17:09:00 +0900 Subject: [PATCH 1/4] generate .mo files in all available languages --- doc/conf.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 535999a8e74..794cbe0e58b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -76,6 +76,24 @@ # 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: From de0fc537c2e3033df01875568f2656464f18ac91 Mon Sep 17 00:00:00 2001 From: maskit Date: Mon, 28 Oct 2013 00:21:23 +0900 Subject: [PATCH 2/4] add a pip requirements file --- doc/pip_requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/pip_requirements.txt 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 + From f1b70a9ab85788f8a81bf6633bd06cbffe6b6647 Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Sun, 3 Nov 2013 15:58:51 +0900 Subject: [PATCH 3/4] add log messages --- doc/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/conf.py b/doc/conf.py index 794cbe0e58b..c3244bff4fe 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -93,6 +93,7 @@ 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 From b7da73dce83eeecf9ba5b374e5b48deaa577de10 Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Mon, 4 Nov 2013 12:35:26 +0900 Subject: [PATCH 4/4] ignore doc/locale/pot --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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