mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use pathlib in `sphinx.transforms.i18n
`
This commit is contained in:
parent
5b1dc828ca
commit
e8db4379d4
@ -3,7 +3,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import os.path
|
|
||||||
from re import DOTALL, match
|
from re import DOTALL, match
|
||||||
from textwrap import indent
|
from textwrap import indent
|
||||||
from typing import TYPE_CHECKING, Any, TypeVar
|
from typing import TYPE_CHECKING, Any, TypeVar
|
||||||
@ -394,10 +393,8 @@ class Locale(SphinxTransform):
|
|||||||
textdomain = docname_to_domain(self.env.docname, self.config.gettext_compact)
|
textdomain = docname_to_domain(self.env.docname, self.config.gettext_compact)
|
||||||
|
|
||||||
# fetch translations
|
# fetch translations
|
||||||
dirs = [
|
srcdir = self.env.srcdir
|
||||||
os.path.join(self.env.srcdir, directory)
|
dirs = [srcdir / directory for directory in self.config.locale_dirs]
|
||||||
for directory in self.config.locale_dirs
|
|
||||||
]
|
|
||||||
catalog, has_catalog = init_locale(dirs, self.config.language, textdomain)
|
catalog, has_catalog = init_locale(dirs, self.config.language, textdomain)
|
||||||
if not has_catalog:
|
if not has_catalog:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user