two-slot-extended-mags/types/services/LocalisationService.d.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-08-05 20:33:00 +10:00
import { ILogger } from "@spt/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocaleService } from "@spt/services/LocaleService";
import { RandomUtil } from "@spt/utils/RandomUtil";
2023-06-11 15:10:34 +10:00
import { I18n } from "i18n";
/**
* Handles translating server text into different langauges
*/
export declare class LocalisationService {
protected logger: ILogger;
2023-10-09 20:21:00 +11:00
protected randomUtil: RandomUtil;
2023-06-11 15:10:34 +10:00
protected databaseServer: DatabaseServer;
protected localeService: LocaleService;
protected i18n: I18n;
2023-10-09 20:21:00 +11:00
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
2023-06-11 15:10:34 +10:00
/**
* Get a localised value using the passed in key
* @param key Key to loop up locale for
* @param args optional arguments
* @returns Localised string
*/
getText(key: string, args?: any): string;
/**
* Get all locale keys
* @returns string array of keys
*/
getKeys(): string[];
2023-10-09 20:21:00 +11:00
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
2023-06-11 15:10:34 +10:00
}