mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Fix: System messages would break replies.
Fix: Show correct time format on left side of messages.
This commit is contained in:
@@ -12,11 +12,21 @@ interface Props {
|
||||
fields: Fields;
|
||||
}
|
||||
|
||||
export interface Dictionary {
|
||||
dayjs: {
|
||||
defaults: {
|
||||
twelvehour: 'yes' | 'no';
|
||||
separator: string;
|
||||
date: "traditional" | "simplified" | "ISO8601";
|
||||
},
|
||||
timeFormat: string
|
||||
};
|
||||
[key: string]: Object | string;
|
||||
}
|
||||
|
||||
export interface IntlType {
|
||||
intl: {
|
||||
dictionary: {
|
||||
[key: string]: Object | string;
|
||||
};
|
||||
dictionary: Dictionary;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -60,3 +70,8 @@ export function useTranslation() {
|
||||
return (id: string, fields?: Object, plural?: number, fallback?: string) =>
|
||||
translate(id, "", intl.dictionary, fields, plural, fallback);
|
||||
}
|
||||
|
||||
export function useDictionary() {
|
||||
const { intl } = useContext(IntlContext) as unknown as IntlType;
|
||||
return intl.dictionary;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user