Skip to content

Commit 0494053

Browse files
authored
docs: translate into Japanese (#118)
* chore: create ja folder and copy files * docs: translate into japanese * docs: translate into japanese * docs: translate for japanese * docs: reflect #78 * docs: reflect #93 * docs: reflect #97 * docs: update use-user.md (#101) * docs: reflect #102 * docs: reflect #116 * docs: fix disabled prop code
1 parent f6ca50b commit 0494053

23 files changed

+1967
-21
lines changed

.vitepress/config.mts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
import { createRequire } from 'node:module';
2-
import path from 'node:path';
3-
import { defineConfig } from 'vitepress';
4-
import footnote from 'markdown-it-footnote';
5-
import { shared } from './shared.mts';
6-
import { en } from './en.mts';
7-
import { ko } from './ko.mts';
1+
import { createRequire } from "node:module";
2+
import path from "node:path";
3+
import { defineConfig } from "vitepress";
4+
import footnote from "markdown-it-footnote";
5+
import { shared } from "./shared.mts";
6+
import { en } from "./en.mts";
7+
import { ko } from "./ko.mts";
8+
import { ja } from "./ja.mts";
89

910
const require = createRequire(import.meta.url);
1011

1112
export default defineConfig({
1213
...shared,
1314
locales: {
14-
en: { label: 'English', ...en },
15-
root: { label: '한국어', ...ko },
15+
en: { label: "English", ...en },
16+
ja: { label: "日本語", ...ja },
17+
root: { label: "한국어", ...ko }
1618
},
1719
vite: {
1820
resolve: {
1921
alias: [
2022
{
2123
find: /^vue$/,
2224
replacement: path.dirname(
23-
require.resolve('vue/package.json', {
24-
paths: [require.resolve('vitepress')],
25+
require.resolve("vue/package.json", {
26+
paths: [require.resolve("vitepress")]
2527
})
26-
),
28+
)
2729
},
2830
{
2931
find: /^vue\/server-renderer$/g,
3032
replacement: path.dirname(
31-
require.resolve('vue/server-renderer', {
32-
paths: [require.resolve('vitepress')],
33+
require.resolve("vue/server-renderer", {
34+
paths: [require.resolve("vitepress")]
3335
})
34-
),
35-
},
36-
],
37-
},
36+
)
37+
}
38+
]
39+
}
3840
},
3941
markdown: {
4042
config: (md) => {
4143
md.use(footnote);
42-
},
43-
},
44-
})
44+
}
45+
}
46+
});

