Files
zulip/static/js/page_params.ts
Priyank Patel 9418ae51fa ts: Convert i18n module to TypeScript.
We update our tsconfig target to ES2020 so that we don't get type
errors related to some properties not being in Intl that is used by
@formatjs/intl.
2021-06-22 09:09:36 -07:00

19 lines
489 B
TypeScript

import $ from "jquery";
const t1 = performance.now();
export const page_params: {
language_list: {
code: string;
locale: string;
name: string;
percent_translated: number | undefined;
}[];
request_language: string;
translation_data: Record<string, string>;
} = $("#page-params").remove().data("params");
const t2 = performance.now();
window.page_params_parse_time = t2 - t1;
if (!page_params) {
throw new Error("Missing page-params");
}