File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1717
1818def main () -> None :
1919 """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." )
2320
24- pofiles_path = Path (f"cpython/Doc/locales/{ language } /LC_MESSAGES" )
21+ lang_dir = os .environ .get ("PYDOC_LANG_DIR" )
22+ if lang_dir :
23+ pofiles_path = lang_dir
24+ 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+
2530 if not pofiles_path .exists ():
2631 raise FileNotFoundError (f"Path does not exist: { pofiles_path } " )
2732
You can’t perform that action at this time.
0 commit comments