Skip to content

Add translations to-spreadsheet (template generation) - #101

Merged
adrianq merged 9 commits into
developmentfrom
feature/translations-generation
Jun 29, 2026
Merged

adrianq merged 9 commits into
developmentfrom
feature/translations-generation

Conversation

@tokland

@tokland tokland commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ClickUp: https://app.clickup.com/t/4528615/869dek7uv

Translations: to-spreadsheet

Adds translations to-spreadsheet, the reverse of from-spreadsheet: generate a styled, re-importable xlsx of metadata translations straight from a DHIS2 instance (one tab per model, color-coded field groups, frozen header/columns, configurable models/fields/locales, header-only template or --include-data).

Usage and options are documented in the README on this branch: README → To spreadsheet.

tokland and others added 9 commits June 15, 2026 13:02
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract translationFieldToProperty and use _.snakeCase so properties with more
than one underscore (e.g. LEFT_SIDE_DESCRIPTION) convert correctly. Reuse it in
the import repository instead of the previous inline conversion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Generate a styled xlsx (one tab per model) from a DHIS2 instance, mirroring
'from-spreadsheet'. Per-model translatable fields are required (model[field1,...]),
locales are selected by name in the given order, and --include-data fills source
values and existing translations (otherwise a header-only template is produced).

The sheet groups columns by field, color-codes each group, freezes the header row
and first three columns, and is re-importable by 'from-spreadsheet'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract ExportTranslationsSpreadsheetRepository.buildSheet (name/header/rows,
separate from styling and file IO) and export parseModels/parseModelsOption from
the command, so the column layout and the --models validation can be unit-tested.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add tests for translationFieldToProperty (incl. multi-word fields),
ExportTranslationsUseCase (locale resolution/order, model pluralization,
options passthrough), ExportTranslationsSpreadsheetRepository.buildSheet plus a
file round-trip, and the --models parsing/validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@adrianq
adrianq merged commit 6347b9d into development Jun 29, 2026
3 checks passed
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