web: translate sidebar and more list pages
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -5,58 +5,59 @@ import { SidebarItem } from "../elements/sidebar/Sidebar";
|
||||
import { ID_REGEX, SLUG_REGEX, UUID_REGEX } from "../elements/router/Route";
|
||||
import { Interface } from "./Interface";
|
||||
import "./locale";
|
||||
import { t } from "@lingui/macro";
|
||||
|
||||
export const SIDEBAR_ITEMS: SidebarItem[] = [
|
||||
new SidebarItem("Library", "/library"),
|
||||
new SidebarItem("Monitor").children(
|
||||
new SidebarItem("Overview", "/administration/overview"),
|
||||
new SidebarItem("System Tasks", "/administration/system-tasks"),
|
||||
new SidebarItem(t`Library`, "/library"),
|
||||
new SidebarItem(t`Monitor`).children(
|
||||
new SidebarItem(t`Overview`, "/administration/overview"),
|
||||
new SidebarItem(t`System Tasks`, "/administration/system-tasks"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser||false);
|
||||
}),
|
||||
new SidebarItem("Resources").children(
|
||||
new SidebarItem("Applications", "/core/applications").activeWhen(
|
||||
new SidebarItem(t`Resources`).children(
|
||||
new SidebarItem(t`Applications`, "/core/applications").activeWhen(
|
||||
`^/core/applications/(?<slug>${SLUG_REGEX})$`
|
||||
),
|
||||
new SidebarItem("Sources", "/core/sources").activeWhen(
|
||||
new SidebarItem(t`Sources`, "/core/sources").activeWhen(
|
||||
`^/core/sources/(?<slug>${SLUG_REGEX})$`,
|
||||
),
|
||||
new SidebarItem("Providers", "/core/providers").activeWhen(
|
||||
new SidebarItem(t`Providers`, "/core/providers").activeWhen(
|
||||
`^/core/providers/(?<id>${ID_REGEX})$`,
|
||||
),
|
||||
new SidebarItem("Outposts", "/outpost/outposts"),
|
||||
new SidebarItem("Outpost Service Connections", "/outpost/service-connections"),
|
||||
new SidebarItem(t`Outposts`, "/outpost/outposts"),
|
||||
new SidebarItem(t`Outpost Service Connections`, "/outpost/service-connections"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser||false);
|
||||
}),
|
||||
new SidebarItem("Events").children(
|
||||
new SidebarItem("Logs", "/events/log").activeWhen(
|
||||
new SidebarItem(`Events`).children(
|
||||
new SidebarItem(t`Logs`, "/events/log").activeWhen(
|
||||
`^/events/log/(?<id>${UUID_REGEX})$`
|
||||
),
|
||||
new SidebarItem("Notification Rules", "/events/rules"),
|
||||
new SidebarItem("Notification Transports", "/events/transports"),
|
||||
new SidebarItem(t`Notification Rules`, "/events/rules"),
|
||||
new SidebarItem(t`Notification Transports`, "/events/transports"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser || false);
|
||||
}),
|
||||
new SidebarItem("Customisation").children(
|
||||
new SidebarItem("Policies", "/policy/policies"),
|
||||
new SidebarItem("Property Mappings", "/core/property-mappings"),
|
||||
new SidebarItem(t`Customisation`).children(
|
||||
new SidebarItem(t`Policies`, "/policy/policies"),
|
||||
new SidebarItem(t`Property Mappings`, "/core/property-mappings"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser||false);
|
||||
}),
|
||||
new SidebarItem("Flows").children(
|
||||
new SidebarItem("Flows", "/flow/flows").activeWhen(`^/flow/flows/(?<slug>${SLUG_REGEX})$`),
|
||||
new SidebarItem("Stages", "/flow/stages"),
|
||||
new SidebarItem("Prompts", "/flow/stages/prompts"),
|
||||
new SidebarItem("Invitations", "/flow/stages/invitations"),
|
||||
new SidebarItem(t`Flows`).children(
|
||||
new SidebarItem(t`Flows`, "/flow/flows").activeWhen(`^/flow/flows/(?<slug>${SLUG_REGEX})$`),
|
||||
new SidebarItem(t`Stages`, "/flow/stages"),
|
||||
new SidebarItem(t`Prompts`, "/flow/stages/prompts"),
|
||||
new SidebarItem(t`Invitations`, "/flow/stages/invitations"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser||false);
|
||||
}),
|
||||
new SidebarItem("Identity & Cryptography").children(
|
||||
new SidebarItem("Users", "/identity/users").activeWhen(`^/identity/users/(?<id>${ID_REGEX})$`),
|
||||
new SidebarItem("Groups", "/identity/groups"),
|
||||
new SidebarItem("Certificates", "/crypto/certificates"),
|
||||
new SidebarItem("Tokens", "/core/tokens"),
|
||||
new SidebarItem(t`Identity & Cryptography`).children(
|
||||
new SidebarItem(t`Users`, "/identity/users").activeWhen(`^/identity/users/(?<id>${ID_REGEX})$`),
|
||||
new SidebarItem(t`Groups`, "/identity/groups"),
|
||||
new SidebarItem(t`Certificates`, "/crypto/certificates"),
|
||||
new SidebarItem(t`Tokens`, "/core/tokens"),
|
||||
).when((): Promise<boolean> => {
|
||||
return me().then(u => u.user.isSuperuser||false);
|
||||
}),
|
||||
|
@ -7,7 +7,11 @@ i18n.loadLocaleData("en", {
|
||||
});
|
||||
i18n.load("en", localeEN);
|
||||
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
|
||||
// });
|
||||
|
Reference in New Issue
Block a user