web: initial migration to lingui

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-03 19:26:43 +02:00
parent fc1caf1469
commit 25300c1928
150 changed files with 8720 additions and 1482 deletions

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { LitElement, html, customElement, property, TemplateResult, CSSResult, css } from "lit-element";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -152,11 +152,11 @@ export class FlowExecutor extends LitElement implements StageHost {
type: ChallengeTypeEnum.Shell,
body: `<header class="pf-c-login__main-header">
<h1 class="pf-c-title pf-m-3xl">
${gettext("Whoops!")}
${t`Whoops!`}
</h1>
</header>
<div class="pf-c-login__main-body">
<h3>${gettext("Something went wrong! Please try again later.")}</h3>
<h3>${t`Something went wrong! Please try again later.`}</h3>
<pre class="ak-exception">${error}</pre>
</div>`
};
@ -178,7 +178,7 @@ export class FlowExecutor extends LitElement implements StageHost {
window.location.assign((this.challenge as RedirectChallenge).to);
return html`<ak-empty-state
?loading=${true}
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
case ChallengeTypeEnum.Shell:
return html`${unsafeHTML((this.challenge as ShellChallenge).body)}`;
@ -225,7 +225,7 @@ export class FlowExecutor extends LitElement implements StageHost {
if (!this.challenge) {
return html`<ak-empty-state
?loading=${true}
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`
@ -267,7 +267,7 @@ export class FlowExecutor extends LitElement implements StageHost {
</li>`;
}))}
${this.config?.brandingTitle != "authentik" ? html`
<li><a href="https://goauthentik.io">${gettext("Powered by authentik")}</a></li>
<li><a href="https://goauthentik.io">${t`Powered by authentik`}</a></li>
` : html``}
</ul>
</footer>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css";
import { ifDefined } from "lit-html/directives/if-defined";
@ -40,7 +40,7 @@ export class FormStatic extends LitElement {
return html`
<div class="form-control-static">
<div class="avatar">
<img class="pf-c-avatar" src="${ifDefined(this.userAvatar)}" alt="${gettext("User's avatar")}">
<img class="pf-c-avatar" src="${ifDefined(this.userAvatar)}" alt="${t`User's avatar`}">
${this.user}
</div>
<slot name="link"></slot>

View File

@ -8,7 +8,7 @@ import PFForm from "@patternfly/patternfly/components/Form/form.css";
import PFList from "@patternfly/patternfly/components/List/list.css";
import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css";
import AKGlobal from "../../authentik.css";
import { gettext } from "django";
import { t } from "@lingui/macro";
import "../../elements/EmptyState";
@ -30,7 +30,7 @@ export class FlowAccessDenied extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -43,7 +43,7 @@ export class FlowAccessDenied extends BaseStage {
<div class="pf-c-form__group">
<p>
<i class="pf-icon pf-icon-error-circle-o"></i>
${gettext("Request has been denied.")}
${t`Request has been denied.`}
</p>
${this.challenge?.error_message &&
html`<hr>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { css, CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -47,7 +47,7 @@ export class AuthenticatorStaticStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -62,11 +62,11 @@ export class AuthenticatorStaticStage extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<ak-form-element
label="${gettext("Tokens")}"
label="${t`Tokens`}"
?required="${true}"
class="pf-c-form__group">
<ul class="ak-otp-tokens">
@ -78,7 +78,7 @@ export class AuthenticatorStaticStage extends BaseStage {
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -35,7 +35,7 @@ export class AuthenticatorTOTPStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -50,7 +50,7 @@ export class AuthenticatorTOTPStage extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<input type="hidden" name="otp_uri" value=${this.challenge.config_url} />
@ -63,16 +63,16 @@ export class AuthenticatorTOTPStage extends BaseStage {
navigator.clipboard.writeText(this.challenge?.config_url).then(() => {
showMessage({
level: MessageLevel.success,
message: gettext("Successfully copied TOTP Config.")
message: t`Successfully copied TOTP Config.`
});
});
}}>
<span class="pf-c-button__progress"><i class="fas fa-copy"></i></span>
${gettext("Copy")}
${t`Copy`}
</button>
</ak-form-element>
<ak-form-element
label="${gettext("Code")}"
label="${t`Code`}"
?required="${true}"
class="pf-c-form__group"
.errors=${(this.challenge?.response_errors || {})["code"]}>
@ -81,7 +81,7 @@ export class AuthenticatorTOTPStage extends BaseStage {
name="code"
inputmode="numeric"
pattern="[0-9]*"
placeholder="${gettext("Please enter your TOTP Code")}"
placeholder="${t`Please enter your TOTP Code`}"
autofocus=""
autocomplete="one-time-code"
class="pf-c-form-control"
@ -90,7 +90,7 @@ export class AuthenticatorTOTPStage extends BaseStage {
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { css, CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -80,8 +80,8 @@ export class AuthenticatorValidateStage extends BaseStage implements StageHost {
case DeviceClasses.WEBAUTHN:
return html`<i class="fas fa-mobile-alt"></i>
<div class="right">
<p>${gettext("Authenticator")}</p>
<small>${gettext("Use a security key to prove your identity.")}</small>
<p>${t`Authenticator`}</p>
<small>${t`Use a security key to prove your identity.`}</small>
</div>`;
case DeviceClasses.TOTP:
// TOTP is a bit special, assuming that TOTP is allowed from the backend,
@ -97,14 +97,14 @@ export class AuthenticatorValidateStage extends BaseStage implements StageHost {
}
return html`<i class="fas fa-clock"></i>
<div class="right">
<p>${gettext("Traditional authenticator")}</p>
<small>${gettext("Use a code-based authenticator.")}</small>
<p>${t`Traditional authenticator`}</p>
<small>${t`Use a code-based authenticator.`}</small>
</div>`;
case DeviceClasses.STATIC:
return html`<i class="fas fa-key"></i>
<div class="right">
<p>${gettext("Recovery keys")}</p>
<small>${gettext("In case you can't access any other method.")}</small>
<p>${t`Recovery keys`}</p>
<small>${t`In case you can't access any other method.`}</small>
</div>`;
default:
break;
@ -154,7 +154,7 @@ export class AuthenticatorValidateStage extends BaseStage implements StageHost {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
// User only has a single device class, so we don't show a picker
@ -166,7 +166,7 @@ export class AuthenticatorValidateStage extends BaseStage implements StageHost {
${this.challenge.title}
</h1>
${this.selectedDeviceChallenge ? "" : html`<p class="pf-c-login__main-header-desc">
${gettext("Select an identification method.")}
${t`Select an identification method.`}
</p>`}
</header>
${this.selectedDeviceChallenge ?

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
import PFForm from "@patternfly/patternfly/components/Form/form.css";
@ -35,7 +35,7 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<div class="pf-c-login__main-body">
@ -45,11 +45,11 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<ak-form-element
label="${gettext("Code")}"
label="${t`Code`}"
?required="${true}"
class="pf-c-form__group"
.errors=${(this.challenge?.response_errors || {})["code"]}>
@ -58,7 +58,7 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
name="code"
inputmode="numeric"
pattern="[0-9]*"
placeholder="${gettext("Please enter your TOTP Code")}"
placeholder="${t`Please enter your TOTP Code`}"
autofocus=""
autocomplete="one-time-code"
class="pf-c-form-control"
@ -68,7 +68,7 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>
@ -81,7 +81,7 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
if (!this.host) return;
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
}}>
${gettext("Return to device picker")}
${t`Return to device picker`}
</button>
</li>`:
html``}

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
import PFForm from "@patternfly/patternfly/components/Form/form.css";
@ -48,10 +48,10 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
publicKey: transformedCredentialRequestOptions,
});
if (!assertion) {
throw new Error(gettext("Assertions is empty"));
throw new Error(t`Assertions is empty`);
}
} catch (err) {
throw new Error(gettext(`Error when creating credential: ${err}`));
throw new Error(t`Error when creating credential: ${err}`);
}
// we now have an authentication assertion! encode the byte arrays contained
@ -64,7 +64,7 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
formData.set("webauthn", JSON.stringify(transformedAssertionForServer));
await this.host?.submit(formData);
} catch (err) {
throw new Error(gettext(`Error when validating assertion on server: ${err}`));
throw new Error(t`Error when validating assertion on server: ${err}`);
}
}
@ -78,7 +78,7 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
}
this.authenticateRunning = true;
this.authenticate().catch((e) => {
console.error(gettext(e));
console.error(e);
this.authenticateMessage = e.toString();
}).finally(() => {
this.authenticateRunning = false;
@ -101,7 +101,7 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
<button class="pf-c-button pf-m-primary pf-m-block" @click=${() => {
this.authenticateWrapper();
}}>
${gettext("Retry authentication")}
${t`Retry authentication`}
</button>
</div>`}
</div>
@ -113,7 +113,7 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
if (!this.host) return;
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
}}>
${gettext("Return to device picker")}
${t`Return to device picker`}
</button>
</li>`:
html``}

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -54,7 +54,7 @@ export class WebAuthnAuthenticatorRegisterStage extends BaseStage {
throw new Error("Credential is empty");
}
} catch (err) {
throw new Error(gettext(`Error creating credential: ${err}`));
throw new Error(t`Error creating credential: ${err}`);
}
// we now have a new credential! We now need to encode the byte arrays
@ -68,7 +68,7 @@ export class WebAuthnAuthenticatorRegisterStage extends BaseStage {
response: newAssertionForServer
});
} catch (err) {
throw new Error(gettext(`Server validation of credential failed: ${err}`));
throw new Error(t`Server validation of credential failed: ${err}`);
}
}
@ -113,7 +113,7 @@ export class WebAuthnAuthenticatorRegisterStage extends BaseStage {
<button class="pf-c-button pf-m-primary pf-m-block" @click=${() => {
this.registerWrapper();
}}>
${gettext("Register device")}
${t`Register device`}
</button>
</div>`}
</div>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -34,7 +34,7 @@ export class AutosubmitStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -52,7 +52,7 @@ export class AutosubmitStage extends BaseStage {
</ak-empty-state>
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -64,7 +64,7 @@ export class CaptchaStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -79,7 +79,7 @@ export class CaptchaStage extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<div class="ak-loading">

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -39,7 +39,7 @@ export class ConsentStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -54,14 +54,14 @@ export class ConsentStage extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<div class="pf-c-form__group">
<p id="header-text">
${this.challenge.header_text}
</p>
<p>${gettext("Application requires following permissions")}</p>
<p>${t`Application requires following permissions`}</p>
<ul class="pf-c-list" id="permmissions">
${(this.challenge.permissions || []).map((permission) => {
return html`<li data-permission-code="${permission.id}">${permission.name}</li>`;
@ -71,7 +71,7 @@ export class ConsentStage extends BaseStage {
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { Challenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -26,7 +26,7 @@ export class DummyStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -38,7 +38,7 @@ export class DummyStage extends BaseStage {
<form class="pf-c-form" @submit=${(e: Event) => { this.submitForm(e); }}>
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { Challenge } from "authentik-api";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -27,7 +27,7 @@ export class EmailStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -39,13 +39,13 @@ export class EmailStage extends BaseStage {
<form class="pf-c-form" @submit=${(e: Event) => { this.submitForm(e); }}>
<div class="pf-c-form__group">
<p>
${gettext("Check your Emails for a password reset link.")}
${t`Check your Emails for a password reset link.`}
</p>
</div>
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Send Email again.")}
${t`Send Email again.`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { css, CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { BaseStage } from "../base";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -144,13 +144,13 @@ export class IdentificationStage extends BaseStage {
return html`<div class="pf-c-login__main-footer-band">
${this.challenge.enroll_url ? html`
<p class="pf-c-login__main-footer-band-item">
${gettext("Need an account?")}
<a id="enroll" href="${this.challenge.enroll_url}">${gettext("Sign up.")}</a>
${t`Need an account?`}
<a id="enroll" href="${this.challenge.enroll_url}">${t`Sign up.`}</a>
</p>` : html``}
${this.challenge.recovery_url ? html`
<p class="pf-c-login__main-footer-band-item">
${gettext("Need an account?")}
<a id="recovery" href="${this.challenge.recovery_url}">${gettext("Forgot username or password?")}</a>
${t`Need an account?`}
<a id="recovery" href="${this.challenge.recovery_url}">${t`Forgot username or password?`}</a>
</p>` : html``}
</div>`;
}
@ -159,7 +159,7 @@ export class IdentificationStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -171,12 +171,12 @@ export class IdentificationStage extends BaseStage {
<form class="pf-c-form" @submit=${(e: Event) => {this.submitForm(e);}}>
${this.challenge.application_pre ?
html`<p>
${gettext(`Login to continue to ${this.challenge.application_pre}.`)}
${t`Login to continue to ${this.challenge.application_pre}.`}
</p>`:
html``}
<ak-form-element
label="${gettext("Email or Username")}"
label="${t`Email or Username`}"
?required="${true}"
class="pf-c-form__group"
.errors=${(this.challenge?.response_errors || {})["uid_field"]}>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { WithUserInfoChallenge } from "../../../api/Flows";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -33,7 +33,7 @@ export class PasswordStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -48,18 +48,18 @@ export class PasswordStage extends BaseStage {
userAvatar="${this.challenge.pending_user_avatar}"
user=${this.challenge.pending_user}>
<div slot="link">
<a href="${FlowURLManager.cancel()}">${gettext("Not you?")}</a>
<a href="${FlowURLManager.cancel()}">${t`Not you?`}</a>
</div>
</ak-form-static>
<input name="username" autocomplete="username" type="hidden" value="${this.challenge.pending_user}">
<ak-form-element
label="${gettext("Password")}"
label="${t`Password`}"
?required="${true}"
class="pf-c-form__group"
.errors=${(this.challenge?.response_errors || {})["password"]}>
<input type="password"
name="password"
placeholder="${gettext("Please enter your password")}"
placeholder="${t`Please enter your password`}"
autofocus=""
autocomplete="current-password"
class="pf-c-form-control"
@ -69,11 +69,11 @@ export class PasswordStage extends BaseStage {
${this.challenge.recovery_url ?
html`<a href="${this.challenge.recovery_url}">
${gettext("Forgot password?")}</a>` : ""}
${t`Forgot password?`}</a>` : ""}
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>

View File

@ -1,4 +1,4 @@
import { gettext } from "django";
import { t } from "@lingui/macro";
import { CSSResult, customElement, html, property, TemplateResult } from "lit-element";
import { unsafeHTML } from "lit-html/directives/unsafe-html";
import PFLogin from "@patternfly/patternfly/components/Login/login.css";
@ -121,7 +121,7 @@ export class PromptStage extends BaseStage {
if (!this.challenge) {
return html`<ak-empty-state
?loading="${true}"
header=${gettext("Loading")}>
header=${t`Loading`}>
</ak-empty-state>`;
}
return html`<header class="pf-c-login__main-header">
@ -142,7 +142,7 @@ export class PromptStage extends BaseStage {
})}
<div class="pf-c-form__group pf-m-action">
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
${gettext("Continue")}
${t`Continue`}
</button>
</div>
</form>