translations to-spreadsheet: --program-id filter and short locale references#106
Open
tokland wants to merge 2 commits into
Open
translations to-spreadsheet: --program-id filter and short locale references#106tokland wants to merge 2 commits into
tokland wants to merge 2 commits into
Conversation
Add a --program-id option to `translations to-spreadsheet`. When set, objects
are taken from that program's metadata dependency export
(/api/programs/{id}/metadata) instead of the whole instance, so each generated
spreadsheet is scoped to a single program.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…aders Locale references passed to `translations to-spreadsheet --locales` now match by exact base name first, then by substring, so "Sotho" resolves to "Southern Sotho (Lesotho)". A reference matching more than one locale is ambiguous and errors; no match warns and is skipped (as before). The resolved locale's " (...)" suffix is stripped from the column header, so headers are shorter and round-trip with `from-spreadsheet`, which matches headers against suffix-stripped DB names. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes https://app.clickup.com/t/4528615/869dc4guz?comment=90120236273934
Follow-up to #101, adding two capabilities to
translations to-spreadsheet.Changes
--program-idfilter. When set, objects are taken from that program's metadata dependency export (/api/programs/{id}/metadata) instead of the whole instance, so each generated spreadsheet is scoped to a single program.--localesnow matches by exact base name first, then by substring, soSothoresolves toSouthern Sotho (Lesotho). A reference matching more than one locale is ambiguous and errors; no match warns and is skipped (as before).(...)qualifier is dropped from the column header (formName: Southern Sothoinstead offormName: Southern Sotho (Lesotho)). This also fixes the round-trip:from-spreadsheetmatches headers against suffix-stripped DB names, so previously any locale with a(country)suffix would not re-import.Test plan
ExportTranslationsUseCase.spec.ts(short/substring match, ambiguity error, stripped header, program-scoped fetch).yarn vitest rungreen;tsc --noEmitclean.Sotho→Southern Sothoheader; and afrom-spreadsheet --postround-trip added ast_LStranslation while preserving existing ones.