Skip to content

feat: Japanese translation for docs #1855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4ce4aeb
docs(ja): openapi-typescript, about
yoshi2no Aug 13, 2024
24532b7
docs(ja): openapi-typescript, advanced
yoshi2no Aug 14, 2024
013c9d4
docs(ja): openapi-typescript, cli
yoshi2no Aug 14, 2024
fbcaec3
docs(ja): openapi-typescript, examples
yoshi2no Aug 14, 2024
18fd6a3
docs(ja): openapi-typescript, index
yoshi2no Aug 14, 2024
97dc083
docs: fix invalid url
yoshi2no Aug 14, 2024
6bc7c69
docs(ja): openapi-typescript, introduction
yoshi2no Aug 14, 2024
8a8626e
docs(ja): openapi-typescript, migration-guide
yoshi2no Aug 14, 2024
36245c6
docs(ja): openapi-typescript, node
yoshi2no Aug 14, 2024
c84b3f2
docs(ja): openapi-fetch, about
yoshi2no Aug 14, 2024
e16bfb2
docs(ja): openapi-fetch, api
yoshi2no Aug 15, 2024
80a5bce
docs(ja): openapi-fetch, examples
yoshi2no Aug 15, 2024
ca4a6c9
docs(ja): openapi-fetch, index
yoshi2no Aug 15, 2024
922ddf2
docs(ja): openapi-fetch, middleware-auth
yoshi2no Aug 15, 2024
f7761bf
docs(ja): openapi-fetch, testing
yoshi2no Aug 15, 2024
dd19bb0
docs(ja): openapi-react-query, about
yoshi2no Aug 15, 2024
c41d318
docs(ja): openapi-react-query, index
yoshi2no Aug 15, 2024
097e944
docs(ja): openapi-react-query, use-mutation
yoshi2no Aug 15, 2024
46d825d
docs(ja): openapi-react-query, use-query
yoshi2no Aug 15, 2024
ba8fbde
docs(ja): openapi-react-query, use-suspense-query
yoshi2no Aug 15, 2024
11ed757
feat: add vitepress `ja` config
yoshi2no Aug 15, 2024
e638141
Merge branch 'main' into feature/docs-ja/yoshi2no
yoshi2no Aug 16, 2024
01421c2
docs(ja): update content, fix typo and links
yoshi2no Aug 16, 2024
f42bea9
docs(en, zh): fix link
yoshi2no Aug 16, 2024
e2e888a
Deploy to Cloudflare
drwpow Aug 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vitepress";
import en from "./en";
import zh from "./zh";
import ja from "./ja";
import shared from "./shared";

// https://vitepress.dev/reference/site-config
Expand All @@ -9,5 +10,6 @@ export default defineConfig({
locales: {
root: { label: "English", ...en },
zh: { label: "简体中文", ...zh },
ja: { label: "日本語", ...ja },
},
});
114 changes: 114 additions & 0 deletions docs/.vitepress/ja.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import { defineConfig, type DefaultTheme } from "vitepress";

