Skip to content

Commit 529c33d

Browse files
3w36zj6CopilotYDX-2147483647
authored
feat: add translation switcher to website (#284)
Co-authored-by: Copilot <[email protected]> Co-authored-by: Y.D.X. <[email protected]>
1 parent 4e3161c commit 529c33d

17 files changed

+318
-89
lines changed

website/src/components/templates/BaseTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { html } from "hono/html";
22
import type { FC, PropsWithChildren } from "hono/jsx";
33
import { basePath, originUrl, typstOfficialDocsUrl } from "../../metadata";
4-
import { Translation, translation } from "../../translation";
4+
import { Translation, translation } from "../../translation/";
55
import type { Page } from "../../types/model";
66
import { joinPath, removeBasePath } from "../../utils/path";
77
import { getTranslationStatus } from "../../utils/translationStatus";

website/src/components/templates/CategoryTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FC } from "hono/jsx";
2-
import { Translation } from "../../translation";
2+
import { Translation } from "../../translation/";
33
import type { CategoryBody, Page } from "../../types/model";
44
import { HtmlContent } from "../ui/HtmlContent";
55
import BaseTemplate, { type BaseTemplateProps } from "./BaseTemplate";

website/src/components/templates/FuncTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FC } from "hono/jsx";
2-
import { Translation } from "../../translation";
2+
import { Translation } from "../../translation/";
33
import type { Func, FuncBody, Page } from "../../types/model";
44
import {
55
FunctionDefinition,

website/src/components/templates/TypeTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FC } from "hono/jsx";
2-
import { Translation } from "../../translation";
2+
import { Translation } from "../../translation/";
33
import type { Page, TypeBody } from "../../types/model";
44
import { FunctionDisplay, Tooltip } from "../ui";
55
import { HtmlContent } from "../ui/HtmlContent";

website/src/components/ui/FunctionDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FC } from "hono/jsx";
2-
import { Translation } from "../../translation";
2+
import { Translation } from "../../translation/";
33
import type { Func } from "../../types/model";
44
import { ChevronRightIcon } from "../icons";
55
import { FunctionDefinition } from "./FunctionDefinition";

website/src/components/ui/FunctionParameters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FC } from "hono/jsx";
22
import { basePath } from "../../metadata";
3-
import { Translation } from "../../translation";
3+
import { Translation } from "../../translation/";
44
import type { Func } from "../../types/model";
55
import { joinPath } from "../../utils/path";
66
import { ChevronRightIcon } from "../icons";

website/src/components/ui/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FC } from "hono/jsx";
2-
import { Translation, translation } from "../../translation";
2+
import { Translation, translation } from "../../translation/";
33
import { CloseIcon, HelpCircleIcon } from "../icons";
44

55
export type TooltipProps = {

website/src/components/ui/common/Footer.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
githubOrganizationUrl,
44
githubRepositoryUrl,
55
} from "../../../metadata";
6+
import { Translation } from "../../../translation/";
67
import { DiscordIcon, GitHubIcon } from "../../icons";
78

89
export const Footer = () => {
@@ -32,13 +33,7 @@ export const Footer = () => {
3233
</a>
3334
</div>
3435
<p class="mt-8 text-sm leading-6 text-center text-gray-600">
35-
Translated by{" "}
36-
<a
37-
href={githubOrganizationUrl}
38-
class="text-gray-600 hover:text-gray-800 transition-colors"
39-
>
40-
Typst Japanese Community
41-
</a>
36+
<Translation translationKey="footer" />
4237
</p>
4338
</div>
4439
</section>

website/src/components/ui/common/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
typstOfficialUrl,
66
version,
77
} from "../../../metadata";
8-
import { Translation, translation } from "../../../translation";
8+
import { Translation, translation } from "../../../translation/";
99
import { calculateTranslationProgressRate } from "../../../utils/translationStatus";
1010
import {
1111
DiscordIcon,

website/src/components/ui/common/SearchWindow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FC } from "hono/jsx";
22
import { basePath } from "../../../metadata";
3-
import { Translation, translation } from "../../../translation";
3+
import { Translation, translation } from "../../../translation/";
44
import { joinPath } from "../../../utils/path";
55
import { CloseIcon } from "../../icons";
66

0 commit comments

Comments
 (0)