From 31eb470a08a84accf39c0876c6291a0800f2acd6 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 23 Apr 2023 11:26:11 +0100 Subject: [PATCH] Make LocalisationService get keys directly from database server --- project/src/services/LocalisationService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/src/services/LocalisationService.ts b/project/src/services/LocalisationService.ts index 6d41480d..2e52e430 100644 --- a/project/src/services/LocalisationService.ts +++ b/project/src/services/LocalisationService.ts @@ -3,6 +3,7 @@ import { inject, injectable } from "tsyringe"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILogger } from "../models/spt/utils/ILogger"; +import { DatabaseServer } from "../servers/DatabaseServer"; import { LocaleService } from "./LocaleService"; /** @@ -16,6 +17,7 @@ export class LocalisationService constructor( @inject("WinstonLogger") protected logger: ILogger, + @inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("LocaleService") protected localeService: LocaleService ) { @@ -49,6 +51,6 @@ export class LocalisationService */ public getKeys(): string[] { - return Object.keys(this.i18n.getCatalog("en")); + return Object.keys(this.databaseServer.getTables().locales.server["en"]); } } \ No newline at end of file