docs: move translated READMEs under docs/readme (#2165)
Move all 18 translated READMEs into docs/readme/ and keep the English entry at the repository root. Update navigation, guide/image paths, website discovery and documentation checks together. Preserve the contributor's work and current main content. Cover every translated command and HTML destination, and repair the verified Persian heading fragments. Validation: 203 focused tests on the synchronized head, plus 119 tests and documentation checks on the integration with main fc0dbe7f9; 1,501 local references and 399 authored fragments verified. The complete CI workflow passes. The upstream x64 dylib fixture correction is included; an unchanged-checkout rerun cleared the earlier deadline timing assertion. Closes #2141 Co-authored-by: Aimal Khan <94559553+aimalexe@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Kaoru0822
factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent
865c35e25a
commit
cbe769b504
+18
-3
@@ -25,11 +25,27 @@ LITERALS = {"REA", "Reverse Engineer Anything", "REA · Reverse Engineer Anythin
|
||||
FALLBACK_NOTICE = "Translation is being updated. Read this page in English for now."
|
||||
|
||||
|
||||
def readme_edition_paths(root):
|
||||
"""Return repo-relative README editions: root English plus docs/readme translations."""
|
||||
editions = set()
|
||||
if (root / "README.md").is_file():
|
||||
editions.add("README.md")
|
||||
folder = root / "docs" / "readme"
|
||||
if folder.is_dir():
|
||||
editions.update(
|
||||
f"docs/readme/{path.name}"
|
||||
for path in folder.glob("README_*.md")
|
||||
if path.is_file()
|
||||
)
|
||||
return editions
|
||||
|
||||
|
||||
def languages(root):
|
||||
"""Load the website language inventory and check it against README editions."""
|
||||
path = root / "website/locales/languages.json"
|
||||
editions = readme_edition_paths(root)
|
||||
if not path.exists():
|
||||
if any(root.glob("README_*.md")):
|
||||
if any(edition != "README.md" for edition in editions):
|
||||
raise ValueError("Missing languages.json for the translated README editions")
|
||||
return [{"code": "en", "name": "English", "readme": "README.md", "dir": "ltr"}]
|
||||
data = json.loads(path.read_text(encoding="utf-8"))
|
||||
@@ -49,8 +65,7 @@ def languages(root):
|
||||
raise ValueError(f"Duplicate README edition: {item['readme']}")
|
||||
codes.add(item["code"])
|
||||
filenames.add(item["readme"])
|
||||
readmes = {path.name for path in root.glob("README*.md")}
|
||||
if readmes and ({item["readme"] for item in data} != readmes):
|
||||
if editions and ({item["readme"] for item in data} != editions):
|
||||
raise ValueError("Website languages must match the README language editions")
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user