Add humanizeTime to the module i18n API

So modules can access it simply with the right context etc
This commit is contained in:
David Baker
2025-11-26 16:47:58 +00:00
parent 17066c03fd
commit 56662c53e9
2 changed files with 7 additions and 0 deletions
@@ -172,6 +172,7 @@ export interface ExtrasApi {
// @public
export interface I18nApi {
humanizeTime(timeMillis: number): string;
get language(): string;
register(translations: Partial<Translations>): void;
translate(key: keyof Translations, variables?: Variables): string;
@@ -49,4 +49,10 @@ export interface I18nApi {
* @param variables - Optional variables to interpolate into the translation
*/
translate(key: keyof Translations, variables?: Variables): string;
/**
* Convert a timestamp into a human-readable time string
* @param timeMillis - The time in milliseconds since epoch
*/
humanizeTime(timeMillis: number): string;
}