Conversation
Columns of the default (DB) locale now also yield the value of the object
field itself, on top of the translation, so both stay in sync and the sheet
round-trips through 'to-spreadsheet' (which reads locale columns from the
translations).
Locales are matched by language part, so "en" also matches a column mapped
to "en_GB", and the field name comes from the column prefix ("Left side
description" -> leftSideDescription).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Apply the default-locale values on the posted objects and warn about columns that would not do what the operator expects: - Fields the instance does not declare as translatable in /api/schemas: DHIS2 ignores unknown properties, so such a column posts fine but changes nothing. - Default-locale columns writing a unique field (name, shortName), where a duplicated value makes the whole payload fail to validate. Both are warnings (one per model/field, not per row), reviewed in the dry run that is still the default without --post. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Capability spec for the whole 'translations from-spreadsheet' command, not just the default-locale addition: spreadsheet format, object matching, translation merging, schema validation warnings and the dry-run default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Capture apps cache the metadata of each data set/program and refresh it only when its version changes, so the version has to be readable and writable to invalidate that cache. ProgramsRepository had no save. The new one merges the changed fields over the stored :owner object instead of posting the entity as it is: the entity is a partial view of the D2 model and the metadata import uses mergeMode=REPLACE, which would drop every field missing from the payload (in particular turning the nested programStages into partial objects). Same approach as MetadataD2Repository.mergeWithExistingObjects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Increment the version of the data sets and programs using a data element whose translations changed, so the Capture apps refresh their cached metadata instead of keeping showing the old values. Opt-in, as it writes objects the operator never listed in the spreadsheet. The scope is data elements only: translating an option set or a tracked entity attribute does not bump anything, even though those are cached too. Bumps are posted apart from the translations payload, so --save-payload does not show them, and a dry run only logs them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…dsheet' A column named as a translatable field with no locale (name, shortName, formName...) now writes the object field itself, matching the layout that 'to-spreadsheet' generates. The name column is written only when the row also has an id/code, otherwise it stays a lookup key. Columns that are not a translatable field of the model are ignored with a warning, and the run logs a per-model summary of the fields updated. Co-Authored-By: Claude Opus 5 <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.
Required by https://app.clickup.com/t/4528615/869f24nhh
Three additions to
translations from-spreadsheet: the first is the default behaviour, the other two opt-in."global" fields (like name/shortName/description/...) are now also posted
Until now, only columns
field: languagewere posted. Barefieldcolumns (the layoutto-spreadsheetgenerates) now write the field itself, as users take the translation as an opportunity to improve/fix the default values themselves.--default-locale(not default)Columns of the default (DB) locale now also update the object field itself (
formName: EnglishwritesformName), on top of writing the translation. Keeping both means the field and its translation stay in sync and the sheet round-trips throughto-spreadsheet, which fills the locale columns from the translations.--bump-versions(not default)The Capture apps cache the metadata of each data set/program and refresh it only when its
versionchanges, so imported translations keep showing as the old values. This increments the version of the data sets and programs using a data element whose translations changed.