Browse Source

Task/implement OnModuleInit in I18nService (#6448)

* Implement onModuleInit
pull/6548/head
Thomas Kaul 1 week ago
committed by GitHub
parent
commit
269b981e86
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      apps/api/src/services/i18n/i18n.service.ts

6
apps/api/src/services/i18n/i18n.service.ts

@ -1,16 +1,16 @@
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
import { Injectable, Logger } from '@nestjs/common';
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
import * as cheerio from 'cheerio';
import { readFileSync, readdirSync } from 'node:fs';
import { join } from 'node:path';
@Injectable()
export class I18nService {
export class I18nService implements OnModuleInit {
private localesPath = join(__dirname, 'assets', 'locales');
private translations: { [locale: string]: cheerio.CheerioAPI } = {};
public constructor() {
public onModuleInit() {
this.loadFiles();
}

Loading…
Cancel
Save