MCPcopy Index your code
hub / github.com/fastapi/fastapi / generate_lang_path

Function generate_lang_path

scripts/translate.py:41–48  ·  view source on GitHub ↗
(*, lang: str, path: Path)

Source from the content-addressed store, hash-verified

39
40
41def generate_lang_path(*, lang: str, path: Path) -> Path:
42 en_docs_path = Path("docs/en/docs")
43 assert str(path).startswith(str(en_docs_path)), (
44 f"Path must be inside {en_docs_path}"
45 )
46 lang_docs_path = Path(f"docs/{lang}/docs")
47 out_path = Path(str(path).replace(str(en_docs_path), str(lang_docs_path)))
48 return out_path
49
50
51def generate_en_path(*, lang: str, path: Path) -> Path:

Callers 4

translate_pageFunction · 0.85
translate_langFunction · 0.85
list_missingFunction · 0.85
list_outdatedFunction · 0.85

Calls 1

PathClass · 0.50

Tested by

no test coverage detected