Home / Function/ new_lang() — fastapi Function Reference

new_lang() — fastapi Function Reference

Architecture documentation for the new_lang() function in docs.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  78487f53_c014_0416_8677_9359793a7c4c["new_lang()"]
  089911a1_02c3_0f6b_d62d_71c980ade67e["docs.py"]
  78487f53_c014_0416_8677_9359793a7c4c -->|defined in| 089911a1_02c3_0f6b_d62d_71c980ade67e
  94647f4e_574e_b56c_5e99_8caf1b29664e["update_languages()"]
  78487f53_c014_0416_8677_9359793a7c4c -->|calls| 94647f4e_574e_b56c_5e99_8caf1b29664e
  style 78487f53_c014_0416_8677_9359793a7c4c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/docs.py lines 127–141

def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
    """
    Generate a new docs translation directory for the language LANG.
    """
    new_path: Path = Path("docs") / lang
    if new_path.exists():
        typer.echo(f"The language was already created: {lang}")
        raise typer.Abort()
    new_path.mkdir()
    new_config_path: Path = Path(new_path) / mkdocs_name
    new_config_path.write_text("INHERIT: ../en/mkdocs.yml\n", encoding="utf-8")
    new_llm_prompt_path: Path = new_path / "llm-prompt.md"
    new_llm_prompt_path.write_text("", encoding="utf-8")
    print(f"Successfully initialized: {new_path}")
    update_languages()

Domain

Subdomains

Defined In

Frequently Asked Questions

What does new_lang() do?
new_lang() is a function in the fastapi codebase, defined in scripts/docs.py.
Where is new_lang() defined?
new_lang() is defined in scripts/docs.py at line 127.
What does new_lang() call?
new_lang() calls 1 function(s): update_languages.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free