Skip to content

Add export-translation script#1991

Open
ajparsons wants to merge 1 commit intomasterfrom
translation-export-helper
Open

Add export-translation script#1991
ajparsons wants to merge 1 commit intomasterfrom
translation-export-helper

Conversation

@ajparsons
Copy link
Contributor

Quick LLM-assisted export tool to make working with translations a bit easier:

  • Easier csv export to make back and forth with heloblod easier.
  • Flag translations we've marked as auto (which feels like a good compromise to keep things going with small tweaks while doing updates in batches)

- Easier csv export to make back and forth with heloblod easier.
- Flag translations we've marked as auto.
@ajparsons ajparsons requested a review from struan February 23, 2026 11:22
Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I export and import it seems to introduce a lot of additional msgid "" and equivalent msgstr lines on anything that's a multiline string which I'm not sure is helpful and produces diffs that are hard to follow.

The json path seems to work, the csv side not so much. And modulo the above it seems to work fine.

translation_type: TranslationType
original: str
current_translation: str
locations: list[str] # List of "filename:line" strings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output sometimes produces an empty array which then fails validation on re-import which doesn't seem ideal

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only seems to be the case if you are using csv files



@app.command()
def import_translations(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could just be import to match export and be less wordy

"--dry-run",
"-n",
help="Show what would be changed without making changes",
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my preference is always to make dry run the default and you have to pass a flag to commit things because that way the default doesn't do any harm. Not that it really matters here because it's easy to undo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants