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

Function new_lang

scripts/docs.py:133–145  ·  view source on GitHub ↗

Generate a new docs translation directory for the language LANG.

(lang: str = typer.Argument(..., callback=lang_callback))

Source from the content-addressed store, hash-verified

131
132@app.command()
133def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
134 """
135 Generate a new docs translation directory for the language LANG.
136 """
137 new_path: Path = Path("docs") / lang
138 if new_path.exists():
139 typer.echo(f"The language was already created: {lang}")
140 raise typer.Abort()
141 new_path.mkdir()
142 new_llm_prompt_path: Path = new_path / "llm-prompt.md"
143 new_llm_prompt_path.write_text("", encoding="utf-8")
144 print(f"Successfully initialized: {new_path}")
145 update_languages()
146
147
148@app.command()

Callers

nothing calls this directly

Calls 2

update_languagesFunction · 0.85
PathClass · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…