Initial release for SPT 3.9

This commit is contained in:
2024-07-20 18:08:38 +02:00
parent 7df25ba694
commit c83da69a3e
713 changed files with 34110 additions and 1 deletions

34
types/services/LocalisationService.d.ts vendored Normal file
View File

@@ -0,0 +1,34 @@
import { I18n } from "i18n";
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";
/**
* Handles translating server text into different langauges
*/
export declare class LocalisationService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
protected localeService: LocaleService;
protected i18n: I18n;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/**
* 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[];
/**
* 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;
}