Swedish interface: labels and short texts across every page
About 1,600 more headings, buttons, table columns, status words, placeholders and short messages are translated. Tables of words built when the app loads are now read when they are drawn, so they follow the language, and a test fails if text is translated at load time. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
25183c0320
commit
6e39430a1f
173 files changed
+3922
-2245
No files matched your search
@@ -38,14 +38,14 @@ function EditGroup({ g, people, self, busy, onSave, onCancel }: { g: AuthentikGr
|
||||
</label>
|
||||
<input id={`ak-group-name-${g.id}`} className="form-control form-control-sm mb-3" style={{ maxWidth: 360 }} required maxLength={200} autoComplete="off" value={name} onChange={(e) => setName(e.target.value)} />
|
||||
|
||||
<div className="form-label">Members</div>
|
||||
<div className="form-label">{t("Members")}</div>
|
||||
{!canEditMembers ? (
|
||||
<div className="text-secondary small mb-3">Authentik did not say who is in this group, so only its name can be changed here.</div>
|
||||
) : (
|
||||
<>
|
||||
<input className="form-control form-control-sm mb-2" style={{ maxWidth: 360 }} placeholder="Find a user" aria-label="Find a user" value={filter} onChange={(e) => setFilter(e.target.value)} />
|
||||
<input className="form-control form-control-sm mb-2" style={{ maxWidth: 360 }} placeholder={t("Find a user")} aria-label={t("Find a user")} value={filter} onChange={(e) => setFilter(e.target.value)} />
|
||||
<div className="border rounded p-2 mb-1" style={{ maxHeight: 240, overflowY: "auto" }}>
|
||||
{shown.length === 0 && <div className="text-secondary small">No user matches.</div>}
|
||||
{shown.length === 0 && <div className="text-secondary small">{t("No user matches.")}</div>}
|
||||
{shown.map((p) => (
|
||||
<label key={p.pk} className="form-check">
|
||||
<input type="checkbox" className="form-check-input" checked={members.includes(p.pk)} disabled={p.pk === self} onChange={() => toggle(p.pk)} />
|
||||
@@ -64,7 +64,7 @@ function EditGroup({ g, people, self, busy, onSave, onCancel }: { g: AuthentikGr
|
||||
|
||||
<div className="d-flex gap-2 mt-2">
|
||||
<button type="submit" className="btn btn-sm btn-primary" disabled={busy}>
|
||||
{busy ? "Saving…" : "Save"}
|
||||
{busy ? "Saving…" : t("Save")}
|
||||
</button>
|
||||
<button type="button" className="btn btn-sm btn-link text-secondary" onClick={onCancel} disabled={busy}>
|
||||
{t("Cancel")}
|
||||
@@ -138,10 +138,10 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
const members = g.members === null ? "" : g.members.length === 0 ? " It has no members." : ` Its ${g.members.length} member${g.members.length === 1 ? "" : "s"} stay${g.members.length === 1 ? "s" : ""}, just not in it.`;
|
||||
const roles = g.decidesRole ? ` It decides who is ${g.decidesRole === "admin" ? "an administrator" : "an operator"} in this app (Settings → Sign-in): people in it lose that role here at their next sign-in.` : "";
|
||||
const typed = await promptDialog({
|
||||
title: "Delete group",
|
||||
title: t("Delete group"),
|
||||
message: `This deletes the group "${g.name}" in ${a.name} for good. It cannot be undone.${members}${roles} Type the name of the group to confirm.`,
|
||||
label: "Group name",
|
||||
confirmLabel: "Delete",
|
||||
label: t("Group name"),
|
||||
confirmLabel: t("Delete"),
|
||||
required: true,
|
||||
});
|
||||
if (typed === null) return;
|
||||
@@ -165,9 +165,9 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
async function save(g: AuthentikGroupDetail, name: string, add: number[], remove: number[]) {
|
||||
if (g.decidesRole) {
|
||||
const ok = await confirmDialog({
|
||||
title: "Change a group that decides roles",
|
||||
title: t("Change a group that decides roles"),
|
||||
message: `"${g.name}" decides who is ${g.decidesRole === "admin" ? "an administrator" : "an operator"} in this app. Changing its name or its members changes people's roles here at their next sign-in. Go on?`,
|
||||
confirmLabel: "Save",
|
||||
confirmLabel: t("Save"),
|
||||
danger: true,
|
||||
});
|
||||
if (!ok) return;
|
||||
@@ -178,7 +178,7 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
try {
|
||||
const r = await api.authentik.updateGroup(a.id, g.id, { name: name !== g.name ? name : undefined, membersAdd: add, membersRemove: remove });
|
||||
setEditing(null);
|
||||
setNotice(r.changed.length === 0 ? "Nothing was different." : `Saved "${name}"${r.added + r.removed > 0 ? ` — ${r.added} put in, ${r.removed} taken out` : ""}.`);
|
||||
setNotice(r.changed.length === 0 ? t("Nothing was different.") : `Saved "${name}"${r.added + r.removed > 0 ? ` — ${r.added} put in, ${r.removed} taken out` : ""}.`);
|
||||
await load();
|
||||
} catch (err) {
|
||||
setError(readableError(err));
|
||||
@@ -188,20 +188,20 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
|
||||
return (
|
||||
<div className="mt-3">
|
||||
<h4>Groups</h4>
|
||||
<h4>{t("Groups")}</h4>
|
||||
<ErrorNotice error={error} />
|
||||
<SuccessNotice notice={notice} />
|
||||
{creating ? (
|
||||
<form onSubmit={create} className="card card-sm mb-2">
|
||||
<div className="card-body">
|
||||
<label className="form-label" htmlFor={`ak-new-group-${a.id}`}>
|
||||
Name of the new group
|
||||
{t("Name of the new group")}
|
||||
</label>
|
||||
<input id={`ak-new-group-${a.id}`} className="form-control form-control-sm mb-2" style={{ maxWidth: 360 }} required maxLength={200} autoComplete="off" autoFocus value={newName} onChange={(e) => setNewName(e.target.value)} />
|
||||
<div className="text-secondary small mb-2">It starts with no members — put them in with Edit — and it does not make its members administrators of Authentik; that is decided in Authentik.</div>
|
||||
<div className="d-flex gap-2">
|
||||
<button type="submit" className="btn btn-sm btn-primary" disabled={busy !== null || newName.trim() === ""}>
|
||||
{busy === "new" ? "Making…" : "Make group"}
|
||||
{busy === "new" ? t("Making…") : t("Make group")}
|
||||
</button>
|
||||
<button type="button" className="btn btn-sm btn-link text-secondary" onClick={() => { setCreating(false); setNewName(""); }} disabled={busy === "new"}>
|
||||
{t("Cancel")}
|
||||
@@ -211,24 +211,24 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
</form>
|
||||
) : (
|
||||
<button type="button" className="btn btn-sm btn-primary me-2 mb-2" onClick={() => { setCreating(true); setNotice(null); setError(null); }} disabled={busy !== null}>
|
||||
New group…
|
||||
{t("New group…")}
|
||||
</button>
|
||||
)}
|
||||
{groups === null ? (
|
||||
<button type="button" className="btn btn-sm btn-outline-secondary mb-2" onClick={() => void load()} disabled={busy !== null}>
|
||||
{busy === "list" ? "Reading…" : error ? "Try again" : "Show groups"}
|
||||
{busy === "list" ? t("Reading…") : error ? "Try again" : t("Show groups")}
|
||||
</button>
|
||||
) : (
|
||||
<>
|
||||
{groups.length === 0 ? (
|
||||
<div className="text-secondary mb-2">There are no groups.</div>
|
||||
<div className="text-secondary mb-2">{t("There are no groups.")}</div>
|
||||
) : (
|
||||
<div className="table-responsive">
|
||||
<table className="table table-vcenter table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Group</th>
|
||||
<th className="text-end">Members</th>
|
||||
<th>{t("Group")}</th>
|
||||
<th className="text-end">{t("Members")}</th>
|
||||
<th className="text-end"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -270,7 +270,7 @@ export default function AuthentikGroupList({ a }: { a: AuthentikInfo }) {
|
||||
</div>
|
||||
)}
|
||||
<button type="button" className="btn btn-sm btn-link text-secondary px-0" onClick={() => { setGroups(null); setEditing(null); }}>
|
||||
Hide groups
|
||||
{t("Hide groups")}
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user