Browse Source

🔨 Update script for generating new lang translations

pull/14701/head
Sebastián Ramírez 6 months ago
parent
commit
558fe87808
  1. 11
      scripts/docs.py

11
scripts/docs.py

@ -130,14 +130,9 @@ def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
new_path.mkdir() new_path.mkdir()
new_config_path: Path = Path(new_path) / mkdocs_name new_config_path: Path = Path(new_path) / mkdocs_name
new_config_path.write_text("INHERIT: ../en/mkdocs.yml\n", encoding="utf-8") new_config_path.write_text("INHERIT: ../en/mkdocs.yml\n", encoding="utf-8")
new_config_docs_path: Path = new_path / "docs" new_llm_prompt_path: Path = new_path / "llm-prompt.md"
new_config_docs_path.mkdir() new_llm_prompt_path.write_text("", encoding="utf-8")
en_index_path: Path = en_docs_path / "docs" / "index.md" print(f"Successfully initialized: {new_path}")
new_index_path: Path = new_config_docs_path / "index.md"
en_index_content = en_index_path.read_text(encoding="utf-8")
new_index_content = f"{missing_translation_snippet}\n\n{en_index_content}"
new_index_path.write_text(new_index_content, encoding="utf-8")
typer.secho(f"Successfully initialized: {new_path}", color=typer.colors.GREEN)
update_languages() update_languages()

Loading…
Cancel
Save