INNER CODE UNIT · Python
main
multitheftauto/mtasa-blue · utils/localization/build_gettext_catalog.py:43
def main(output: Path, version: str, xgettext: str, paths: t.Optional[t.List[Path]] = None) -> None:
paths = paths or [Path("Client"), Path("Shared")]
# If we have .pot in the destination, strip it (xgettext seems to append an extension regardless)
output = output.with_suffix("")
files = get_source_files_from_dirs(paths)
print ( f"Files found: {len(files)}" )
# xgettext requires a list of filepaths in a newline delimited file
# so we create a tmpfile containing all our paths and give it to xgettext
fd, fp_path = tempfile.mkstemp()
fp_path = Path(fp_path)
with fp_path.open("w", encoding="utf-8") as fp:
write_directory_list_file(files, fp)
try:
subprocess.run([