Skip to content

fix(CopyTranslationsService): Copied step shares its title translation with the original - #2368

Open
Isaries wants to merge 1 commit into
WISE-Community:developfrom
Isaries:fix/copied-step-title-translation
Open

Isaries wants to merge 1 commit into
WISE-Community:developfrom
Isaries:fix/copied-step-title-translation

Conversation

@Isaries

@Isaries Isaries commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

In a unit with more than one language, copying a step produces a copy whose title is tied to the original's in every non-default language. copyNodes() in CopyTranslationsService gives new i18n ids only to fields inside the copied step's components. The step's own title.i18n id is carried over unchanged, so the copy and the original point at the same entry in each translations.<locale>.json.

The effect for authors is that editing either step's title in a non-default language changes the other one too. The title in the default language behaves normally, because that text is stored on the node itself rather than looked up by id, so the problem only shows when switching the authoring language. It is easy to miss: an author who renames the copy's translated title silently overwrites the original's, and the original title can only be recovered by retyping it.

Units that already contain such copies keep the shared id after this change; it prevents new ones from being created. An affected step can be separated by removing its title.i18n in the step's advanced JSON view and entering its translated title again, which creates a new id.

Changes

  • copyNodes() collects i18n keys from the whole node with getI18NKeys(node) instead of from each component. getI18NKeys() already walks nested objects and arrays, so this covers the step title and every component field, and any other node-level translatable field.

Test

  • New tryCopyNodes() case in copyTranslationsService.spec.ts: copying a step whose title and component prompt both have i18n ids gives each a new id, saves the new ids with the original translations, keeps the original entries, and saves the project. Against the current develop, it fails with Expected 'titleId' not to equal 'titleId'.

…n with the original

copyNodes() gave new i18n ids only to the fields inside the copied
step's components. The step's own title.i18n id was left as it was, so
the copy and the original pointed at the same entry in every
translation file. Editing either step's title in a non-default
language changed both. The default language was unaffected because
the title text is stored on the node itself.

copyNodes() now collects i18n keys from the whole node, which covers
the title and every component field.
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.

1 participant