@@ -257,6 +257,15 @@ function buildCubesFromConfig(appConfig: any): Cube[] {
257257 return cubes ;
258258}
259259
260+ /** Per-language translation map: language code → translation tree. */
261+ type TranslationMap = Record < string , Record < string , unknown > > ;
262+
263+ /** A named translation bundle as declared in a stack's i18n config. */
264+ interface I18nBundle {
265+ namespace : string ;
266+ translations : TranslationMap ;
267+ }
268+
260269/**
261270 * Resolve translations for a given language from the i18n bundles
262271 * declared in the application configuration.
@@ -267,12 +276,12 @@ function buildCubesFromConfig(appConfig: any): Cube[] {
267276 * `crm.objects.account.label`.
268277 */
269278function resolveI18nTranslations (
270- bundles : Array < { namespace : string ; translations : Record < string , unknown > } > ,
279+ bundles : I18nBundle [ ] ,
271280 lang : string ,
272281) : Record < string , unknown > {
273282 const merged : Record < string , unknown > = { } ;
274283 for ( const bundle of bundles ) {
275- const langTranslations = ( bundle . translations as Record < string , any > ) ?. [ lang ] ;
284+ const langTranslations = bundle . translations [ lang ] ;
276285 if ( langTranslations ) {
277286 merged [ bundle . namespace ] = langTranslations ;
278287 }
@@ -320,8 +329,7 @@ export async function createKernel(options: KernelOptions): Promise<KernelResult
320329 // `i18n: { namespace, translations }` field and merged via sharedConfig).
321330 // This ensures both MSW/mock and server modes share the same translation
322331 // resolution pipeline — no manual per-environment i18n handlers required.
323- const i18nBundles : Array < { namespace : string ; translations : Record < string , unknown > } > =
324- appConfig . i18n ?. bundles ?? [ ] ;
332+ const i18nBundles : I18nBundle [ ] = appConfig . i18n ?. bundles ?? [ ] ;
325333
326334 if ( i18nBundles . length > 0 ) {
327335 kernel . registerService ( 'i18n' , {
0 commit comments