Skip to content

Commit

Permalink
Use pathlib in sphinx.transforms.i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 5, 2024
1 parent 5b1dc82 commit e8db437
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sphinx/transforms/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import contextlib
import os.path
from re import DOTALL, match
from textwrap import indent
from typing import TYPE_CHECKING, Any, TypeVar
Expand Down Expand Up @@ -394,10 +393,8 @@ def apply(self, **kwargs: Any) -> None:
textdomain = docname_to_domain(self.env.docname, self.config.gettext_compact)

# fetch translations
dirs = [
os.path.join(self.env.srcdir, directory)
for directory in self.config.locale_dirs
]
srcdir = self.env.srcdir
dirs = [srcdir / directory for directory in self.config.locale_dirs]
catalog, has_catalog = init_locale(dirs, self.config.language, textdomain)
if not has_catalog:
return
Expand Down

0 comments on commit e8db437

Please sign in to comment.