Fixed docname resolution.

This commit is contained in:
Robert Lehmann 2010-07-14 23:41:38 +02:00
parent 38e1e7770f
commit fda1d0985a

View File

@ -191,7 +191,8 @@ class Locale(Transform):
env = self.document.settings.env
settings, source = self.document.settings, self.document['source']
# XXX check if this is reliable
docname = posixpath.splitext(posixpath.basename(source))[0]
assert source.startswith(env.srcdir)
docname = posixpath.splitext(source[len(env.srcdir):].lstrip('/'))[0]
section = docname.split(SEP, 1)[0]
# fetch translations