summaryrefslogtreecommitdiffstats
path: root/docs/source/conf.py
diff options
context:
space:
mode:
authorbendikro <bro.devel+deluge@gmail.com>2016-01-17 17:13:45 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2016-10-30 12:45:02 +0000
commit1e183a32587d04e5e4abb2857f93d9f0a67b5450 (patch)
treeb1d9cabbb0f1a6d61dd91572613ff6df19776afd /docs/source/conf.py
parent891209d92590f48b7cd96ed6df4f60b2586f3d71 (diff)
downloaddeluge-1e183a32587d04e5e4abb2857f93d9f0a67b5450.tar.gz
deluge-1e183a32587d04e5e4abb2857f93d9f0a67b5450.tar.bz2
deluge-1e183a32587d04e5e4abb2857f93d9f0a67b5450.zip
[UI] Add gettext.ngettext to __builtin__.__dict__
Handle plurality with getttext using ngettext. Added to __builtin__.__dict__ as _n
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r--docs/source/conf.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py
index e5e140ffa..2b9aae06f 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -10,6 +10,7 @@
# All configuration values have a default value; values that are commented out
# serve to show the default value.
+import __builtin__
import os
import sys
from datetime import date
@@ -21,6 +22,10 @@ try:
except ImportError:
get_version = None
+# Must add these for autodoc to import packages successully
+__builtin__.__dict__["_"] = lambda x: x
+__builtin__.__dict__["_n"] = lambda s, p, n: s if n == 1 else p
+
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.