Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

⚒️ Update translate script, show and update outdated translations#13933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tiangolo merged 3 commits intomasterfromtranslate-script-old
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsrequirements-translations.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
pydantic-ai==0.0.30
GitPython==3.1.45
35 changes: 35 additions & 0 deletionsscripts/translate.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@
from pathlib import Path
from typing import Iterable

import git
import typer
import yaml
from pydantic_ai import Agent
Expand DownExpand Up@@ -243,5 +244,39 @@ def remove_all_removable() -> None:
print("Done removing all removable paths")


@app.command()
def list_outdated(lang: str) -> list[Path]:
dir_path = Path(__file__).absolute().parent.parent
repo = git.Repo(dir_path)

outdated_paths: list[Path] = []
en_lang_paths = list(iter_en_paths_to_translate())
for path in en_lang_paths:
lang_path = generate_lang_path(lang=lang, path=path)
if not lang_path.exists():
outdated_paths.append(path)
continue
en_commit_datetime = list(repo.iter_commits(paths=path, max_count=1))[
0
].committed_datetime
lang_commit_datetime = list(repo.iter_commits(paths=lang_path, max_count=1))[
0
].committed_datetime
if lang_commit_datetime < en_commit_datetime:
outdated_paths.append(path)
print(outdated_paths)
return outdated_paths


@app.command()
def update_outdated(lang: str) -> None:
outdated_paths = list_outdated(lang)
for path in outdated_paths:
print(f"Updating lang: {lang} path: {path}")
translate_page(lang=lang, path=path)
print(f"Done updating: {path}")
print("Done updating all outdated paths")


if __name__ == "__main__":
app()

[8]ページ先頭

©2009-2026 Movatter.jp