Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+8
-7
@@ -4,28 +4,29 @@ import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const translations: Record<string, string> = {
|
||||
"settings.language.heading": "Language",
|
||||
"settings.language.description": "HiveGrid is available in German only in version 1.",
|
||||
"settings.language.description": "HiveGrid is available in German and English.",
|
||||
"settings.language.currentLabel": "Current language",
|
||||
"settings.language.german": "German",
|
||||
"settings.language.v2Note": "Additional languages and a language switcher will follow in a later version.",
|
||||
"settings.language.v2Note": "You can change the language at any time from the language menu.",
|
||||
"shared.locales.en": "English",
|
||||
};
|
||||
|
||||
vi.mock("react-i18next", () => ({
|
||||
useTranslation: () => ({
|
||||
t: (key: string) => translations[key] ?? key,
|
||||
i18n: { language: "en-US" },
|
||||
}),
|
||||
}));
|
||||
|
||||
import { LanguageSettingsNotice } from "./LanguageSettingsNotice";
|
||||
|
||||
describe("LanguageSettingsNotice", () => {
|
||||
it("renders the German-only notice with the current language and the v2 deferral note", () => {
|
||||
it("renders the active language and points to the global language menu", () => {
|
||||
render(<LanguageSettingsNotice />);
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Language" })).toBeInTheDocument();
|
||||
expect(screen.getByText("HiveGrid is available in German only in version 1.")).toBeInTheDocument();
|
||||
expect(screen.getByText("German")).toBeInTheDocument();
|
||||
expect(screen.getByText("Additional languages and a language switcher will follow in a later version.")).toBeInTheDocument();
|
||||
expect(screen.getByText("HiveGrid is available in German and English.")).toBeInTheDocument();
|
||||
expect(screen.getByText("English")).toBeInTheDocument();
|
||||
expect(screen.getByText("You can change the language at any time from the language menu.")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("routes every visible string through t() so no raw i18n keys leak into the UI", () => {
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
// Static, read-only language notice. v1 ships German-only; a real language
|
||||
// switcher and additional locales are deferred to v2 (see AK-P3 DoD 6/DoD 7).
|
||||
// All copy goes through t() so the i18n build lint stays green.
|
||||
// Read-only summary of the currently active language. The global language
|
||||
// menu owns the mutation so this settings card cannot drift from that source.
|
||||
export function LanguageSettingsNotice() {
|
||||
const { t } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
const activeLanguage = i18n.language.split("-")[0] ?? "de";
|
||||
|
||||
return (
|
||||
<section
|
||||
@@ -20,7 +20,7 @@ export function LanguageSettingsNotice() {
|
||||
</div>
|
||||
<dl className="grid gap-1 text-body-small-regular-0 font-body-small-regular-0">
|
||||
<dt className="text-text-neutral-secondary">{t("settings.language.currentLabel")}</dt>
|
||||
<dd className="text-text-neutral-primary">{t("settings.language.german")}</dd>
|
||||
<dd className="text-text-neutral-primary">{t(`shared.locales.${activeLanguage}`)}</dd>
|
||||
</dl>
|
||||
<p className="rounded-sm border border-dashed border-border-default bg-surface-neutral-primary px-3 py-2 text-body-small-regular-0 font-body-small-regular-0 text-text-neutral-secondary">{t("settings.language.v2Note")}</p>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user