Skip to content

Commit

Permalink
Rename user.json to account.json (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver3 authored Feb 27, 2025
1 parent 941d44e commit 0714f45
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,27 @@ export function AccountSetupForm() {
return (
<form className="no_footer" onSubmit={handleSubmit}>
<div>
<h2 className="mb-lg">{t("user.personalize_account")}</h2>
<h2 className="mb-lg">{t("account.personalize_account")}</h2>
<InputField
name="username"
label={t("user.username")}
hint={t("user.username_hint")}
value={t("user.username_default")}
label={t("account.username")}
hint={t("account.username_hint")}
value={t("account.username_default")}
disabled
/>
<InputField name="name" label={t("user.name")} subtext={t("user.name_subtext")} hint={t("user.name_hint")} />
<InputField
name="name"
label={t("account.name")}
subtext={t("account.name_subtext")}
hint={t("account.name_hint")}
/>
<InputField
name="new_password1"
label={t("user.password_new")}
hint={t("user.password_hint")}
label={t("account.password_new")}
hint={t("account.password_hint")}
type="password"
/>
<InputField name="new_password2" label={t("user.password_repeat")} type="password" />
<InputField name="new_password2" label={t("account.password_repeat")} type="password" />
</div>
<BottomBar type="footer">
<BottomBar.Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function ChangePasswordForm() {

// Validate the form
if (formState.newPassword !== formState.newPasswordRepeat) {
setError("user.password_mismatch");
setError("account.password_mismatch");
return;
}

Expand Down Expand Up @@ -104,17 +104,17 @@ export function ChangePasswordForm() {
}}
margin="mb-lg"
>
<h2>{t("user.password_changed")}</h2>
<h2>{t("account.password_changed")}</h2>
</Alert>
</FormLayout.Alert>
)}
<h2 className="mb-lg">
{t("user.username")}: {user.username}
{t("account.username")}: {user.username}
</h2>
<InputField
name="password"
label={t("user.password")}
hint={t("user.current_password_hint")}
label={t("account.password")}
hint={t("account.current_password_hint")}
type="password"
value={formState.password}
onChange={(e) => {
Expand All @@ -123,8 +123,8 @@ export function ChangePasswordForm() {
/>
<InputField
name="new_password"
label={t("user.password_new")}
hint={t("user.password_new")}
label={t("account.password_new")}
hint={t("account.password_new")}
type="password"
value={formState.newPassword}
onChange={(e) => {
Expand All @@ -133,7 +133,7 @@ export function ChangePasswordForm() {
/>
<InputField
name="new_password_repeat"
label={t("user.password_repeat")}
label={t("account.password_repeat")}
type="password"
value={formState.newPasswordRepeat}
onChange={(e) => {
Expand Down
10 changes: 5 additions & 5 deletions frontend/app/component/form/user/login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function LoginForm() {
)}
<InputField
name="username"
label={t("user.username")}
hint={t("user.username_login_hint")}
label={t("account.username")}
hint={t("account.username_login_hint")}
readOnly={loading}
required={true}
value={username}
Expand All @@ -66,8 +66,8 @@ export function LoginForm() {
/>
<InputField
name="password"
label={t("user.password")}
hint={t("user.password_login_hint")}
label={t("account.password")}
hint={t("account.password_login_hint")}
type="password"
readOnly={loading}
required={true}
Expand All @@ -80,7 +80,7 @@ export function LoginForm() {
<BottomBar type="footer">
<BottomBar.Row>
<Button type="submit" size="lg" disabled={loading}>
{t("user.login")}
{t("account.login")}
</Button>
</BottomBar.Row>
</BottomBar>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/component/navbar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export function NavBar({ location }: NavBarProps) {
<>
<strong>{user.fullname || user.username}</strong>
<span className={styles.lower}>({t(user.role)})</span>
<Link to={`/account/logout`}>{t("user.logout")}</Link>
<Link to={`/account/logout`}>{t("account.logout")}</Link>
</>
) : (
<Link to={`/account/login`}>{t("user.login")}</Link>
<Link to={`/account/login`}>{t("account.login")}</Link>
)}
</div>
</nav>
Expand Down
10 changes: 5 additions & 5 deletions frontend/app/module/DevHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,24 @@ function DevLinks() {
void logout();
}}
>
{t("user.logout")}: {user.fullname || user.username} ({user.role})
{t("account.logout")}: {user.fullname || user.username} ({user.role})
</Link>
</li>
)}
</ul>
<strong>{t("general")}</strong>
<ul>
<li>
<Link to={`/account`}>{t("user.account")}</Link>
<Link to={`/account`}>{t("account.account")}</Link>
<ul>
<li>
<Link to={`/account/login`}>{t("user.login")}</Link>
<Link to={`/account/login`}>{t("account.login")}</Link>
</li>
<li>
<Link to={`/account/setup`}>{t("user.account_setup")}</Link>
<Link to={`/account/setup`}>{t("account.account_setup")}</Link>
</li>
<li>
<Link to={`/account/change-password`}>{t("user.change_password")}</Link>
<Link to={`/account/change-password`}>{t("account.change_password")}</Link>
</li>
</ul>
</li>
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/module/account/page/AccountSetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export function AccountSetupPage() {

return (
<>
<PageTitle title={`${t("user.account_setup")} - Abacus`} />
<PageTitle title={`${t("account.account_setup")} - Abacus`} />
<header>
<section>
<h1>{t("user.account_setup")}</h1>
<h1>{t("account.account_setup")}</h1>
</section>
</header>
{showAlert && (
<Alert type="success" onClose={hideAlert}>
<h2>{t("user.login_success")}</h2>
<p>{t("user.phrases.setting_up_account")}</p>
<h2>{t("account.login_success")}</h2>
<p>{t("account.setting_up_account")}</p>
</Alert>
)}
<main>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/module/account/page/ChangePasswordPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export function ChangePasswordPage() {

return (
<>
<PageTitle title={`${t("user.change_password")} - Abacus`} />
<PageTitle title={`${t("account.change_password")} - Abacus`} />
<header>
<section>
<h1>{t("user.change_password")}</h1>
<h1>{t("account.change_password")}</h1>
</section>
</header>
<main>
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/module/account/page/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { PageTitle } from "@kiesraad/ui";
export function LoginPage() {
return (
<>
<PageTitle title={`${t("user.login")} - Abacus`} />
<PageTitle title={`${t("account.login")} - Abacus`} />
<header>
<section>
<h1>{t("user.login")}</h1>
<h1>{t("account.login")}</h1>
</section>
</header>
<main>
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/module/account/page/UserHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export function UserHomePage() {

return (
<>
<PageTitle title={`${t("user.account")} - Abacus`} />
<PageTitle title={`${t("account.account")} - Abacus`} />
<header>
<section>
<h1>{t("user.account")}</h1>
<h1>{t("account.account")}</h1>
</section>
</header>
<main>
<article>
<ul>
<li>
<Link to={`login`}>{t("user.login")}</Link>
<Link to={`login`}>{t("account.login")}</Link>
</li>
</ul>
</article>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/module/users/update/UserUpdateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function UserUpdateForm({ user, onSave, onAbort, saving }: UserUpdateForm
error={validationErrors?.temp_password}
/>
) : (
<FormLayout.Field label={t("user.password")}>
<FormLayout.Field label={t("account.password")}>
{t("users.change_password_hint")}

<Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{
"personalize_account": "Personaliseer je account",
"username": "Gebruikersnaam",
"username_hint": "Je kan deze niet aanpassen. Log volgende keer weer met deze gebruikersnaam in.",
"username_login_hint": "De naam op het briefje dat je van de coördinator hebt gekregen.",
"username_default": "Gebruiker01",
"account": "Account",
"account_setup": "Account instellen",
"change_password": "Wachtwoord wijzigen",
"current_password_hint": "Vul je huidige wachtwoord in",
"login": "Inloggen",
"login_success": "Inloggen gelukt",
"logout": "Afmelden",
"name": "Jouw naam",
"name_subtext": "(roepnaam + achternaam)",
"name_hint": "Bijvoorbeeld Karel van Tellingen. Je naam wordt opgenomen in het verslag van deze invoersessie.",
"name_subtext": "(roepnaam + achternaam)",
"password": "Wachtwoord",
"password_changed": "Je wachtwoord is succesvol gewijzigd",
"password_hint": "Je hebt dit wachtwoord nodig als je na een pauze opnieuw wilt inloggen. Gebruik minimaal 8 letters en 2 cijfers.",
"password_login_hint": "Eerder ingelogd? Vul het wachtwoord in dat je zelf hebt ingesteld. Nog niet eerder ingelogd? Gebruik het wachtwoord dat je van de coördinator hebt gekregen.",
"password_mismatch": "De wachtwoorden komen niet overeen",
"password_new": "Kies nieuw wachtwoord",
"password_repeat": "Herhaal het wachtwoord dat je net hebt ingevuld",
"password_mismatch": "De wachtwoorden komen niet overeen",
"password_changed": "Je wachtwoord is succesvol gewijzigd",
"login": "Inloggen",
"login_success": "Inloggen gelukt",
"logout": "Afmelden",
"account": "Account",
"account_setup": "Account instellen",
"change_password": "Wachtwoord wijzigen",
"current_password_hint": "Vul je huidige wachtwoord in",
"phrases": {
"setting_up_account": "We gaan je account instellen voor gebruik. Vul onderstaande gegevens in om verder te gaan."
}
"personalize_account": "Personaliseer je account",
"setting_up_account": "We gaan je account instellen voor gebruik. Vul onderstaande gegevens in om verder te gaan.",
"username": "Gebruikersnaam",
"username_default": "Gebruiker01",
"username_hint": "Je kan deze niet aanpassen. Log volgende keer weer met deze gebruikersnaam in.",
"username_login_hint": "De naam op het briefje dat je van de coördinator hebt gekregen."
}
4 changes: 2 additions & 2 deletions frontend/lib/i18n/locales/nl/nl.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import account from "./account.json";
import apportionment from "./apportionment.json";
import candidates_votes from "./candidates_votes.json";
import check_and_save from "./check_and_save.json";
Expand All @@ -15,13 +16,13 @@ import polling_station from "./polling_station.json";
import polling_station_choice from "./polling_station_choice.json";
import recounted from "./recounted.json";
import status from "./status.json";
import user from "./user.json";
import users from "./users.json";
import voters_and_votes from "./voters_and_votes.json";
import workstations from "./workstations.json";

const nl = {
...generic,
account,
apportionment,
candidates_votes,
check_and_save,
Expand All @@ -38,7 +39,6 @@ const nl = {
polling_station_choice,
recounted,
status,
user,
users,
voters_and_votes,
workstations,
Expand Down

0 comments on commit 0714f45

Please sign in to comment.