diff --git a/website/src/components/icons/AlertTriangleIcon.tsx b/website/src/components/icons/AlertTriangleIcon.tsx index fbf4356473..96d8ae8f4a 100644 --- a/website/src/components/icons/AlertTriangleIcon.tsx +++ b/website/src/components/icons/AlertTriangleIcon.tsx @@ -9,8 +9,8 @@ export const AlertTriangleIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-alert-triangle" + role="graphics-symbol" > - 警告アイコン diff --git a/website/src/components/icons/CaretRightCircleIcon.tsx b/website/src/components/icons/CaretRightCircleIcon.tsx index 3b1809353a..ac0a77e160 100644 --- a/website/src/components/icons/CaretRightCircleIcon.tsx +++ b/website/src/components/icons/CaretRightCircleIcon.tsx @@ -9,8 +9,8 @@ export const CaretRightCircleIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-circle-caret-right" + role="graphics-symbol" > - 再生アイコン diff --git a/website/src/components/icons/ChevronLeftIcon.tsx b/website/src/components/icons/ChevronLeftIcon.tsx index ab792db757..a24d657211 100644 --- a/website/src/components/icons/ChevronLeftIcon.tsx +++ b/website/src/components/icons/ChevronLeftIcon.tsx @@ -9,8 +9,8 @@ export const ChevronLeftIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-left" + role="graphics-symbol" > - 左矢印アイコン diff --git a/website/src/components/icons/ChevronRightIcon.tsx b/website/src/components/icons/ChevronRightIcon.tsx index f60a5b2e94..e6a52b8eda 100644 --- a/website/src/components/icons/ChevronRightIcon.tsx +++ b/website/src/components/icons/ChevronRightIcon.tsx @@ -9,8 +9,8 @@ export const ChevronRightIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-right" + role="graphics-symbol" > - 右矢印アイコン diff --git a/website/src/components/icons/CloseIcon.tsx b/website/src/components/icons/CloseIcon.tsx index 2489171efe..eea7be6e95 100644 --- a/website/src/components/icons/CloseIcon.tsx +++ b/website/src/components/icons/CloseIcon.tsx @@ -9,8 +9,8 @@ export const CloseIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-x" + role="graphics-symbol" > - 閉じるアイコン diff --git a/website/src/components/icons/HelpCircleIcon.tsx b/website/src/components/icons/HelpCircleIcon.tsx index f63fb13c31..16c4ee8812 100644 --- a/website/src/components/icons/HelpCircleIcon.tsx +++ b/website/src/components/icons/HelpCircleIcon.tsx @@ -9,8 +9,8 @@ export const HelpCircleIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-help" + role="graphics-symbol" > - ヘルプアイコン diff --git a/website/src/components/icons/HomeIcon.tsx b/website/src/components/icons/HomeIcon.tsx index de795371da..6237eb5180 100644 --- a/website/src/components/icons/HomeIcon.tsx +++ b/website/src/components/icons/HomeIcon.tsx @@ -9,8 +9,8 @@ export const HomeIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-home" + role="graphics-symbol" > - ホームアイコン diff --git a/website/src/components/icons/InfoCircleIcon.tsx b/website/src/components/icons/InfoCircleIcon.tsx index 2aa6251b9d..cbbe9c66c6 100644 --- a/website/src/components/icons/InfoCircleIcon.tsx +++ b/website/src/components/icons/InfoCircleIcon.tsx @@ -9,8 +9,8 @@ export const InfoCircleIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-info-circle" + role="graphics-symbol" > - 情報アイコン diff --git a/website/src/components/icons/LanguageIcon.tsx b/website/src/components/icons/LanguageIcon.tsx index 1a2d5dd00d..fcb8855a4d 100644 --- a/website/src/components/icons/LanguageIcon.tsx +++ b/website/src/components/icons/LanguageIcon.tsx @@ -8,8 +8,8 @@ export const LanguageIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-language-hiragana" + role="graphics-symbol" > - 言語アイコン diff --git a/website/src/components/icons/MenuIcon.tsx b/website/src/components/icons/MenuIcon.tsx index 5732f6d0b7..085b85d83e 100644 --- a/website/src/components/icons/MenuIcon.tsx +++ b/website/src/components/icons/MenuIcon.tsx @@ -9,8 +9,8 @@ export const MenuIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2" + role="graphics-symbol" > - メニューアイコン diff --git a/website/src/components/icons/SearchIcon.tsx b/website/src/components/icons/SearchIcon.tsx index 0c19b7c15c..61368c7cac 100644 --- a/website/src/components/icons/SearchIcon.tsx +++ b/website/src/components/icons/SearchIcon.tsx @@ -9,8 +9,8 @@ export const SearchIcon = () => { stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-search" + role="graphics-symbol" > - 検索アイコン diff --git a/website/src/components/templates/BaseTemplate.tsx b/website/src/components/templates/BaseTemplate.tsx index c24a208eda..c6f1d7f393 100644 --- a/website/src/components/templates/BaseTemplate.tsx +++ b/website/src/components/templates/BaseTemplate.tsx @@ -1,6 +1,7 @@ import { html } from "hono/html"; import type { FC, PropsWithChildren } from "hono/jsx"; import { basePath, originUrl, typstOfficialDocsUrl } from "../../metadata"; +import { Translation, translation } from "../../translation"; import type { Page } from "../../types/model"; import { joinPath, removeBasePath } from "../../utils/path"; import { getTranslationStatus } from "../../utils/translationStatus"; @@ -54,17 +55,19 @@ export const BaseTemplate: FC = ({ removeBasePath(basePath, route), ); return ( - + - {title} – Typstドキュメント日本語版 + + {title} – {translation.documentationTitle()} + @@ -178,7 +181,7 @@ export const BaseTemplate: FC = ({ type="button" class="text-gray-600" x-on:click="sidebarOpen = false" - aria-label="メニューを閉じる" + aria-label={translation.closeMenu()} >
@@ -218,7 +221,7 @@ export const BaseTemplate: FC = ({
- 原文(英語)を開く +
)} @@ -238,7 +241,7 @@ export const BaseTemplate: FC = ({ - 原文(英語)を開く +
@@ -257,11 +260,11 @@ export const BaseTemplate: FC = ({
- チュートリアル +

- 一歩一歩、Typstの使い方を学びましょう。 +

= ({ - リファレンス +

- Typstのあらゆる構文、概念、型、関数についての詳細なリファレンスです。 +

@@ -294,7 +297,7 @@ export const BaseTemplate: FC = ({ - 前のページ +

{previousPage.title}

@@ -305,7 +308,7 @@ export const BaseTemplate: FC = ({ >
- 次のページ +
diff --git a/website/src/components/templates/CategoryTemplate.tsx b/website/src/components/templates/CategoryTemplate.tsx index 12578cab0e..5eeafda15f 100644 --- a/website/src/components/templates/CategoryTemplate.tsx +++ b/website/src/components/templates/CategoryTemplate.tsx @@ -1,4 +1,5 @@ import type { FC } from "hono/jsx"; +import { Translation } from "../../translation"; import type { CategoryBody, Page } from "../../types/model"; import { HtmlContent } from "../ui/HtmlContent"; import BaseTemplate, { type BaseTemplateProps } from "./BaseTemplate"; @@ -26,7 +27,9 @@ export const CategoryTemplate: FC = ({ >

{page.body.content.title}

-

定義

+

+ +

    {page.body.content.items.map((item) => (
  • diff --git a/website/src/components/templates/FuncTemplate.tsx b/website/src/components/templates/FuncTemplate.tsx index 95e9f4568f..807d966d23 100644 --- a/website/src/components/templates/FuncTemplate.tsx +++ b/website/src/components/templates/FuncTemplate.tsx @@ -1,4 +1,5 @@ import type { FC } from "hono/jsx"; +import { Translation } from "../../translation"; import type { Func, FuncBody, Page } from "../../types/model"; import { FunctionDefinition, @@ -52,7 +53,7 @@ export const FuncTemplate: FC = ({

- 引数 +

@@ -82,7 +83,10 @@ export const FuncTemplate: FC = ({ function ScopedDefinitions({ scope, parent, -}: { scope: Func[]; parent?: { name: string; id: string } | undefined }) { +}: { + scope: Func[]; + parent?: { name: string; id: string } | undefined; +}) { if (scope.length === 0) { return null; } @@ -99,10 +103,10 @@ function ScopedDefinitions({ // Currently, the scope has at most two levels. // Therefore, it is sufficient to only annotate the direct `parent`. <> - {parent.name}の定義 + ) : ( - "定義" + )} diff --git a/website/src/components/templates/TypeTemplate.tsx b/website/src/components/templates/TypeTemplate.tsx index 815209e7d8..50a9a11a78 100644 --- a/website/src/components/templates/TypeTemplate.tsx +++ b/website/src/components/templates/TypeTemplate.tsx @@ -1,4 +1,5 @@ import type { FC } from "hono/jsx"; +import { Translation } from "../../translation"; import type { Page, TypeBody } from "../../types/model"; import { FunctionDisplay, Tooltip } from "../ui"; import { HtmlContent } from "../ui/HtmlContent"; @@ -38,7 +39,7 @@ export const TypeTemplate: FC = ({ {content.constructor && ( <>

- コンストラクタ +

@@ -53,7 +54,7 @@ export const TypeTemplate: FC = ({ {content.scope.length > 0 && ( <>

- 定義 +

diff --git a/website/src/components/ui/FunctionDisplay.tsx b/website/src/components/ui/FunctionDisplay.tsx index 358be1831d..c884644147 100644 --- a/website/src/components/ui/FunctionDisplay.tsx +++ b/website/src/components/ui/FunctionDisplay.tsx @@ -1,4 +1,5 @@ import type { FC } from "hono/jsx"; +import { Translation } from "../../translation"; import type { Func } from "../../types/model"; import { ChevronRightIcon } from "../icons"; import { FunctionDefinition } from "./FunctionDefinition"; @@ -35,7 +36,7 @@ export const FunctionDisplay: FC = ({
- 例を表示 +
diff --git a/website/src/components/ui/FunctionParameters.tsx b/website/src/components/ui/FunctionParameters.tsx index 6b6fdc64af..fead4c3600 100644 --- a/website/src/components/ui/FunctionParameters.tsx +++ b/website/src/components/ui/FunctionParameters.tsx @@ -1,5 +1,6 @@ import type { FC } from "hono/jsx"; import { basePath } from "../../metadata"; +import { Translation } from "../../translation"; import type { Func } from "../../types/model"; import { joinPath } from "../../utils/path"; import { ChevronRightIcon } from "../icons"; @@ -64,7 +65,7 @@ export const FunctionParameters: FC = ({ {param.strings.length > 0 && (
- 使用可能な文字列値: +
    {param.strings.map((string) => ( @@ -85,7 +86,9 @@ export const FunctionParameters: FC = ({ {param.default && (

    - デフォルト値:{" "} + + + {" "} @@ -98,7 +101,7 @@ export const FunctionParameters: FC = ({

    - 例を表示 +
    diff --git a/website/src/components/ui/Tooltip.tsx b/website/src/components/ui/Tooltip.tsx index dc40c94486..37a50ac2cc 100644 --- a/website/src/components/ui/Tooltip.tsx +++ b/website/src/components/ui/Tooltip.tsx @@ -1,8 +1,8 @@ import type { FC } from "hono/jsx"; +import { Translation, translation } from "../../translation"; import { CloseIcon, HelpCircleIcon } from "../icons"; -import { HtmlContent } from "./HtmlContent"; -type TooltipProps = { +export type TooltipProps = { kind: | "element" | "contextual" @@ -17,65 +17,65 @@ type TooltipProps = { const tooltipContent: Record< TooltipProps["kind"], { - label: string; - desc: string; + label: ReturnType; + desc: ReturnType; isShowLabel: boolean; bgColor: string; textColor: string; } > = { element: { - label: "要素関数", - desc: "要素関数はsetルールやshowルールでカスタマイズできます。", + label: , + desc: , isShowLabel: true, bgColor: "bg-blue-50", textColor: "text-blue-700", }, contextual: { - label: "コンテキスト関数", - desc: "コンテキスト関数は、コンテキストが既知の場合にのみ使用できます。", + label: , + desc: , isShowLabel: true, bgColor: "bg-indigo-50", textColor: "text-indigo-700", }, definitions: { - label: "定義", - desc: "これらの関数や型には、関連する定義を持たせることができます。定義にアクセスするには、対象の関数や型の名前を指定した後に、ピリオド区切りで定義名を記述します。", + label: , + desc: , isShowLabel: false, bgColor: "bg-gray-100", textColor: "text-gray-700", }, parameters: { - label: "引数", - desc: "引数は関数への入力値です。関数名の後に括弧で囲んで指定します。", + label: , + desc: , isShowLabel: false, bgColor: "bg-gray-100", textColor: "text-gray-700", }, variadic: { - label: "可変長引数", - desc: "可変長引数は複数回指定することができます。", + label: , + desc: , isShowLabel: true, bgColor: "bg-green-50", textColor: "text-green-700", }, settable: { - label: "設定可能引数", - desc: "設定可能引数は、setルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。", + label: , + desc: , isShowLabel: true, bgColor: "bg-amber-50", textColor: "text-amber-700", }, positional: { - label: "位置引数", - desc: "位置引数は順序通りに指定することで、引数名を省略して設定できます。", + label: , + desc: , isShowLabel: true, bgColor: "bg-purple-50", textColor: "text-purple-700", }, required: { - label: "必須引数", - desc: "必須引数は、関数を呼び出す際に必ず指定しなければなりません。", + label: , + desc: , isShowLabel: true, bgColor: "bg-rose-50", textColor: "text-rose-700", @@ -101,7 +101,9 @@ export const Tooltip: FC = ({ kind }) => {
    -
    - -
    +
    {content.desc}
diff --git a/website/src/components/ui/common/Header.tsx b/website/src/components/ui/common/Header.tsx index b5efd4a8bb..58bf5a27b4 100644 --- a/website/src/components/ui/common/Header.tsx +++ b/website/src/components/ui/common/Header.tsx @@ -5,6 +5,7 @@ import { typstOfficialUrl, version, } from "../../../metadata"; +import { Translation, translation } from "../../../translation"; import { calculateTranslationProgressRate } from "../../../utils/translationStatus"; import { DiscordIcon, @@ -29,7 +30,9 @@ const TranslationCoverageBadge = () => {
- 翻訳率 + + +
@@ -66,7 +69,10 @@ export const Header = () => {
- 検索... + + + ... +
@@ -98,7 +104,7 @@ export const Header = () => { href={typstOfficialUrl} class="text-sm text-gray-600 hover:text-gray-800 transition-colors" > - Typst公式サイト +
  • @@ -106,7 +112,7 @@ export const Header = () => { href={typstOfficialDocsUrl} class="text-sm text-gray-600 hover:text-gray-800 transition-colors" > - Typst公式ドキュメント +
  • @@ -131,7 +137,7 @@ export const Header = () => { type="button" class="p-2 text-gray-600 hover:text-gray-800 transition-colors" x-on:click="searchOpen = true" - aria-label="検索を開く" + aria-label={translation.openSearch()} >
    @@ -141,7 +147,7 @@ export const Header = () => { type="button" class="p-1 bg-white rounded-md border border-gray-200" x-on:click="sidebarOpen = !sidebarOpen" - aria-label="メニューを開く" + aria-label={translation.openMenu()} >
    diff --git a/website/src/components/ui/common/SearchWindow.tsx b/website/src/components/ui/common/SearchWindow.tsx index 73e6b056fd..06723eaa0d 100644 --- a/website/src/components/ui/common/SearchWindow.tsx +++ b/website/src/components/ui/common/SearchWindow.tsx @@ -1,5 +1,6 @@ import type { FC } from "hono/jsx"; import { basePath } from "../../../metadata"; +import { Translation, translation } from "../../../translation"; import { joinPath } from "../../../utils/path"; import { CloseIcon } from "../../icons"; @@ -16,12 +17,14 @@ export const SearchWindow: FC = () => { )}
    -

    検索

    +

    + +

    diff --git a/website/src/components/ui/common/SiteTitle.tsx b/website/src/components/ui/common/SiteTitle.tsx index 6c3a6b44dd..0777caf424 100644 --- a/website/src/components/ui/common/SiteTitle.tsx +++ b/website/src/components/ui/common/SiteTitle.tsx @@ -1,13 +1,17 @@ import { basePath } from "../../../metadata"; +import { Translation } from "../../../translation"; + export const SiteTitle = () => { return (
    Typst - ドキュメント + + + + - 日本語版
    ); diff --git a/website/src/components/ui/common/TableOfContents.tsx b/website/src/components/ui/common/TableOfContents.tsx index 23d44aa6ae..c3eb4ff0c1 100644 --- a/website/src/components/ui/common/TableOfContents.tsx +++ b/website/src/components/ui/common/TableOfContents.tsx @@ -1,3 +1,4 @@ +import { Translation } from "../../../translation"; import type { OutlineItem } from "../../../types/model"; export type TableOfContentsProps = { @@ -39,7 +40,7 @@ export const TableOfContents = ({ outline }: TableOfContentsProps) => { class="flex-none w-full px-3.5 py-3 border border-neutral-200/60 rounded-md bg-white sticky top-[80px] mt-4 mb-8 h-[calc(100vh-80px-1rem)] overflow-auto" > - 目次 + diff --git a/website/src/components/ui/common/TranslationStatusAlert.tsx b/website/src/components/ui/common/TranslationStatusAlert.tsx index 6ea0239d6c..22797993ab 100644 --- a/website/src/components/ui/common/TranslationStatusAlert.tsx +++ b/website/src/components/ui/common/TranslationStatusAlert.tsx @@ -1,5 +1,6 @@ import type { FC } from "hono/jsx"; import { twMerge } from "tailwind-merge"; +import { Translation } from "../../../translation"; import type { TranslationStatus } from "../../../utils/translationStatus"; import { LanguageIcon } from "../../icons"; @@ -8,8 +9,8 @@ type StatusConfig = { borderColor: string; textColor: string; iconColor: string; - label: string; - message: string; + label: ReturnType; + message: ReturnType; }; const getStatusConfig = (status: TranslationStatus): StatusConfig => { @@ -20,8 +21,8 @@ const getStatusConfig = (status: TranslationStatus): StatusConfig => { borderColor: "border-green-200", textColor: "text-green-800", iconColor: "text-green-600", - label: "翻訳済み", - message: "このページは日本語に翻訳済みです。", + label: , + message: , }; case "partially_translated": return { @@ -29,9 +30,8 @@ const getStatusConfig = (status: TranslationStatus): StatusConfig => { borderColor: "border-yellow-200", textColor: "text-yellow-800", iconColor: "text-yellow-600", - label: "部分的に翻訳済み", - message: - "このページは部分的に翻訳されています。一部原文の内容が含まれています。", + label: , + message: , }; case "untranslated": return { @@ -39,9 +39,8 @@ const getStatusConfig = (status: TranslationStatus): StatusConfig => { borderColor: "border-red-200", textColor: "text-red-800", iconColor: "text-red-600", - label: "未翻訳", - message: - "このページはまだ翻訳されていません。原文の内容が表示されています。", + label: , + message: , }; case "community": return { @@ -49,9 +48,8 @@ const getStatusConfig = (status: TranslationStatus): StatusConfig => { borderColor: "border-cyan-200", textColor: "text-cyan-800", iconColor: "text-cyan-600", - label: "日本語版オリジナル", - message: - "このページの内容は公式ドキュメントには含まれておらず、日本語コミュニティが独自に追加したものです。", + label: , + message: , }; } }; diff --git a/website/src/globals.css b/website/src/globals.css index ae85f6936f..f73d927cd5 100644 --- a/website/src/globals.css +++ b/website/src/globals.css @@ -60,7 +60,7 @@ samp { } .info-box::before { - content: "情報"; + content: "💡"; @apply absolute top-0 left-0 bg-cyan-200 text-cyan-800 text-xs font-bold py-1 px-3 rounded-br; } diff --git a/website/src/translation.tsx b/website/src/translation.tsx new file mode 100644 index 0000000000..758d507ead --- /dev/null +++ b/website/src/translation.tsx @@ -0,0 +1,268 @@ +import type { FC } from "hono/jsx"; +import type { TooltipProps } from "./components/ui/Tooltip"; +import { + discordServerUrl, + githubOrganizationUrl, + githubRepositoryUrl, + typstOfficialDocsUrl, + version, +} from "./metadata"; + +/** + * Translation dictionary for UI attributes and aria labels. + * + * @example + * translation.closeMenu() + * translation.showInformation({ name: "foo" }) + */ +export const translation = { + htmlLang: () => "ja", + documentationTitle: () => "Typstドキュメント日本語版", + close: () => "閉じる", + closeMenu: () => "メニューを閉じる", + closeSearch: () => "検索を閉じる", + openMenu: () => "メニューを開く", + openSearch: () => "検索を開く", + showInformation: (props: { name: string }) => `${props.name}の詳細情報を表示`, + tooltipKind: (props: { kind: TooltipProps["kind"] }) => { + switch (props.kind) { + case "element": + return "要素関数"; + case "contextual": + return "コンテキスト関数"; + case "definitions": + return "定義"; + case "parameters": + return "引数"; + case "variadic": + return "可変長引数"; + case "settable": + return "設定可能引数"; + case "positional": + return "位置引数"; + case "required": + return "必須引数"; + default: + return props.kind; + } + }, +} as const; + +type TranslationKey = + | "definition" + | "constructor" + | "tableOfContents" + | "untranslated" + | "untranslatedMessage" + | "document" + | "langVersion" + | "elementFunction" + | "elementFunctionDescription" + | "contextFunction" + | "contextFunctionDescription" + | "definitionTooltip" + | "definitionTooltipDescription" + | "variadic" + | "translationRate" + | "variadicDescription" + | "typstOfficialDocs" + | "typstOfficialWebsite" + | "communityContent" + | "contentAddedByCommunity" + | "partiallyTranslated" + | "partiallyTranslatedMessage" + | "translated" + | "translatedMessage" + | "siteNoticeBannerTitle" + | "siteNoticeBannerDescription" + | "tutorial" + | "tutorialDescription" + | "referenceDescription" + | "reference" + | "openOfficialDocs" + | "search" + | "argument" + | "argumentDescription" + | "required" + | "requiredDescription" + | "positional" + | "positionalDescription" + | "defaultValue" + | "stringValues" + | "showExample" + | "settable" + | "settableDescription" + | "previousPage" + | "nextPage"; + +export type TranslationProps = + | { translationKey: TranslationKey } + | { translationKey: "definitionOf"; name: string }; + +/** + * Translation component for UI text, descriptions, and other content to be embedded as JSX. + * + * @example + * + */ +export const Translation: FC = (props) => { + switch (props.translationKey) { + case "definition": + return <>定義; + case "constructor": + return <>コンストラクタ; + case "definitionOf": + return ( + <> + {props.name}の定義 + + ); + case "search": + return <>検索; + case "defaultValue": + return <>デフォルト値:; + case "stringValues": + return <>使用可能な文字列値:; + case "showExample": + return <>例を表示; + case "tableOfContents": + return <>目次; + case "nextPage": + return <>次のページ; + case "previousPage": + return <>前のページ; + case "referenceDescription": + return ( + <> + Typstのあらゆる構文、概念、型、関数についての詳細なリファレンスです。 + + ); + case "tutorialDescription": + return <>一歩一歩、Typstの使い方を学びましょう。; + case "tutorial": + return <>チュートリアル; + case "openOfficialDocs": + return <>原文(英語)を開く; + case "reference": + return <>リファレンス; + case "typstOfficialDocs": + return <>Typst公式ドキュメント; + case "typstOfficialWebsite": + return <>Typst公式サイト; + case "untranslated": + return <>未翻訳; + case "untranslatedMessage": + return ( + <>このページはまだ翻訳されていません。原文の内容が表示されています。 + ); + case "communityContent": + return <>日本語版オリジナル; + case "contentAddedByCommunity": + return ( + <> + このページの内容は公式ドキュメントには含まれておらず、日本語コミュニティが独自に追加したものです。 + + ); + case "partiallyTranslated": + return <>部分的に翻訳済み; + case "partiallyTranslatedMessage": + return ( + <> + このページは部分的に翻訳されています。一部原文の内容が含まれています。 + + ); + case "translated": + return <>翻訳済み; + case "translatedMessage": + return <>このページは日本語に翻訳済みです。; + case "elementFunction": + return <>要素関数; + case "elementFunctionDescription": + return ( + <> + 要素関数はsetルールやshow + ルールでカスタマイズできます。 + + ); + case "contextFunction": + return <>コンテキスト関数; + case "contextFunctionDescription": + return ( + <>コンテキスト関数は、コンテキストが既知の場合にのみ使用できます。 + ); + case "definitionTooltip": + return <>定義; + case "definitionTooltipDescription": + return ( + <> + これらの関数や型には、関連する定義を持たせることができます。定義にアクセスするには、対象の関数や型の名前を指定した後に、ピリオド区切りで定義名を記述します。 + + ); + case "argument": + return <>引数; + case "argumentDescription": + return ( + <>引数は関数への入力値です。関数名の後に括弧で囲んで指定します。 + ); + case "variadic": + return <>可変長引数; + case "variadicDescription": + return <>可変長引数は複数回指定することができます。; + + case "positional": + return <>位置引数; + case "positionalDescription": + return ( + <>位置引数は順序通りに指定することで、引数名を省略して設定できます。 + ); + case "required": + return <>必須引数; + case "requiredDescription": + return <>必須引数は、関数を呼び出す際に必ず指定しなければなりません。; + case "document": + return <>ドキュメント; + case "langVersion": + return <>日本語版; + case "translationRate": + return <>翻訳率; + case "settable": + return <>設定可能引数; + case "settableDescription": + return ( + <> + 設定可能引数は、set + ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。 + + ); + case "siteNoticeBannerTitle": + return <>情報 / Info; + case "siteNoticeBannerDescription": + return ( + <> + 当サイトは、Typst GmbHの許諾を得て、日本語コミュニティ「 + Typst Japanese Community」が + Typst v{version}の公式ドキュメント + を翻訳したものです。誤訳や古い情報が含まれている可能性があるため、 + 公式ドキュメント + との併用を推奨します。翻訳の改善やサイトの機能向上について、 + GitHub + でのIssueやPull Requestを歓迎します。コミュニティにご興味のある方は + Discordサーバー「くみはんクラブ」 + にぜひご参加ください。 +
    + This site provides a Japanese translation of the{" "} + Typst v{version} documentation{" "} + maintained by the " + Typst Japanese Community" with + permission from Typst GmbH. We recommend using this alongside the{" "} + official documentation. We welcome + contributions through Issues and Pull Requests on{" "} + our GitHub repository for both + translation improvements and website enhancements. Feel free to join{" "} + our Discord server "Kumihan Club". + + ); + default: + return null; + } +};