Skip to content

Commit 68b5cb6

Browse files
yoshi2nodrwpow
andauthored
feat: Japanese translation for docs (openapi-ts#1855)
* docs(ja): openapi-typescript, about * docs(ja): openapi-typescript, advanced * docs(ja): openapi-typescript, cli * docs(ja): openapi-typescript, examples * docs(ja): openapi-typescript, index * docs: fix invalid url * docs(ja): openapi-typescript, introduction * docs(ja): openapi-typescript, migration-guide * docs(ja): openapi-typescript, node * docs(ja): openapi-fetch, about * docs(ja): openapi-fetch, api * docs(ja): openapi-fetch, examples * docs(ja): openapi-fetch, index * docs(ja): openapi-fetch, middleware-auth * docs(ja): openapi-fetch, testing * docs(ja): openapi-react-query, about * docs(ja): openapi-react-query, index * docs(ja): openapi-react-query, use-mutation * docs(ja): openapi-react-query, use-query * docs(ja): openapi-react-query, use-suspense-query * feat: add vitepress `ja` config * docs(ja): update content, fix typo and links * docs(en, zh): fix link * Deploy to Cloudflare --------- Co-authored-by: Drew Powers <[email protected]>
1 parent 754b31a commit 68b5cb6

29 files changed

+2981
-9
lines changed

docs/.vitepress/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from "vitepress";
22
import en from "./en";
33
import zh from "./zh";
4+
import ja from "./ja";
45
import shared from "./shared";
56

67
// https://vitepress.dev/reference/site-config
@@ -9,5 +10,6 @@ export default defineConfig({
910
locales: {
1011
root: { label: "English", ...en },
1112
zh: { label: "简体中文", ...zh },
13+
ja: { label: "日本語", ...ja },
1214
},
1315
});

docs/.vitepress/ja.ts

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
import { defineConfig, type DefaultTheme } from "vitepress";
2+
3+
export default defineConfig({
4+
lang: "ja",
5+
description: "OpenAPI 3.0および3.1のスキーマをTypeScriptで使用する方法。",
6+
themeConfig: {
7+
nav: [
8+
{
9+
text: "バージョン",
10+
items: [
11+
{ text: "7.x", link: "/ja/introduction" },
12+
{ text: "6.x", link: "/6.x/introduction" },
13+
],
14+
},
15+
],
16+
sidebar: {
17+
"/ja/": [
18+
{
19+
text: "openapi-typescript (7.x)",
20+
items: [
21+
{ text: "イントロダクション", link: "/ja/introduction" },
22+
{ text: "CLI", link: "/ja/cli" },
23+
{ text: "Node.js API", link: "/ja/node" },
24+
{ text: "使用例", link: "/ja/examples" },
25+
{ text: "6.xからのマイグレーション", link: "/ja/migration-guide" },
26+
{ text: "高度な機能", link: "/ja/advanced" },
27+
{ text: "概要", link: "/ja/about" },
28+
],
29+
},
30+
{
31+
text: "openapi-fetch",
32+
items: [
33+
{ text: "始める", link: "/ja/openapi-fetch/" },
34+
{
35+
text: "ミドルウェア & 認証",
36+
link: "/ja/openapi-fetch/middleware-auth",
37+
},
38+
{ text: "テスト", link: "/ja/openapi-fetch/testing" },
39+
{ text: "使用例", link: "/ja/openapi-fetch/examples" },
40+
{ text: "API", link: "/ja/openapi-fetch/api" },
41+
{ text: "概要", link: "/ja/openapi-fetch/about" },
42+
],
43+
},
44+
{
45+
text: "openapi-react-query",
46+
items: [
47+
{ text: "始める", link: "/ja/openapi-react-query/" },
48+
{ text: "useQuery", link: "/ja/openapi-react-query/use-query" },
49+
{ text: "useMutation", link: "/ja/openapi-react-query/use-mutation" },
50+
{ text: "useSuspenseQuery", link: "/ja/openapi-react-query/use-suspense-query" },
51+
{ text: "概要", link: "/ja/openapi-react-query/about" },
52+
],
53+
},
54+
],
55+
},
56+
57+
docFooter: {
58+
prev: "前のページ",
59+
next: "次のページ",
60+
},
61+
outline: {
62+
label: "目次",
63+
},
64+
sidebarMenuLabel: "メニュー",
65+
returnToTopLabel: "最上部に戻る",
66+
footer: {
67+
message:
68+
'<a href="https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE">MITライセンス</a> に基づいて配布されています。',
69+
},
70+
},
71+
});
72+
73+
export const jaSearch: DefaultTheme.AlgoliaSearchOptions["locales"] = {
74+
ja: {
75+
placeholder: "ドキュメントを検索",
76+
translations: {
77+
button: {
78+
buttonText: "検索",
79+
buttonAriaLabel: "検索",
80+
},
81+
modal: {
82+
searchBox: {
83+
resetButtonTitle: "クエリをクリア",
84+
resetButtonAriaLabel: "クエリをクリア",
85+
cancelButtonText: "キャンセル",
86+
cancelButtonAriaLabel: "キャンセル",
87+
},
88+
startScreen: {
89+
recentSearchesTitle: "最近の検索",
90+
noRecentSearchesText: "最近の検索履歴はありません",
91+
saveRecentSearchButtonTitle: "最近の検索に保存",
92+
removeRecentSearchButtonTitle: "最近の検索から削除",
93+
favoriteSearchesTitle: "お気に入り",
94+
removeFavoriteSearchButtonTitle: "お気に入りから削除",
95+
},
96+
errorScreen: {
97+
titleText: "結果を取得できません",
98+
helpText: "ネットワーク接続を確認してください",
99+
},
100+
footer: {
101+
selectText: "選択",
102+
navigateText: "移動",
103+
closeText: "閉じる",
104+
},
105+
noResultsScreen: {
106+
noResultsText: "関連する結果が見つかりません",
107+
suggestedQueryText: "別のクエリを試してみてください",
108+
reportMissingResultsText: "このクエリに結果があるべきだと思いますか?",
109+
reportMissingResultsLinkText: "フィードバックを送信",
110+
},
111+
},
112+
},
113+
},
114+
};

docs/.vitepress/shared.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { UserConfig } from "vitepress";
22
import { zhSearch } from "./zh";
3+
import { jaSearch } from "./ja";
34

45
const HOSTNAME = "https://openapi-ts.dev";
56

@@ -31,7 +32,7 @@ const shared: UserConfig = {
3132
appId: "NA92XVKBVS",
3233
apiKey: "4f3ce9ca7edc3b83c209e6656ab29eb8",
3334
indexName: "openapi-ts",
34-
locales: { ...zhSearch },
35+
locales: { ...zhSearch, ...jaSearch },
3536
},
3637
},
3738
socialLinks: [

docs/data/contributors.json

+1-1
Large diffs are not rendered by default.

docs/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Quickstart
77

88
openapi-typescript turns [OpenAPI 3.0 & 3.1](https://spec.openapis.org/oas/latest.html) schemas into TypeScript quickly using Node.js. No Java/node-gyp/running OpenAPI servers necessary.
99

10-
The code is [MIT-licensed](https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE") and free for use.
10+
The code is [MIT-licensed](https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE) and free for use.
1111

1212
::: tip
1313

docs/ja/about.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: openapi-typescriptについて
3+
description: このプロジェクトに関する追加情報
4+
---
5+
6+
<script setup>
7+
import { VPTeamMembers } from 'vitepress/theme';
8+
import contributors from '../data/contributors.json';
9+
</script>
10+
11+
# openapi-typescriptについて
12+
13+
## 利用者
14+
15+
- [**Bigcommerce**](https://github.com/bigcommerce/bigcommerce-api-node): BigCommerce API 用の Node SDK
16+
- [**Budibase**](https://github.com/Budibase/budibase): 内部ツール、ワークフロー、および管理ダッシュボードを作成するためのローコードプラットフォーム
17+
- [**Fedora `fmn`**](https://github.com/fedora-infra/fmn): Fedora メッセージインフラストラクチャのツールと API
18+
- [**Fingerprint**](https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk): 大規模なアプリケーション向けのデバイスフィンガープリンティング
19+
- [**Google Firebase CLI**](https://github.com/firebase/firebase-tools): Google Firebase プラットフォーム用の公式 CLI
20+
- [**GitHub Octokit**](https://github.com/octokit): GitHub API の公式 SDK
21+
- [**Lotus**](https://github.com/uselotus/lotus): オープンソースの価格設定およびパッケージングインフラストラクチャ
22+
- [**Jitsu**](https://github.com/jitsucom/jitsu): モダンでオープンソースのデータ収集/データパイプライン
23+
- [**Medusa**](https://github.com/medusajs/medusa): デジタルコマースの構築ブロック
24+
- [**Netlify**](https://netlify.com): モダンな開発プラットフォーム
25+
- [**Nuxt**](https://github.com/unjs/nitro): 直感的な Vue フレームワーク
26+
- [**Relevance AI**](https://github.com/RelevanceAI/relevance-js-sdk): AI チェーンの構築と展開
27+
- [**Revolt**](https://github.com/revoltchat/api): オープンソースのユーザー優先チャットプラットフォーム
28+
- [**Spacebar**](https://github.com/spacebarchat): 無料でオープンソースの自ホスト可能な Discord 互換のチャット/音声/ビデオプラットフォーム
29+
- [**Supabase**](https://github.com/supabase/supabase): オープンソースの Firebase 代替
30+
- [**Twitter API**](https://github.com/twitterdev/twitter-api-typescript-sdk): Twitter API の公式 SDK
31+
32+
## プロジェクトの目標
33+
34+
1. 任意の有効な OpenAPI スキーマを TypeScript 型に変換できるようにすること。どんなに複雑なスキーマでも対応可能です。
35+
2. 生成される型は静的に解析可能で、実行時の依存関係がない(ただし、[enums](https://www.typescriptlang.org/docs/handbook/enums.html) のような例外はあります)。
36+
3. 生成された型は、元のスキーマにできるだけ一致し、元の大文字形式などを保持します。
37+
4. 型の生成 は Node.js だけで実行可能であり、(Java、Python などは不要)どんな環境でも実行できます。
38+
5. ファイルからの OpenAPI スキーマのフェッチや、ローカルおよびリモートサーバーからのフェッチをサポートします。
39+
40+
## 比較
41+
42+
### vs. swagger-codegen
43+
44+
openapi-typescript は、swagger-codegen の軽量で使いやすい代替手段として作成されており、Java ランタイムや OpenAPI サーバーを実行する必要はありません。また、大規模なクライアントサイドコードも生成しません。実際、openapi-typescript が生成するすべてのコードは、**実行時の依存関係がない静的型** であり、最大のパフォーマンスと最小のクライアント負荷を実現します。
45+
46+
### vs. openapi-typescript-codegen
47+
48+
openapi-typescript-codegen は、元の swagger-codegen の Node.js 代替手段ですが、実際には同じものです。openapi-typescript は、openapi-typescript-codegen と同様に、**実行時の依存関係がない** という利点を持っていますが、openapi-typescript-codegen は、スキーマの複雑さに応じて `250 kB` 以上になるかなり大きなバンドルを生成する可能性があります。
49+
50+
### vs. tRPC
51+
52+
[tRPC](https://trpc.io/) は、強い設計方針を持ったサーバーとクライアントの両方で型の安全性を提供するフレームワークです。これは、サーバーとクライアントの両方が tRPC で記述されていることを要求します(つまり、バックエンドが Node.js を使用しています)。
53+
54+
このユースケースに合っているならば、素晴らしい体験ができるでしょう!しかし、他のすべての場合において、openapi-typescript(および openapi-fetch)は、あらゆる技術選択に適応できる、より柔軟で低レベルなソリューションです(コストなしで段階的に導入することさえできます)。
55+
56+
## 貢献者
57+
58+
これらの素晴らしい貢献者がいなければ、このライブラリは存在しなかったでしょう:
59+
60+
<VPTeamMembers size="small" :members="contributors['openapi-typescript']" />

0 commit comments

Comments
 (0)