Repository navigation
Talk to Transifex's API instead of using tx - #84
Merged
Merged
Conversation
hatstand
force-pushed
the
claude/project-thread-l6fkzp
branch
6 times, most recently
from
November 8, 2026 17:49
11bda99 to
3fb73a7
Compare
Transifex stopped making the String Catalog's translation files once the catalog had a string with substitutions (a plural of one of its numbers, here "Downloading %lld of %lld songs…") that wasn't translated yet: every download mode but onlytranslated fails with a parse_error, "'NoneType' object is not iterable", which tx doesn't show. So every pull failed, and with it every push, which pulls first. scripts/transifex.py replaces tx and the shell and merge scripts. Its pull reads each language's translations from the API as data, with their strings, and puts each catalog entry together itself, substitutions included: Transifex keeps a substitution as a string of its own, "<key>.substitutions.<name>", and writes a "." in a key as "\.". One pass takes reviewed and unreviewed translations alike, which needed two downloads before. The placeholder check and the catalog's formatting are as before, and a pull lists the catalog's strings Transifex doesn't have yet. push-source and push-translations upload the catalog as tx did, and print Transifex's errors when it refuses one. Run against Transifex, the pull changes only the 7 translations made since the last one. The scripts run with uv, and a Python job in CI checks them with ruff, ty and pytest, as in the Android remote. Also removes import-android-translations.py, the one-off import from before the app was on Transifex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2bAq7fKGbJyhCgNr9zbNH
hatstand
force-pushed
the
claude/project-thread-l6fkzp
branch
from
November 8, 2026 17:50
3fb73a7 to
0e71c14
Compare
hatstand
enabled auto-merge (rebase)
November 8, 2026 17:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by John · project thread
Since 8 November, every run of the translations workflow has failed with
failed to download translation, both the nightly pull and the push, which pulls first. Transifex stopped making the String Catalog's translation files once the catalog had a string with substitutions (a plural of one of its numbers, here "Downloading %lld of %lld songs…") that nobody had translated yet. Asked directly, the API gives the reason thattxleaves out:Every download mode fails like this except
onlytranslated. The pull usedonlyreviewedas well.What changes
scripts/transifex.pyreplacestx,.tx/config,pull-transifex-translations.shandmerge-transifex-translations.py:pullasks for each language's translations as data (/resource_translationswith theirresource_strings) rather than as files, and builds each catalog entry from them, substitutions included. Transifex keeps a substitution as a string of its own,<key>.substitutions.<name>, and writes a.in a key as\.. One pass takes reviewed and unreviewed translations alike, which used to take two downloads. The placeholder check and the Xcode-style formatting are unchanged. A pull also lists any catalog strings Transifex doesn't have yet.push-sourceandpush-translationsupload the catalog astx pushdid, wait for Transifex to process it, and print Transifex's errors if it refuses.The scripts run with uv. A new Python CI job, which the
CIcheck now requires, runs ruff, ty and pytest with the same settings as the Android remote.import-android-translations.pyis removed: it was the one-off import from before the app was on Transifex, and running it now would overwrite Transifex's translations.Testing
push-sourcesent the two strings that were missing because of the failures. Afterwards Transifex's per-language counts still matched the catalog.Once this merges, the push it triggers pulls those 7 translations and pushes the catalog. The nightly pull then commits them.
🤖 Generated with Claude Code
https://claude.ai/code/session_01R2bAq7fKGbJyhCgNr9zbNH