process_one_page() — fastapi Function Reference
Architecture documentation for the process_one_page() function in translation_fixer.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 8d7940c5_2d94_d372_3fa9_09a0650bdd5c["process_one_page()"] 99e3c039_dae8_2ebf_8149_637bcc119c08["translation_fixer.py"] 8d7940c5_2d94_d372_3fa9_09a0650bdd5c -->|defined in| 99e3c039_dae8_2ebf_8149_637bcc119c08 88c99a39_762e_5baa_a001_836a4fd4f946["fix_all()"] 88c99a39_762e_5baa_a001_836a4fd4f946 -->|calls| 8d7940c5_2d94_d372_3fa9_09a0650bdd5c 6fe1cd36_4a09_6df0_4022_4ae327713411["fix_pages()"] 6fe1cd36_4a09_6df0_4022_4ae327713411 -->|calls| 8d7940c5_2d94_d372_3fa9_09a0650bdd5c 63822d7d_03fc_4331_3f93_3026c9c03415["check_translation()"] 8d7940c5_2d94_d372_3fa9_09a0650bdd5c -->|calls| 63822d7d_03fc_4331_3f93_3026c9c03415 style 8d7940c5_2d94_d372_3fa9_09a0650bdd5c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
scripts/translation_fixer.py lines 65–98
def process_one_page(path: Path) -> bool:
"""
Fix one translated document by comparing it to the English version.
Returns True if processed successfully, False otherwise.
"""
try:
lang_code = path.parts[1]
if lang_code == "en":
print(f"Skipping English document: {path}")
return True
en_doc_path = Path("docs") / "en" / Path(*path.parts[2:])
doc_lines = path.read_text(encoding="utf-8").splitlines()
en_doc_lines = en_doc_path.read_text(encoding="utf-8").splitlines()
doc_lines = check_translation(
doc_lines=doc_lines,
en_doc_lines=en_doc_lines,
lang_code=lang_code,
auto_fix=True,
path=str(path),
)
# Write back the fixed document
doc_lines.append("") # Ensure file ends with a newline
path.write_text("\n".join(doc_lines), encoding="utf-8")
except ValueError as e:
print(f"Error processing {path}: {e}")
return False
return True
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does process_one_page() do?
process_one_page() is a function in the fastapi codebase, defined in scripts/translation_fixer.py.
Where is process_one_page() defined?
process_one_page() is defined in scripts/translation_fixer.py at line 65.
What does process_one_page() call?
process_one_page() calls 1 function(s): check_translation.
What calls process_one_page()?
process_one_page() is called by 2 function(s): fix_all, fix_pages.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free