.vitepress/ja.mts

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
import { type DefaultTheme, defineConfig } from "vitepress";
2+
3+
export const ja = defineConfig({
4+
lang: "ja",
5+
title: "Frontend Fundamentals",
6+
description: "変更しやすいフロントエンドコードのためのガイドライン",
7+
lastUpdated: true,
8+
head: [
9+
["link", { rel: "icon", href: "/images/favicon.ico" }],
10+
[
11+
"meta",
12+
{
13+
property: "og:image",
14+
content: "https://static.toss.im/illusts/ff-meta.png"
15+
}
16+
],
17+
[
18+
"meta",
19+
{
20+
name: "twitter:image",
21+
content: "https://static.toss.im/illusts/ff-meta.png"
22+
}
23+
],
24+
[
25+
"meta",
26+
{
27+
name: "twitter:card",
28+
content: "https://static.toss.im/illusts/ff-meta.png"
29+
}
30+
]
31+
],
32+
themeConfig: {
33+
logo: "/images/ff-symbol.svg",
34+
nav: nav(),
35+
36+
editLink: {
37+
pattern: "https://github.com/toss/frontend-fundamentals/edit/main/:path",
38+
text: "GitHubで修正する"
39+
},
40+
41+
outline: {
42+
label: "ページの内容"
43+
},
44+
docFooter: {
45+
prev: "前のページ",
46+
next: "次のページ"
47+
},
48+
lastUpdated: {
49+
text: "最後のアップデート"
50+
},
51+
52+
socialLinks: [
53+
{
54+
icon: "github",
55+
link: "https://github.com/toss/frontend-fundamentals"
56+
}
57+
],
58+
59+
sidebar: sidebar()
60+
}
61+
});
62+
63+
function nav(): DefaultTheme.NavItem[] {
64+
return [{ text: "ホーム", link: "/ja" }];
65+
}
66+
67+
function sidebar(): DefaultTheme.Sidebar {
68+
return [
69+
{
70+
text: "良いコードの基準",
71+
items: [
72+
{
73+
text: "はじめる",
74+
link: "/ja/code/start"
75+
},
76+
{
77+
text: "変更しやすいコード",
78+
link: "/ja/code/"
79+
},
80+
{
81+
text: "コミュニティ",
82+
items: [
83+
{
84+
text: "紹介",
85+
link: "/code/community"
86+
},
87+
{
88+
text: "⭐ 良い討論をまとめて見る",
89+
link: "https://github.com/toss/frontend-fundamentals/discussions?discussions_q=is%3Aopen+label%3A%22성지+⛲%22"
90+
},
91+
{
92+
text: "A vs B",
93+
link: "https://github.com/toss/frontend-fundamentals/discussions/categories/a-vs-b?discussions_q=is%3Aopen+category%3A%22A+vs+B%22+sort%3Adate_created"
94+
},
95+
{
96+
text: "自由におしゃべり",
97+
link: "https://github.com/toss/frontend-fundamentals/discussions/categories/open-forum?discussions_q=is%3Aopen+sort%3Adate_created+category%3A%22Open+Forum%22"
98+
}
99+
],
100+
collapsed: true
101+
}
102+
]
103+
},
104+
{
105+
text: "良いコードを書くための戦略",
106+
items: [
107+
{
108+
text: "1. 可読性",
109+
items: [
110+
{
111+
text: "コンテキストを減らす",
112+
items: [
113+
{
114+
text: "A. 一緒に実行されないコードを分離する",
115+
link: "/ja/code/examples/submit-button"
116+
},
117+
{
118+
text: "B. 実装の詳細を抽象化する",
119+
link: "/ja/code/examples/login-start-page"
120+
},
121+
{
122+
text: "C. ロジックの種類に応じて一体化している関数を分ける",
123+
link: "/ja/code/examples/use-page-state-readability"
124+
}
125+
],
126+
collapsed: true
127+
},
128+
{
129+
text: "名前付け",
130+
items: [
131+
{
132+
text: "A. 複雑な条件に名前を付ける",
133+
link: "/ja/code/examples/condition-name"
134+
},
135+
{
136+
text: "B. マジックナンバーに名前を付ける",
137+
link: "/ja/code/examples/magic-number-readability"
138+
}
139+
],
140+
collapsed: true
141+
},
142+
{
143+
text: "上から下へ読めるようにする",
144+
items: [
145+
{
146+
text: "A. 視点の移動を減らす",
147+
link: "/ja/code/examples/user-policy"
148+
},
149+
{
150+
text: "B. 三項演算子をシンプルにする",
151+
link: "/ja/code/examples/ternary-operator"
152+
}
153+
],
154+
collapsed: true
155+
}
156+
]
157+
},
158+
159+
{
160+
text: "2. 予測可能性",
161+
items: [
162+
{
163+
text: "A. 名前が被らないように管理する",
164+
link: "/ja/code/examples/http"
165+
},
166+
{
167+
text: "B. 同じ種類の関数は返り値の型を統一する",
168+
link: "/ja/code/examples/use-user"
169+
},
170+
{
171+
text: "C. 隠れたロジックを露呈させる",
172+
link: "/ja/code/examples/hidden-logic"
173+
}
174+
]
175+
},
176+
{
177+
text: "3. 凝集度",
178+
items: [
179+
{
180+
text: "A. 緒に修正されるファイルは同じディレクトリに置く",
181+
link: "/ja/code/examples/code-directory"
182+
},
183+
{
184+
text: "B. マジックナンバーを排除する",
185+
link: "/ja/code/examples/magic-number-cohesion"
186+
},
187+
{
188+
text: "C. フォームの凝集度について考える",
189+
link: "/ja/code/examples/form-fields"
190+
}
191+
]
192+
},
193+
{
194+
text: "4. 結合度",
195+
items: [
196+
{
197+
text: "A. 責任を一つずつ管理する",
198+
link: "/ja/code/examples/use-page-state-coupling"
199+
},
200+
{
201+
text: "B. 重複コードを許容する",
202+
link: "/ja/code/examples/use-bottom-sheet"
203+
},
204+
{
205+
text: "C. Props Drilling を解消する",
206+
link: "/ja/code/examples/item-edit-modal"
207+
}
208+
]
209+
}
210+
]
211+
}
212+
];
213+
}
214+
215+
export const search: DefaultTheme.LocalSearchOptions["locales"] = {
216+
root: {
217+
translations: {
218+
button: {
219+
buttonText: "検索",
220+
buttonAriaLabel: "検索"
221+
},
222+
modal: {
223+
backButtonTitle: "戻る",
224+
displayDetails: "もっとみる",
225+
footer: {
226+
closeKeyAriaLabel: "閉じる",
227+
closeText: "閉じる",
228+
navigateDownKeyAriaLabel: "下へ",
229+
navigateText: "移動",
230+
navigateUpKeyAriaLabel: "上へ",
231+
selectKeyAriaLabel: "選択",
232+
selectText: "選択"
233+
},
234+
noResultsText: "検索結果がありませんでした。",
235+
resetButtonTitle: "すべて消去"
236+
}
237+
}
238+
}
239+
};

ja/code/community.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
comments: false
3+
---
4+
5+
# コミュニティ
6+
7+
`Frontend Fundamentals`(FF)は、コミュニティと共に良いコードの基準を作り上げています。
8+
9+
現在はTossのフロントエンドチャプターが運営をしています。
10+
11+
## 良い議論をまとめて見る
12+
13+
コミュニティで行われた良い議論を見てみましょう。Frontend Fundamentalsのドキュメントに掲載されている内容を超えて、良いコードについての考えを広げることができます。
14+
15+
- [良い議論をまとめて見る](https://github.com/toss/frontend-fundamentals/discussions?discussions_q=is%3Aopen+label%3A%22성지+⛲%22)
16+
17+
## 悩んでいるコードについて議論する
18+
19+
悩んでいるコードがある場合は、GitHubディスカッションに投稿してみましょう。自分のコードについてコミュニティから様々なレビューを受けることができ、良いコードの基準についてコミュニティと共に考えることができます。また、多くの共感を得た事例は、直接Frontend Fundamentalsの文書に投稿することができます。貢献方法は後日公開される予定です。
20+
21+
- [Githubディスカッションに投稿する](https://github.com/toss/frontend-fundamentals/discussions)
22+
23+
## 良いコードの基準に意見を追加する
24+
25+
良いコードの基準について意見がある場合や、新しい意見を追加したい場合は、どのコードがより良いか投票し、意見を残してください。コミュニティと交流しながら、より豊かで深い基準を作り上げていきましょう。
26+
27+
このコードは良いのか?あのコードは良いのか?ということについて、自分自身の基準を確立するきっかけになるかもしれません。
28+
29+
- [A vs Bに投稿されたコードを見る](https://github.com/toss/frontend-fundamentals/discussions/categories/a-vs-b)

0 commit comments

Comments
 (0)