Skip to content

fix: resolve languages by LanguageCode instead of positional ids - #1436

Merged
renemadsen merged 2 commits into
stablefrom
fix/8141-shifted-lookup-ids
Oct 15, 2026
Merged

renemadsen merged 2 commits into
stablefrom
fix/8141-shifted-lookup-ids

Conversation

@renemadsen

Copy link
Copy Markdown
Member

SDK language ids are only contiguous by accident of AUTO_INCREMENT; on a
fresh install with auto_increment_increment=3 (Galera) Dansk/English/
Deutsch are 3/6/9 and ids 1 and 2 may not exist. Several paths assumed
1=da, 2=en-US, 3=de-DE and either threw, saved null names or silently
picked the wrong language (3 is German on old installs, Danish on new):

  • area-rule planning helper: UpdatePlanning Type2, CreatePlanningType2/6
    name reads and the Danish folder-name lookups;
  • area-rules helper: Type7 parent folder found via English id 2;
  • seed-positional translations (26. Dokumenter folder, Morgenrundtur,
    Type7/8 seed rules, WordService reports, calendar Logbøger reseed) are
    now remapped to real ids by code before use (AreaRuleLanguageHelper.
    RemapSeedLanguageIdsAsync; identity on contiguous installs);
  • property create modal resolved languagesIds as [1,2,3]; it now maps
    da/en-US/de-DE to SDK ids, keeps Create disabled until they load and
    shows an error instead of falling back to positional ids;
  • calendar task modal no longer defaults the current language to id 1.

Adds integration tests that rewrite the SDK Languages into the Galera
layout and Jest specs for both modals.

Refs microting/eform-angular-frontend#8141

Test plan

  • Jest 1902/1902
  • Integration ShiftedLanguageIdTests + CalendarTranslationLanguageIdRemapTests 14/14
  • Full integration suite — left to CI (too heavy to finish locally)

Known, out of scope (follow-ups)

  • The Documents module still writes positional language ids (needs a decision on the intended mapping).
  • WordService checks Languages.Name == "Danish" but the seeded name is "Dansk".
  • UpdatePlanning Type2 reuses the English name for German.

No seeder change and no data migration in this PR: existing installs keep their ids, the code just stops assuming them.

🤖 Generated with Claude Code

SDK language ids are only contiguous by accident of AUTO_INCREMENT; on a
fresh install with auto_increment_increment=3 (Galera) Dansk/English/
Deutsch are 3/6/9 and ids 1 and 2 may not exist. Several paths assumed
1=da, 2=en-US, 3=de-DE and either threw, saved null names or silently
picked the wrong language (3 is German on old installs, Danish on new):

- area-rule planning helper: UpdatePlanning Type2, CreatePlanningType2/6
  name reads and the Danish folder-name lookups;
- area-rules helper: Type7 parent folder found via English id 2;
- seed-positional translations (26. Dokumenter folder, Morgenrundtur,
  Type7/8 seed rules, WordService reports, calendar Logbøger reseed) are
  now remapped to real ids by code before use (AreaRuleLanguageHelper.
  RemapSeedLanguageIdsAsync; identity on contiguous installs);
- property create modal resolved languagesIds as [1,2,3]; it now maps
  da/en-US/de-DE to SDK ids, keeps Create disabled until they load and
  shows an error instead of falling back to positional ids;
- calendar task modal no longer defaults the current language to id 1.

Adds integration tests that rewrite the SDK Languages into the Galera
layout and Jest specs for both modals.

Refs microting/eform-angular-frontend#8141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The scoped mappings address shifted IDs without an identified blocking defect; full integration validation remains with CI.

0 open findings

What changed in this PR

Resolves SDK languages by code rather than fixed IDs, supporting Galera installations without changing existing IDs or migrating data.

Changes:

  • Remaps seed translations and language lookups across backend planning, folders, reports, and calendar recovery.
  • Updates property creation and calendar previews to use resolved SDK language IDs.
  • Adds shifted-ID regression tests and localized language-loading errors.
File Description
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Services/​WordService/​WordService.cs Remaps report seed translations.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Services/​BackendConfigurationDocumentService/​BackendConfigurationDocumentService.cs Remaps document folder translations.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Services/​BackendConfigurationCalendarService/​BackendConfigurationCalendarService.cs Remaps calendar recovery seeds.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Services/​BackendConfigurationAreaRulesService/​BackendConfigurationAreaRulesService.cs Remaps morning-tour and rule translations.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Infrastructure/​Helpers/​DocumentHelper.cs Remaps deployment folder translations.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Infrastructure/​Helpers/​BackendConfigurationAreaRulesServiceHelper.cs Resolves English folder language by code.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Infrastructure/​Helpers/​BackendConfigurationAreaRulePlanningsServiceHelper.cs Uses resolved IDs for planning and folder names.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn/​Infrastructure/​Helpers/​AreaRuleLanguageHelper.cs Extends shared seed translation remapping.
eFormAPI/​Plugins/​BackendConfiguration.Pn/​BackendConfiguration.Pn.Integration.Test/​ShiftedLanguageIdTests.cs Tests backend behavior with shifted IDs.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​modules/​calendar/​modals/​task-create-edit-modal/​task-create-edit-modal.shifted-lookup-ids.spec.ts Tests preview language fallback.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​modules/​calendar/​modals/​task-create-edit-modal/​task-create-edit-modal.component.ts Removes the fixed preview language default.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​i18n/​enUS.ts Adds English loading-error text.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​i18n/​deDE.ts Adds German loading-error text.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​i18n/​da.ts Adds Danish loading-error text.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​components/​properties/​property-actions/​property-create-modal/​property-create-modal.component.ts Resolves property language IDs before creation.
eform-client/​src/​app/​plugins/​modules/​backend-configuration-pn/​components/​properties/​property-actions/​property-create-modal/​property-create-modal.component.spec.ts Tests ID resolution and loading failures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Resolves the i18n conflict with the chemicals settings keys: both sides
kept, 'Could not load languages' placed after the Chemicals block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The scoped language-resolution changes have targeted regression coverage and no identified blocking issues.

0 open findings

🧠 Review effort: Balanced

@renemadsen
renemadsen merged commit d926796 into stable Oct 15, 2026
63 of 64 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