Repository navigation
fix(reporting): support multi-lingual config texts - #271
Conversation
Multi-lingual systems store configured texts as objects of translations
(e.g. {"en-US": "Action", "de": "Aktion"}) instead of plain strings, which
broke parsing of Config:CONFIG_ENTITY for the SQS schema and therefore
every report calculation.
- SQS schema: stop mapping the unused entity label
- ConfigurableEnumOption view: resolve multi-lingual option labels to the
system's default language (SiteSettings), falling back to English and then
any translation; adds the SiteSettings table to the SQS schema for that
- ReportConfig and TemplateExport titles/descriptions: resolve
translations to a single text instead of failing to parse
- legacy ReportConfig write-back keeps all translations of the title
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fb2hmme76AYU2rtfsk45zV
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Abhinegi2
left a comment
There was a problem hiding this comment.
tested it, and everything seems to be working well, code also looks good.
@sleidig only one small notes, not blocking -
- titles resolve english-first, while enum labels use defaultLanguage. In a German-default system the two can differ (fine if intended )
|
Thanks for testing! Re: titles resolving English-first while enum labels use
Making titles follow the default language as well would need the backend to read If a title has no English translation, it falls back to the first non-empty translation (covered in Generated by Claude Code |
Since multi-lingual systems were added (Aam-Digital/ndb-core#4283), configured texts can be stored as objects of translations (e.g.
{"en-US": "Action", "de": "Aktion"}) instead of plain strings. The backend still read some of them asString, which broke every report calculation:Changes
AppConfigEntryno longer mapslabel. It was never used, because table names come from theentity:key.ConfigurableEnumOptionview: a multi-lingual option label now resolves to one text. It uses the system's default language (SiteSettings:global.defaultLanguage), then English, then any non-empty translation. Plain string labels are unchanged.SiteSettingstable (_id,defaultLanguage) is hard-wired into the SQS schema. Its fields are merged into a manually configuredentity:SiteSettingsinstead of replacing it.ReportConfig.titleandTemplateExport.title/description: ndb-core now stores these as translatable texts too. They would hit the same parsing error once someone translates a title, so they now resolve to a single text (English first, otherwise any translation) through a sharedTranslatableTextDeserializer.titlevalue, so a migrated document keeps all of its translations.Notes
configVersion) changes, so SQS re-ingests once after deployment. The first report calculation afterwards will be slower.SiteSettings.defaultLanguageas plain text (e.g.de). If it doesn't, the view falls back to English labels.src/app/features/reporting/README.md) could mention how labels are resolved in multi-lingual systems.Manual Testing Steps
ConfigurableEnumOptionon a dropdown with translated options.labelshould show the option text in the system's default language.Tests
TranslatableTextresolving, a multi-lingual report title, and the legacy write-back keeping translations.Generated by Claude Code