export default defineConfig({
lang: "ja",
description: "OpenAPI 3.0および3.1のスキーマをTypeScriptで使用する方法。",
themeConfig: {
nav: [
{
text: "バージョン",
items: [
{ text: "7.x", link: "/ja/introduction" },
{ text: "6.x", link: "/6.x/introduction" },
],
},
],
sidebar: {
"/ja/": [
{
text: "openapi-typescript (7.x)",
items: [
{ text: "イントロダクション", link: "/ja/introduction" },
{ text: "CLI", link: "/ja/cli" },
{ text: "Node.js API", link: "/ja/node" },
{ text: "使用例", link: "/ja/examples" },
{ text: "6.xからのマイグレーション", link: "/ja/migration-guide" },
{ text: "高度な機能", link: "/ja/advanced" },
{ text: "概要", link: "/ja/about" },
],
},
{
text: "openapi-fetch",
items: [
{ text: "始める", link: "/ja/openapi-fetch/" },
{
text: "ミドルウェア & 認証",
link: "/ja/openapi-fetch/middleware-auth",
},
{ text: "テスト", link: "/ja/openapi-fetch/testing" },
{ text: "使用例", link: "/ja/openapi-fetch/examples" },
{ text: "API", link: "/ja/openapi-fetch/api" },
{ text: "概要", link: "/ja/openapi-fetch/about" },
],
},
{
text: "openapi-react-query",
items: [
{ text: "始める", link: "/ja/openapi-react-query/" },
{ text: "useQuery", link: "/ja/openapi-react-query/use-query" },
{ text: "useMutation", link: "/ja/openapi-react-query/use-mutation" },
{ text: "useSuspenseQuery", link: "/ja/openapi-react-query/use-suspense-query" },
{ text: "概要", link: "/ja/openapi-react-query/about" },
],
},
],
},

docFooter: {
prev: "前のページ",
next: "次のページ",
},
outline: {
label: "目次",
},
sidebarMenuLabel: "メニュー",
returnToTopLabel: "最上部に戻る",
footer: {
message:
'<a href="https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE">MITライセンス</a> に基づいて配布されています。',
},
},
});

export const jaSearch: DefaultTheme.AlgoliaSearchOptions["locales"] = {
ja: {
placeholder: "ドキュメントを検索",
translations: {
button: {
buttonText: "検索",
buttonAriaLabel: "検索",
},
modal: {
searchBox: {
resetButtonTitle: "クエリをクリア",
resetButtonAriaLabel: "クエリをクリア",
cancelButtonText: "キャンセル",
cancelButtonAriaLabel: "キャンセル",
},
startScreen: {
recentSearchesTitle: "最近の検索",
noRecentSearchesText: "最近の検索履歴はありません",
saveRecentSearchButtonTitle: "最近の検索に保存",
removeRecentSearchButtonTitle: "最近の検索から削除",
favoriteSearchesTitle: "お気に入り",
removeFavoriteSearchButtonTitle: "お気に入りから削除",
},
errorScreen: {
titleText: "結果を取得できません",
helpText: "ネットワーク接続を確認してください",
},
footer: {
selectText: "選択",
navigateText: "移動",
closeText: "閉じる",
},
noResultsScreen: {
noResultsText: "関連する結果が見つかりません",
suggestedQueryText: "別のクエリを試してみてください",
reportMissingResultsText: "このクエリに結果があるべきだと思いますか?",
reportMissingResultsLinkText: "フィードバックを送信",
},
},
},
},
};
3 changes: 2 additions & 1 deletion docs/.vitepress/shared.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { UserConfig } from "vitepress";
import { zhSearch } from "./zh";
import { jaSearch } from "./ja";

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

