).status === 404) {
+ return (
+
+ );
+ }
if (error) return ;
- if (!user) return ;
+ if (!user) return ;
return (
@@ -226,7 +236,11 @@ function EditProfileCard({ user, onSaved, isSelf }: { user: UserDetail; onSaved:
}
function LinkedAccountsCard({ user, onChanged }: { user: UserDetail; onChanged: () => void }) {
- const { t } = useTranslation("admin");
+ const { t, i18n } = useTranslation("admin");
+ // The two sources the link form offers are named; anything else the server
+ // reports is shown as is.
+ const sourceLabel = (source: string) =>
+ source === "mojang" || source === "thirdparty" ? t(`users_link_source_${source}`) : source;
const accounts = user.linked_accounts ?? [];
const [unlinking, setUnlinking] = useState(null);
const [unlinkDlg, setUnlinkDlg] = useState(null);
@@ -308,8 +322,8 @@ function LinkedAccountsCard({ user, onChanged }: { user: UserDetail; onChanged:
- Mojang
- Third-party Yggdrasil
+ {t("users_link_source_mojang")}
+ {t("users_link_source_thirdparty")}
@@ -331,7 +345,7 @@ function LinkedAccountsCard({ user, onChanged }: { user: UserDetail; onChanged:
{acc.mc_uuid}
- {acc.auth_source} · {formatAbsolute(acc.verified_at, "en-US")}
+ {sourceLabel(acc.auth_source)} · {formatAbsolute(acc.verified_at, i18n.language)}