We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5927c3 commit e546f79Copy full SHA for e546f79
1 file changed
scripts/stats.py
@@ -17,11 +17,16 @@
17
18
def main() -> None:
19
"""Main function to generate translation stats."""
20
- language = os.environ.get("PYDOC_LANGUAGE")
21
- if not language:
22
- raise ValueError("Environment variable PYDOC_LANGUAGE is not set.")
23
24
- pofiles_path = Path(f"cpython/Doc/locales/{language}/LC_MESSAGES")
+ lang_dir = os.environ.get("PYDOC_LANG_DIR")
+ if lang_dir:
+ pofiles_path = lang_dir
+ else:
25
+ language = os.environ.get("PYDOC_LANGUAGE")
26
+ if not language:
27
+ raise ValueError("Environment variable PYDOC_LANGUAGE is not set.")
28
+ pofiles_path = Path(f"cpython/Doc/locales/{language}/LC_MESSAGES")
29
+
30
if not pofiles_path.exists():
31
raise FileNotFoundError(f"Path does not exist: {pofiles_path}")
32
0 commit comments