WIP: Interactive mode: support different URLs for translation #26

Closed
maciek wants to merge 16 commits from maciek/potodo:support-non-fr-forges into main
Contributor
  • Includes rudimentary translation of the issue title
  • By default supporting AFPy URLs layout (backwards compatibility)
  • Special treatment for GitHub (changing the domain)
  • Transifex support
* Includes rudimentary translation of the issue title * By default supporting AFPy URLs layout (backwards compatibility) * Special treatment for GitHub (changing the domain) * Transifex support
* Includes rudimentary translation of the issue title
* By default supporting AFPy URLs layout (backwards compatibility)
* Special treatment for GitHub (changing the domain)
maciek force-pushed support-non-fr-forges from 26c997b7da to dfa6856da4
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_metadata/woodpecker Pipeline failed
2025-10-23 14:03:36 +02:00
Compare
maciek changed title from Support non-French forges to WIP: Support non-French forges 2025-10-23 16:18:39 +02:00
Owner

What about just matching paths?

If someone writes "Blah blah library/curses.ascii.po" I bet it should be marked as reserved.

Funnily enough, I'm here because it just happened to me on AFPy/python-docs-fr#348

What about just matching paths? If someone writes "Blah blah library/curses.ascii.po" I bet it should be marked as reserved. Funnily enough, I'm here because it just happened to me on https://git.afpy.org/AFPy/python-docs-fr/pulls/348
maciek changed title from WIP: Support non-French forges to WIP: Support non-French forges for new reservations 2025-10-23 22:00:31 +02:00
Author
Contributor

@mdk wrote in #26 (comment):

What about just matching paths?

If someone writes "Blah blah library/curses.ascii.po" I bet it should be marked as reserved.

Funnily enough, I'm here because it just happened to me on AFPy/python-docs-fr#348

It's already handled if you don't filter with type=issues in the API URL. Then the potodo look-ups all PRs' modified files and marks them as reserved. https://git.afpy.org/AFPy/potodo/src/branch/main/potodo/forge_api.py#L46-L57

 % uvx --from git+https://git.afpy.org/afpy/potodo potodo -p ../python-docs-pl/library --exclude '**/*' '!curses.ascii.po' --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open'
1 directory  0.84% done
└── library/  0.84% done
    └── curses.ascii.po                    3 /  69 (  4.0% translated), reserved by mdk

Before it was filtering out all PRs, leaving issues only.

@mdk wrote in https://git.afpy.org/AFPy/potodo/pulls/26#issuecomment-5339: > What about just matching paths? > > If someone writes "Blah blah library/curses.ascii.po" I bet it should be marked as reserved. > > Funnily enough, I'm here because it just happened to me on AFPy/python-docs-fr#348 It's already handled if you don't filter with `type=issues` in the API URL. Then the potodo look-ups all PRs' modified files and marks them as reserved. https://git.afpy.org/AFPy/potodo/src/branch/main/potodo/forge_api.py#L46-L57 ``` % uvx --from git+https://git.afpy.org/afpy/potodo potodo -p ../python-docs-pl/library --exclude '**/*' '!curses.ascii.po' --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open' 1 directory 0.84% done └── library/ 0.84% done └── curses.ascii.po 3 / 69 ( 4.0% translated), reserved by mdk ``` Before it was filtering out all PRs, leaving issues only.
Merge remote-tracking branch 'upstream/main' into support-non-fr-forges
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
5228bb0604
# Conflicts:
#	potodo/interactive.py
#	potodo/potodo.py
#	tests/test_forge.py
maciek force-pushed support-non-fr-forges from 5228bb0604
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
to 9b3862a8af
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_metadata/woodpecker Pipeline failed
2025-10-24 00:09:25 +02:00
Compare
maciek changed title from WIP: Support non-French forges for new reservations to Support non-French forges for new reservations 2025-10-24 00:11:29 +02:00
maciek requested review from mdk 2025-10-24 00:11:36 +02:00
maciek changed title from Support non-French forges for new reservations to WIP: Support non-French forges for new reservations 2025-10-24 00:15:38 +02:00
Support paths, reformat
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_metadata/woodpecker Pipeline failed
22291ba4dc
maciek changed title from WIP: Support non-French forges for new reservations to Interactive mode: support different URLs for translation 2025-10-24 02:21:40 +02:00
Owner

I'm getting an attribute error:

mdk@kalir ~/s/p/python-docs-fr (mdk-curses|✚1) [2]> potodo --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' -p library/
Traceback (most recent call last):
  File "/home/mdk/src/python/python-docs-fr/.venv/bin/potodo", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/potodo.py", line 134, in main
    po_directories.fetch_issues(forge.api_url)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/po_file.py", line 163, in fetch_issues
    directory.fetch_issues(api_url)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/po_file.py", line 362, in fetch_issues
    issue_reservations = get_issue_reservations(api_url)
  File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/forge_api.py", line 21, in get_issue_reservations
    logging.info("Getting issue reservations from %s", urlparse(host.api_url).hostname)
                                                                ^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'api_url'
I'm getting an attribute error: ``` mdk@kalir ~/s/p/python-docs-fr (mdk-curses|✚1) [2]> potodo --api-url 'https://git.afpy.org/api/v1/repos/AFPy/python-docs-fr/issues?state=open&type=issues' -p library/ Traceback (most recent call last): File "/home/mdk/src/python/python-docs-fr/.venv/bin/potodo", line 8, in <module> sys.exit(main()) ~~~~^^ File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/potodo.py", line 134, in main po_directories.fetch_issues(forge.api_url) ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/po_file.py", line 163, in fetch_issues directory.fetch_issues(api_url) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/po_file.py", line 362, in fetch_issues issue_reservations = get_issue_reservations(api_url) File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/potodo/forge_api.py", line 21, in get_issue_reservations logging.info("Getting issue reservations from %s", urlparse(host.api_url).hostname) ^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'api_url' ```
maciek changed title from Interactive mode: support different URLs for translation to WIP: Interactive mode: support different URLs for translation 2025-10-27 10:27:50 +01:00
Pass the forge also to get reservations
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_closed/woodpecker Pipeline failed
44b3de6be3
Owner

See #33.

See #33.
Author
Contributor

Closing in favour of #33.

Closing in favour of #33.
maciek closed this pull request 2025-11-18 00:38:14 +01:00
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
ci/woodpecker/pull_request_closed/woodpecker Pipeline failed

Pull request closed

Sign in to join this conversation.
No reviewers
mdk
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AFPy/potodo!26
No description provided.