web: start implementing translation in JS

This commit is contained in:
Jens Langhammer
2020-12-01 09:46:59 +01:00
parent 0231bcf685
commit a777ecc933
9 changed files with 25 additions and 17 deletions

View File

@ -141,7 +141,8 @@ export class RouterOutlet extends LitElement {
this.current = matchedRoute;
}
render(): TemplateResult {
render(): TemplateResult | undefined {
// TODO: Render 404 when current Route is empty
return this.current?.render();
}
}

View File

@ -1,3 +1,4 @@
import { gettext } from "django";
import { customElement } from "lit-element";
import { Application } from "../../api/application";
import { PBResponse } from "../../api/client";
@ -6,13 +7,13 @@ import { TablePage } from "../../elements/table/TablePage";
@customElement("pb-application-list")
export class ApplicationList extends TablePage<Application> {
pageTitle(): string {
return "Applications";
return gettext("Applications");
}
pageDescription(): string {
return "External Applications which use passbook as Identity-Provider, utilizing protocols like OAuth2 and SAML.";
return gettext("External Applications which use passbook as Identity-Provider, utilizing protocols like OAuth2 and SAML.");
}
pageIcon(): string {
return "pf-icon pf-icon-applications";
return gettext("pf-icon pf-icon-applications");
}
apiEndpoint(page: number): Promise<PBResponse<Application>> {