From fd30fdc620026cae3e7667b98eb4e3d64cd8550c Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:48:28 +0100 Subject: [PATCH] fix(bot-services): add global: true to I18nModule dynamic module config The @Global() decorator on a module class doesn't apply when using dynamic modules (forRoot/forRootAsync). The global: true property must be set directly in the DynamicModule return object. Co-Authored-By: Claude Opus 4.5 --- packages/bot-services/src/i18n/i18n.module.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/bot-services/src/i18n/i18n.module.ts b/packages/bot-services/src/i18n/i18n.module.ts index 7ba2ed5cb..45e920ac2 100644 --- a/packages/bot-services/src/i18n/i18n.module.ts +++ b/packages/bot-services/src/i18n/i18n.module.ts @@ -1,4 +1,4 @@ -import { Module, DynamicModule, Global } from '@nestjs/common'; +import { Module, DynamicModule } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { I18nService, I18N_OPTIONS } from './i18n.service'; import { I18nOptions } from './types'; @@ -28,7 +28,6 @@ import { I18nOptions } from './types'; * }) * ``` */ -@Global() @Module({}) export class I18nModule { /** @@ -37,6 +36,7 @@ export class I18nModule { static forRoot(options?: I18nOptions): DynamicModule { return { module: I18nModule, + global: true, imports: [ConfigModule], providers: [ { @@ -59,6 +59,7 @@ export class I18nModule { }): DynamicModule { return { module: I18nModule, + global: true, imports: [...(options.imports || []), ConfigModule], providers: [ {