Skip to content

Commit d97c593

Browse files
syugkoba04
authored andcommitted
Translate File Structure (#120)
* Reflected Crowdin translation as a basis https://crowdin.com/translate/react/3000/en-ja * Translated the rest of file structure * Tweaked several translations * Replaced "" * Reflected FBs
1 parent 558bc13 commit d97c593

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

content/docs/faq-structure.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
id: faq-structure
3-
title: File Structure
3+
title: ファイル構成
44
permalink: docs/faq-structure.html
55
layout: docs
66
category: FAQ
77
---
88

9-
### Is there a recommended way to structure React projects? {#is-there-a-recommended-way-to-structure-react-projects}
9+
### お勧めの React プロジェクトの構成は? {#is-there-a-recommended-way-to-structure-react-projects}
1010

11-
React doesn't have opinions on how you put files into folders. That said there are a few common approaches popular in the ecosystem you may want to consider.
11+
React はファイルをどのようにフォルダ分けするかについての意見を持っていません。とはいえ、あなたが検討したいかもしれないエコシステム内でよく用いられる共通の方法があります。
1212

13-
#### Grouping by features or routes {#grouping-by-features-or-routes}
13+
#### 機能ないしルート別にグループ化する {#grouping-by-features-or-routes}
1414

15-
One common way to structure projects is locate CSS, JS, and tests together inside folders grouped by feature or route.
15+
プロジェクトを構成する一般的な方法の 1 つは、CSS や JS やテストをまとめて機能ないしルート別のフォルダにグループ化するというものです。
1616

1717
```
1818
common/
@@ -35,11 +35,11 @@ profile/
3535
ProfileAPI.js
3636
```
3737

38-
The definition of a "feature" is not universal, and it is up to you to choose the granularity. If you can't come up with a list of top-level folders, you can ask the users of your product what major parts it consists of, and use their mental model as a blueprint.
38+
ここでの「機能」の定義は普遍的なものではないので、粒度の選択はあなた次第です。トップレベルのフォルダの名前が思いつかない場合は、ユーザに「この製品の主な構成部品は何か」と聞いてみて、ユーザの思考モデルを青写真として使いましょう。
3939

40-
#### Grouping by file type {#grouping-by-file-type}
40+
#### ファイルタイプ別にグループ化する {#grouping-by-file-type}
4141

42-
Another popular way to structure projects is to group similar files together, for example:
42+
プロジェクトを構築する別の人気の方法は、例えば以下のようにして類似ファイルをグループ分けするというものです。
4343

4444
```
4545
api/
@@ -59,16 +59,16 @@ components/
5959
ProfileHeader.css
6060
```
6161

62-
Some people also prefer to go further, and separate components into different folders depending on their role in the application. For example, [Atomic Design](http://bradfrost.com/blog/post/atomic-web-design/) is a design methodology built on this principle. Remember that it's often more productive to treat such methodologies as helpful examples rather than strict rules to follow.
62+
人によってはこの方法をさらに推し進め、コンポーネントをアプリケーション内の役割に応じてフォルダ分けすることを好みます。例として、[Atomic Design](http://bradfrost.com/blog/post/atomic-web-design/) はこのような原則の下に作られたデザインの方法論です。ただこのような方法論は、従わなければならない厳格なルールとして扱うよりも、役に立つ見本として扱う方が多くの場合生産的であるということを忘れないでください。
6363

64-
#### Avoid too much nesting {#avoid-too-much-nesting}
64+
#### ネストのしすぎを避ける {#avoid-too-much-nesting}
6565

66-
There are many pain points associated with deep directory nesting in JavaScript projects. It becomes harder to write relative imports between them, or to update those imports when the files are moved. Unless you have a very compelling reason to use a deep folder structure, consider limiting yourself to a maximum of three or four nested folders within a single project. Of course, this is only a recommendation, and it may not be relevant to your project.
66+
深くネストされた JavaScript プロジェクトには様々な痛みを伴います。相対パスを使ったインポートが面倒になりますし、ファイルが移動したときにそれらを更新するのも大変です。よほど強い理由があって深いファルダ構造を使う場合を除き、1 つのプロジェクト内では 3 段か 4 段程度のフォルダ階層に留めることを考慮してください。もちろんこれはお勧めにすぎず、あなたのプロジェクトには当てはまらないかもしれません。
6767

68-
#### Don't overthink it {#dont-overthink-it}
68+
#### 考えすぎない {#dont-overthink-it}
6969

70-
If you're just starting a project, [don't spend more than five minutes](https://en.wikipedia.org/wiki/Analysis_paralysis) on choosing a file structure. Pick any of the above approaches (or come up with your own) and start writing code! You'll likely want to rethink it anyway after you've written some real code.
70+
まだプロジェクトを始めたばかりなら、ファイル構成を決めるのに [5 分以上かけない](https://en.wikipedia.org/wiki/Analysis_paralysis)ようにしましょう。上述の方法の 1 つを選ぶか、自分自身の方法を考えて、コードを書き始めましょう! おそらく実際のコードをいくらか書けば、なんにせよ考え直したくなる可能性が高いでしょう。
7171

72-
If you feel completely stuck, start by keeping all files in a single folder. Eventually it will grow large enough that you will want to separate some files from the rest. By that time you'll have enough knowledge to tell which files you edit together most often. In general, it is a good idea to keep files that often change together close to each other. This principle is called "colocation".
72+
もしも完全に詰まった場合は、すべて 1 フォルダに入れるところから始めましょう。そのうち十分に数が増えれば、いくつかのファイルを分離したくなってくるでしょう。そのころには、どのファイルを一緒に編集している頻度が高いのか、十分わかるようになっているでしょう。一般的には、よく一緒に変更するファイルを近くに置いておくのは良いアイディアです。この原則は、「コロケーション」と呼ばれます。
7373

74-
As projects grow larger, they often use a mix of both of the above approaches in practice. So choosing the "right" one in the beginning isn't very important.
74+
プロジェクトが大きくなるにつれ、実際にはしばしば上記両方の方法が組み合わされて使用されます。ですので、「正しい」方法を最初から選択することはさほど重要ではありません。

0 commit comments

Comments
 (0)