Make LocalisationService get keys directly from database server

This commit is contained in:
Dev 2023-04-23 11:26:11 +01:00
parent c20a9d6e36
commit 31eb470a08

View File

@ -3,6 +3,7 @@ import { inject, injectable } from "tsyringe";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
@ -16,6 +17,7 @@ export class LocalisationService
constructor( constructor(
@inject("WinstonLogger") protected logger: ILogger, @inject("WinstonLogger") protected logger: ILogger,
@inject("DatabaseServer") protected databaseServer: DatabaseServer,
@inject("LocaleService") protected localeService: LocaleService @inject("LocaleService") protected localeService: LocaleService
) )
{ {
@ -49,6 +51,6 @@ export class LocalisationService
*/ */
public getKeys(): string[] public getKeys(): string[]
{ {
return Object.keys(this.i18n.getCatalog("en")); return Object.keys(this.databaseServer.getTables().locales.server["en"]);
} }
} }