Expand Down Expand Up @@ -31,7 +32,7 @@ const shared: UserConfig = {
appId: "NA92XVKBVS",
apiKey: "4f3ce9ca7edc3b83c209e6656ab29eb8",
indexName: "openapi-ts",
locales: { ...zhSearch },
locales: { ...zhSearch, ...jaSearch },
},
},
socialLinks: [
Expand Down
2 changes: 1 addition & 1 deletion docs/data/contributors.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Quickstart

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.

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

@yoshi2no yoshi2no Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix for the invalid link mentioned in the Changes same for zh doc.


::: tip

Expand Down
60 changes: 60 additions & 0 deletions docs/ja/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: openapi-typescriptについて
description: このプロジェクトに関する追加情報
---

<script setup>
import { VPTeamMembers } from 'vitepress/theme';
import contributors from '../data/contributors.json';
</script>

# openapi-typescriptについて

## 利用者

- [**Bigcommerce**](https://github.com/bigcommerce/bigcommerce-api-node): BigCommerce API 用の Node SDK
- [**Budibase**](https://github.com/Budibase/budibase): 内部ツール、ワークフロー、および管理ダッシュボードを作成するためのローコードプラットフォーム
- [**Fedora `fmn`**](https://github.com/fedora-infra/fmn): Fedora メッセージインフラストラクチャのツールと API
- [**Fingerprint**](https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk): 大規模なアプリケーション向けのデバイスフィンガープリンティング
- [**Google Firebase CLI**](https://github.com/firebase/firebase-tools): Google Firebase プラットフォーム用の公式 CLI
- [**GitHub Octokit**](https://github.com/octokit): GitHub API の公式 SDK
- [**Lotus**](https://github.com/uselotus/lotus): オープンソースの価格設定およびパッケージングインフラストラクチャ
- [**Jitsu**](https://github.com/jitsucom/jitsu): モダンでオープンソースのデータ収集/データパイプライン
- [**Medusa**](https://github.com/medusajs/medusa): デジタルコマースの構築ブロック
- [**Netlify**](https://netlify.com): モダンな開発プラットフォーム
- [**Nuxt**](https://github.com/unjs/nitro): 直感的な Vue フレームワーク
- [**Relevance AI**](https://github.com/RelevanceAI/relevance-js-sdk): AI チェーンの構築と展開
- [**Revolt**](https://github.com/revoltchat/api): オープンソースのユーザー優先チャットプラットフォーム
- [**Spacebar**](https://github.com/spacebarchat): 無料でオープンソースの自ホスト可能な Discord 互換のチャット/音声/ビデオプラットフォーム
- [**Supabase**](https://github.com/supabase/supabase): オープンソースの Firebase 代替
- [**Twitter API**](https://github.com/twitterdev/twitter-api-typescript-sdk): Twitter API の公式 SDK

## プロジェクトの目標

1. 任意の有効な OpenAPI スキーマを TypeScript 型に変換できるようにすること。どんなに複雑なスキーマでも対応可能です。
2. 生成される型は静的に解析可能で、実行時の依存関係がない(ただし、[enums](https://www.typescriptlang.org/docs/handbook/enums.html) のような例外はあります)。
3. 生成された型は、元のスキーマにできるだけ一致し、元の大文字形式などを保持します。
4. 型の生成 は Node.js だけで実行可能であり、(Java、Python などは不要)どんな環境でも実行できます。
5. ファイルからの OpenAPI スキーマのフェッチや、ローカルおよびリモートサーバーからのフェッチをサポートします。

## 比較

### vs. swagger-codegen

openapi-typescript は、swagger-codegen の軽量で使いやすい代替手段として作成されており、Java ランタイムや OpenAPI サーバーを実行する必要はありません。また、大規模なクライアントサイドコードも生成しません。実際、openapi-typescript が生成するすべてのコードは、**実行時の依存関係がない静的型** であり、最大のパフォーマンスと最小のクライアント負荷を実現します。

### vs. openapi-typescript-codegen

openapi-typescript-codegen は、元の swagger-codegen の Node.js 代替手段ですが、実際には同じものです。openapi-typescript は、openapi-typescript-codegen と同様に、**実行時の依存関係がない** という利点を持っていますが、openapi-typescript-codegen は、スキーマの複雑さに応じて `250 kB` 以上になるかなり大きなバンドルを生成する可能性があります。

### vs. tRPC

[tRPC](https://trpc.io/) は、強い設計方針を持ったサーバーとクライアントの両方で型の安全性を提供するフレームワークです。これは、サーバーとクライアントの両方が tRPC で記述されていることを要求します(つまり、バックエンドが Node.js を使用しています)。

このユースケースに合っているならば、素晴らしい体験ができるでしょう!しかし、他のすべての場合において、openapi-typescript(および openapi-fetch)は、あらゆる技術選択に適応できる、より柔軟で低レベルなソリューションです(コストなしで段階的に導入することさえできます)。

## 貢献者

これらの素晴らしい貢献者がいなければ、このライブラリは存在しなかったでしょう:

<VPTeamMembers size="small" :members="contributors['openapi-typescript']" />
Loading