Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/set-alias-page.py: Improve sync translations #15389

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e94501a
Update set alias page when file already exists
Zamoca42 Dec 30, 2024
cf7648e
Update Korean translation alias pages
Zamoca42 Dec 30, 2024
b7895f8
Revert "Update Korean translation alias pages"
Zamoca42 Dec 30, 2024
f21edaf
Update original command
Zamoca42 Dec 30, 2024
ecf2dd9
Add Korean translation for alias pages
Zamoca42 Dec 30, 2024
a2394f3
Revert "Add Korean translation for alias pages"
Zamoca42 Dec 30, 2024
6e641be
Improve alias page template processing
Zamoca42 Dec 30, 2024
7138ad6
Add Korean translation for alias pages
Zamoca42 Dec 30, 2024
4ca4c90
Update format of alias pages
Zamoca42 Dec 30, 2024
56a6cfc
Update format of alias pages
Zamoca42 Dec 30, 2024
14d4685
Reformat scripts/set-alias-page.py
Zamoca42 Dec 30, 2024
5ef6671
Merge branch 'main' into update-set-alias-page
Zamoca42 Dec 30, 2024
004a9a5
Remove Korean alias pages
Zamoca42 Dec 31, 2024
34733d9
Reverting Korean alias pages template
Zamoca42 Dec 31, 2024
35f8fc8
Restore regex for alias page parsing
Zamoca42 Dec 31, 2024
1e8d78e
Merge branch 'main' into update-set-alias-page
Zamoca42 Dec 31, 2024
08d0b39
Update parsing alias page command
Zamoca42 Jan 2, 2025
7db9d2e
Merge branch 'main' into update-set-alias-page
Zamoca42 Jan 2, 2025
424087f
Update comment
Zamoca42 Jan 2, 2025
0f06818
Update command arguments to support separate original and documentati…
Zamoca42 Jan 2, 2025
672259c
Add original_command arguments optional
Zamoca42 Jan 2, 2025
f5b9df6
Merge branch 'main' into update-set-alias-page
sebastiaanspeck Jan 2, 2025
cf45691
Add get_locale_alias_pattern and fix flag collision
Zamoca42 Jan 2, 2025
2da1472
Add command parsing test function
Zamoca42 Jan 2, 2025
355fa47
Fix ORIGINAL_CMD argument
Zamoca42 Jan 3, 2025
97846ac
Merge branch 'main' into update-set-alias-page
Zamoca42 Jan 3, 2025
5adeab7
Update scripts/set-alias-page.py
Zamoca42 Jan 3, 2025
ee9665f
Update scripts/set-alias-page.py
Zamoca42 Jan 3, 2025
538d1f4
Update scripts/set-alias-page.py
Zamoca42 Jan 3, 2025
60252c4
Update page only when documentation command changes
Zamoca42 Jan 3, 2025
9f3dc8a
Merge branch 'main' into update-set-alias-page
sebastiaanspeck Jan 3, 2025
93bd8c5
Add wizard to page arg and refactor sync
Zamoca42 Jan 4, 2025
f373f3d
Merge branch 'main' into update-set-alias-page
Zamoca42 Jan 4, 2025
b496d9d
Update script file documents
Zamoca42 Jan 4, 2025
c904cd3
Rename command to page_path for clarity
Zamoca42 Jan 4, 2025
91ae2ca
Refactor to use global Config
Zamoca42 Jan 4, 2025
a0f401c
Add AliasPageContent dataclass for title and commands
Zamoca42 Jan 4, 2025
bffeb7a
Update global state and simplify sync logic
Zamoca42 Jan 4, 2025
2f4391f
Rename functions and variables for clarity
Zamoca42 Jan 4, 2025
b643eb6
Update scripts/set-alias-page.py
Zamoca42 Jan 6, 2025
a123833
Add check_exists flag to get_target_paths()
Zamoca42 Jan 6, 2025
c81ea1f
Update docstring indentation
Zamoca42 Jan 6, 2025
6573a77
Merge branch 'main' into update-set-alias-page
Zamoca42 Jan 6, 2025
28602dc
Update prompt with page status and documentation
Zamoca42 Jan 6, 2025
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
11 changes: 7 additions & 4 deletions scripts/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,20 @@ def test_get_pages_dir():
shutil.rmtree(root, True)


def get_target_paths(page: Path, pages_dirs: Path) -> list[Path]:
def get_target_paths(
page: Path, pages_dirs: Path, check_exists: bool = True
) -> list[Path]:
"""
Get all paths in all languages that match the page.

Parameters:
page (Path): the page to search for.
pages_dirs (Path): directories to search in
check_exists (bool): whether to only return existing paths (default: True)

Returns:
list (list of Path's): A list of Path's.
"""

target_paths = []

if not page.lower().endswith(".md"):
Expand All @@ -154,12 +157,12 @@ def get_target_paths(page: Path, pages_dirs: Path) -> list[Path]:
for pages_dir in pages_dirs:
page_path = pages_dir / arg_platform / arg_page

if not page_path.exists():
if check_exists and not page_path.exists():
print(create_colored_line(Colors.RED, f"Page {page_path} does not exist"))
continue
target_paths.append(page_path)

target_paths.sort()

return target_paths


Expand Down
Loading
Loading