-
Notifications
You must be signed in to change notification settings - Fork 1k
Make "Getting Started" translatable and add its Japanese translation #1452
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
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
81b316e
Add Japanese translation of Getting Started.
eade469
Update link to ja/getting-started
988a18f
Move "Getting Started" and sub pages into collection, so that it site…
ef65c44
Apply suggestions from code review
f8ec865
Add more Japanese translation of redesigned index of Overviews
65244b6
Merge remote-tracking branch 'origin/ja/getting-started' into ja/gett…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...getting-started-with-scala-in-intellij.md → ...getting-started-with-scala-in-intellij.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...sting-scala-in-intellij-with-scalatest.md → ...sting-scala-in-intellij-with-scalatest.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...with-scala-and-sbt-on-the-command-line.md → ...with-scala-and-sbt-on-the-command-line.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ing-scala-with-sbt-on-the-command-line.md → ...ing-scala-with-sbt-on-the-command-line.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
layout: singlepage-overview | ||
title: 入門 | ||
partof: getting-started | ||
language: ja | ||
includeTOC: true | ||
--- | ||
|
||
<div style="font-size: 1.25rem; color: #073642; font-weight: 400; font-family: 'Roboto Slab', serif; margin-bottom: 18px;"> Scala の取り組み方で人々に好まれている主な方法は <strong>2つ</strong> あります。</div> | ||
|
||
1. IDE を使う | ||
2. コマンドラインを使う | ||
|
||
以下のチュートリアルでは、どちらかお好みの方法をセットアップする一連のプロセスを通して行っていきます。 | ||
|
||
ですが、もし何もインストールせずに直接 Scala に飛び込んでみたければ、このページのガイドは飛ばして、以下をチェックしてみましょう。 | ||
|
||
* [scala-exercises.com での Scala のインタラクティブな導入](https://www.scala-exercises.org/scala_tutorial/terms_and_types) | ||
* [Scastie](https://scastie.scala-lang.org/)。ブラウザで動く Scalaで、すべての Scala コンパイラと公開されたライブラリにアクセス可能。 | ||
|
||
## セットアップして Scala に入門 | ||
exoego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### IDE で取り組むのをお好みの場合 | ||
exoego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Intellij は、Scala 開発者にもっともよく使われている IDE です。 | ||
このチュートリアルでは、Intellij をダウンロードして Scala プラグインをセットアップするまでを通して行い、それから初めての Scala プロジェクトを開始して、ユニットテストを完了させます! | ||
|
||
* [Intellij で Scala を始める](/ja/getting-started/intellij-track/getting-started-with-scala-in-intellij.html) | ||
* [Intellij で sbt を使って Scala プロジェクトをビルドする](/ja/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.html) | ||
* [Intelij で ScalaTest を使って Scala をテストする](/ja/getting-started/intellij-track/testing-scala-in-intellij-with-scalatest.html) | ||
|
||
|
||
### コマンドラインで取り組むのをお好みの場合 | ||
exoego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
emacs、Vim、Atom、Sublime Text のようなテキストエディターの使用がお好みでしたら、Scala コードをコンパイル、テスト、実行する最良の方法は、**sbt**(Scala build tool) を使うことです。 | ||
|
||
* [コマンドラインの sbt で Scala を始める](/ja/getting-started/sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html) | ||
* [コマンドラインで ScalaTest を使って Scala をテストする](/ja/getting-started/sbt-track/testing-scala-with-sbt-on-the-command-line.html) | ||
|
||
## 次のステップ | ||
|
||
このチュートリアルを終えたら、次をチェックしてみましょう。 | ||
|
||
* [Scala ツアー](/ja/tour/tour-of-scala.html)は、Scala の特徴を簡単に理解できるサイズで紹介します。 | ||
* [学習リソース](/learn.html)(英語のみ)は、オンラインのインタラクティブなチュートリアルや教材を紹介します。 | ||
* [Scala の人気書籍一覧](/books.html)(訳注:英語のみですが、邦訳されたものもあります)。 | ||
|
||
## 助けを求めるには | ||
exoego marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
他の Scala ユーザーとすばやくつながりたいとときには、メーリングリストやリアルタイムのチャットチャンネルがたくさんあります。 | ||
こうしたリソースや助けを求められる場所を一覧できる [community](https://scala-lang.org/community/) ページをチェックしてみてください。 | ||
|
101 changes: 101 additions & 0 deletions
101
...etting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
title: Intellij で sbt を使って Scala プロジェクトをビルドする | ||
layout: singlepage-overview | ||
partof: building-a-scala-project-with-intellij-and-sbt | ||
language: ja | ||
disqus: true | ||
previous-page: /ja/getting-started/intellij-track/getting-started-with-scala-in-intellij | ||
next-page: /ja/testing-scala-in-intellij-with-scalatest | ||
--- | ||
|
||
このチュートリアルでは、[sbt](http://www.scala-sbt.org/1.x/docs/index.html) を使って Scala プロジェクトをビルドする方法を見ていきます。 | ||
sbtは、どのようなサイズの Scala プロジェクトでもコンパイル、実行、テストできる人気のツールです。 | ||
sbt(または Maven や Gradle)のようなビルドツールの使用は、1つ以上のコードファイルや依存関係のあるプロジェクトを作ったら、絶対不可欠になります。 | ||
[最初のチュートリアル](./getting-started-with-scala-in-intellij.html)を完了していることを前提とします。 | ||
|
||
## プロジェクトを作成 | ||
このでは、Intellij でプロジェクトの作り方をお見せします。 | ||
ですが、コマンドラインのほうが快適でしたら、[Getting | ||
コマンドラインの sbt で Scala を始める](/ja/getting-started/sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.html) を試して、「Scala コードを記述」節に戻ってくるのをおすすめします。 | ||
|
||
1. コマンドラインからプロジェクトを作っていなければ、Intellij を開き、"Create New Project" を選びます。 | ||
* 左パネルで Scala を選び、右パネルで sbt を選びます。 | ||
* **Next** をクリックします | ||
* プロジェクトに **SbtExampleProject** と名前を付けます。 | ||
1. コマンドラインですでにプロジェクトを作成していたら、Intelij を開き、**Import Project** を選んで、あなたのプロジェクトの `build.sbt` ファイルを開きます。 | ||
1. **JDK version** が `1.8` で、**sbt version** が少なくとも `0.13.13` であることを確認します。 | ||
1. **Use auto-import** を選びます。すると依存関係が利用可能であれば自動でダウンロードされます。 | ||
1. **Finish** を選びます。 | ||
|
||
## ディレクトリ構造を理解 | ||
|
||
sbt は、より複雑なプロジェクトを構築すだしたら便利になるであろう多くのディレクトリを作成します。 | ||
今はそのほとんどを無視できますが、全部が何のためかをここでちらっと見ておきましょう。 | ||
|
||
``` | ||
- .idea (IntelliJ ファイル) | ||
- project (sbt のプラグインや追加設定) | ||
- src (ソースファイル) | ||
- main (アプリケーションコード) | ||
- java (Java ソースファイル) | ||
- scala (Scala ソースファイル) | ||
^-- 今はこれが必要なものの全てです | ||
- scala-2.12 (Scala 2.12 固有ファイル) | ||
- test (ユニットテスト) | ||
- target (生成されたファイル) | ||
- build.sbt (sbt のためのビルド定義ファイル) | ||
``` | ||
|
||
|
||
## Scala コードを記述 | ||
1. 左の **Project** パネルで、`SbtExampleProject` => `src` => `main` を展開します。 | ||
1. `scala` を右クリックし、**New** => **Package** を選択します。 | ||
1. パッケージに `example` と名前をつけ、**OK** をクリックします。 | ||
1. パッケージ `example` を右クリックし、**New** => **Scala class** をクリックします。 | ||
1. クラスに `Main` と名前をつけ、**Kind** を `object` に変更します。 | ||
1. クラスのコードを次おように変更します。 | ||
|
||
``` | ||
object Main extends App { | ||
val ages = Seq(42, 75, 29, 64) | ||
println(s"The oldest person is ${ages.max}") | ||
} | ||
``` | ||
|
||
注:Intellij は Scala コンパイラーの独自実装を持っており、コードが間違っていると Intellij が示しても正しい場合がときどきあります。 | ||
コマンドラインで sbt がプロジェクトを実行できるかを常にチェックできます。。 | ||
|
||
## プロジェクトを実行 | ||
1. **Run** メニューから、**Edit configurations** を選びます。 | ||
1. **+** ボタンをクリックし、**sbt Task** を選びます | ||
1. それに `Run the program` と名付けます。 | ||
1. **Tasks** フィールドで、`~run` と入力します. | ||
`~` は、プロジェクトファイルへの変更を保存するたびに sbt にプロジェクトを再ビルド、再実行させます。 | ||
1. **OK** をクリックします。 | ||
1. **Run** メニューで、**Run 'Run the program'** をクリックします。 | ||
1. コードの `75` を `61` に変えて、コンソールで更新された出力を見ます。 | ||
|
||
## 依存関係を追加 | ||
|
||
趣向を少し変えて、アプリに追加機能を加えるために公開ライブラリの使い方を見てみましょう。 | ||
|
||
`build.sbt` を開き、以下のファイルを追加します。 | ||
|
||
``` | ||
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0" | ||
``` | ||
|
||
ここで `libraryDependencies` は依存関係の集合であり、`+=` を使うことにより、[scala-parser-combinators](https://github.com/scala/scala-parser-combinators) への依存を、sbt が起動時に取得してくる依存関係の集合に加えています。 | ||
これで、どの Scala ファイルでも、`scala-parser-combinator` にあるクラスやオブジェクトなどを通常のインポートでインポートできます。 | ||
|
||
さらなる公開ライブラリは、Scala ライブラリインデックス [Scaladex](https://index.scala-lang.org/) で見つけられます。 | ||
そこでは上述のような依存関係情報をコピーでき、`build.sbt` ファイルにペーストできます。 | ||
|
||
## 次のステップ | ||
|
||
**Intellij で入門** シリーズの次のチュートリアルに進み、[Intelij で ScalaTest を使って Scala をテストする](testing-scala-in-intellij-with-scalatest.html)方法を学びます。 | ||
|
||
**あるいは** | ||
|
||
- インタラクティブなオンラインコース [Scala Exercises](https://www.scala-exercises.org/scala_tutorial) で Scala を学習します。 | ||
- [Scala ツアー](/ja//tour/tour-of-scala.html) で Scala の特徴を一口大のサイズでステップバイステップに学びます。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.