2021-03-25 22:35:45 +01:00
|
|
|
import $ from "jquery";
|
2020-04-04 01:47:18 +02:00
|
|
|
|
2020-01-15 16:41:56 +01:00
|
|
|
const t1 = performance.now();
|
2021-05-27 20:08:50 +02:00
|
|
|
export const page_params: {
|
|
|
|
language_list: {
|
|
|
|
code: string;
|
|
|
|
locale: string;
|
|
|
|
name: string;
|
|
|
|
percent_translated: number | undefined;
|
|
|
|
}[];
|
2021-06-06 22:13:18 +02:00
|
|
|
development_environment: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
request_language: string;
|
2021-06-06 22:13:18 +02:00
|
|
|
save_stacktraces: boolean;
|
2021-05-27 20:08:50 +02:00
|
|
|
translation_data: Record<string, string>;
|
|
|
|
} = $("#page-params").remove().data("params");
|
2020-01-15 16:41:56 +01:00
|
|
|
const t2 = performance.now();
|
|
|
|
window.page_params_parse_time = t2 - t1;
|
2021-03-25 22:35:45 +01:00
|
|
|
if (!page_params) {
|
2019-09-20 06:58:12 +02:00
|
|
|
throw new Error("Missing page-params");
|
|
|
|
}
|