web: activate pseudo-locale using querystring

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-03 20:34:16 +02:00
parent e246071aac
commit b37470b3de
4 changed files with 16 additions and 11 deletions

View File

@ -30,7 +30,7 @@ export const SIDEBAR_ITEMS: SidebarItem[] = [
).when((): Promise<boolean> => {
return me().then(u => u.user.isSuperuser||false);
}),
new SidebarItem(`Events`).children(
new SidebarItem(t`Events`).children(
new SidebarItem(t`Logs`, "/events/log").activeWhen(
`^/events/log/(?<id>${UUID_REGEX})$`
),

View File

@ -1,17 +1,14 @@
import { i18n } from "@lingui/core";
import { en } from "make-plural/plurals";
import { messages as localeEN } from "../locales/en";
import { messages as localeDEBUG } from "../locales/pseudo-LOCALE";
i18n.loadLocaleData("en", {
plurals: en
});
i18n.loadLocaleData("en", { plurals: en });
i18n.loadLocaleData("debug", { plurals: en });
i18n.load("en", localeEN);
i18n.load("debug", localeDEBUG);
i18n.activate("en");
// Uncomment to debug localisation
// import { messages as localeDEBUG } from "../locales/pseudo-LOCALE";
// i18n.load("debug", localeDEBUG);
// i18n.activate("debug");
// i18n.loadLocaleData("debug", {
// plurals: en
// });
if (window.location.search.includes("debugLocale")) {
i18n.activate("debug");
}

View File

@ -1071,6 +1071,10 @@ msgstr "Evaluate policies when the Stage is present to the user."
msgid "Event {0}"
msgstr "Event {0}"
#: src/interfaces/AdminInterface.ts:23
msgid "Events"
msgstr "Events"
#: src/pages/events/EventInfo.ts:129
#: src/pages/events/EventInfo.ts:152
msgid "Exception"

View File

@ -1067,6 +1067,10 @@ msgstr ""
msgid "Event {0}"
msgstr ""
#: src/interfaces/AdminInterface.ts:23
msgid "Events"
msgstr ""
#: src/pages/events/EventInfo.ts:129
#: src/pages/events/EventInfo.ts:152
msgid "Exception"