mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Merge pull request #137 from element-hq/dbkr/human_eyes
Add humanizeTime to the module i18n API
This commit is contained in:
commit
0d69056e7b
@ -173,6 +173,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,11 @@ export interface I18nApi {
|
||||
* @param variables - Optional variables to interpolate into the translation
|
||||
*/
|
||||
translate(key: keyof Translations, variables?: Variables): string;
|
||||
|
||||
/**
|
||||
* Convert a timestamp into a translated, human-readable time,
|
||||
* using the current system time as a reference, eg. "5 minutes ago".
|
||||
* @param timeMillis - The time in milliseconds since epoch
|
||||
*/
|
||||
humanizeTime(timeMillis: number): string;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user