API tokens page: an English placeholder, and each token's scopes shown as raw keys #432
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#432
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the API token form and its page.Checked again on 2026-10-01 against
mainat0a5cad587: still present.The API tokens page shows English whatever the interface language in two places. The name field's placeholder is a bare string, and each token in the list names its scopes by their wire keys (
captures, read), although the checkboxes just above showed the same scopes as translated sentences.ApiToken.scope_labelsexists to give those sentences and nothing on the page uses it.api/forms.py:23(ApiTokenForm.name,attrs={"placeholder": "Firefox on the laptop"}, not wrapped in_());templates/api/token_list.html:70(· {{ token.scopes|join:", " }});api/models.py:131-133(ApiToken.scope_labels, used only bytests/test_api.py:48).captures, documents:read, readwhile the form above offered "Capture postings", "Download the files themselves" and "Read everything: …" in Portuguese._(). In the list, rendertoken.scope_labelsrather thantoken.scopes. The labels are sentences that contain commas and colons themselves, so joining them with", "would read as one run-on list; render each as its own item (a small list or one badge per scope), with the key beside it in<code>if a developer needs it.Done when
tests/test_api.pythat renders the token list under a non-English language with a token holdingreadandcapturesfinds the translatedSCOPESlabels and not the barecaptures, read, and finds the placeholder among the catalogue's msgids (makemessagespicks it up).Landed on main with a green Forgejo CI run. Its entry in the CHANGELOG's Unreleased section ends in (#432).