Repository navigation
fix: resolve languages by LanguageCode instead of positional ids - #1436
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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>
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.
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):
name reads and the Danish folder-name lookups;
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);
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;
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
Known, out of scope (follow-ups)
WordServicechecksLanguages.Name == "Danish"but the seeded name is "Dansk".UpdatePlanningType2 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