Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

551 B
Raw Blame
import { join } from 'path'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { AcceptLanguageResolver, I18nAsyncOptions } from 'nestjs-i18n'

export const getI18nConfig = (): I18nAsyncOptions => ({
  imports: [ConfigModule],
  inject: [ConfigService],
  resolvers: [AcceptLanguageResolver],
  useFactory: (configService: ConfigService) => ({
    fallbackLanguage: 'en',
    loaderOptions: {
      path: join(__dirname, '..', 'i18n'),
      watch: configService.get('NODE_ENV') === 'development',
    },
    logging: false,
  }),
})