📝 Add documentation for non-translated pages and scripts to verify them (#12020)

This commit is contained in:
Sebastián Ramírez
2024-08-14 17:57:10 -05:00
committed by GitHub
parent 75705617a6
commit 85bd4067c2
41 changed files with 55 additions and 1046 deletions

View File

@@ -26,6 +26,15 @@ missing_translation_snippet = """
{!../../../docs/missing-translation.md!}
"""
non_translated_sections = [
"reference/",
"release-notes.md",
"external-links.md",
"newsletter.md",
"management-tasks.md",
"management.md",
]
docs_path = Path("docs")
en_docs_path = Path("docs/en")
en_config_path: Path = en_docs_path / mkdocs_name
@@ -333,10 +342,34 @@ def verify_config() -> None:
typer.echo("Valid mkdocs.yml ✅")
@app.command()
def verify_non_translated() -> None:
"""
Verify there are no files in the non translatable pages.
"""
print("Verifying non translated pages")
lang_paths = get_lang_paths()
error_paths = []
for lang in lang_paths:
if lang.name == "en":
continue
for non_translatable in non_translated_sections:
non_translatable_path = lang / "docs" / non_translatable
if non_translatable_path.exists():
error_paths.append(non_translatable_path)
if error_paths:
print("Non-translated pages found, remove them:")
for error_path in error_paths:
print(error_path)
raise typer.Abort()
print("No non-translated pages found ✅")
@app.command()
def verify_docs():
verify_readme()
verify_config()
verify_non_translated()
@app.command()