Skip to content

Commit 08887b2

Browse files
committed
Add getting-started in russian
1 parent 439602a commit 08887b2

File tree

2 files changed

+61
-65
lines changed

2 files changed

+61
-65
lines changed

_ru/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" %
8787
Здесь `libraryDependencies` представляет набор зависимостей,
8888
и с помощью `+=` мы добавляем зависимость [scala-parser-combinators](https://github.com/scala/scala-parser-combinators)
8989
к набору зависимостей, которые sbt будет загружать при запуске.
90-
Теперь в любой файл Scala можно импортировать классы, объекты и т.д. из `scala-parser-combinators` с помощью обычного импорта.
90+
Теперь в любом файле Scala можно импортировать классы, объекты и т.д. из `scala-parser-combinators` с помощью обычного импорта.
9191

9292
Вы можете найти больше опубликованных библиотек на [Scaladex](https://index.scala-lang.org/), каталоге библиотек Scala,
9393
где вы также можете скопировать указанную выше информацию о зависимостях для вставки в свой файл `build.sbt`.

_ru/getting-started/sbt-track/getting-started-with-scala-and-sbt-on-the-command-line.md

Lines changed: 60 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,109 +7,105 @@ disqus: true
77
next-page: /ru/testing-scala-with-sbt-on-the-command-line
88
---
99

10-
In this tutorial, you'll see how to create a Scala project from
11-
a template. You can use this as a starting point for your own
12-
projects. We'll use [sbt](https://www.scala-sbt.org/1.x/docs/index.html), the de facto build tool for Scala. sbt compiles,
13-
runs, and tests your projects among other related tasks.
14-
We assume you know how to use a terminal.
15-
16-
## Installation
17-
1. Make sure you have the Java 8 JDK (also known as 1.8)
18-
* Run `javac -version` in the command line and make sure you see
10+
В этом руководстве вы увидите, как создавать проекты Scala из шаблона.
11+
Это можно использовать как отправную точку для своих собственных проектов.
12+
Мы будем использовать [sbt](https://www.scala-sbt.org/1.x/docs/index.html), де-факто инструмент сборки для Scala.
13+
sbt компилирует, запускает и тестирует ваши проекты среди других связанных задач.
14+
Мы предполагаем, что вы знаете, как пользоваться терминалом.
15+
16+
## Установка
17+
1. Убедитесь, что у вас установлена Java 8 JDK (также известная как 1.8)
18+
* Запустите `javac -version` в командной строке и убедитесь, что выдается
1919
`javac 1.8.___`
20-
* If you don't have version 1.8 or higher, [install the JDK](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
21-
1. Install sbt
20+
* Если у вас нет версии 1.8 или выше, [установите JDK](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
21+
1. Установите sbt
2222
* [Mac](https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Mac.html)
2323
* [Windows](https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Windows.html)
2424
* [Linux](https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html)
2525

26-
## Create the project
26+
## Создание проекта
2727

2828
{% tabs sbt-welcome-1 class=tabs-scala-version %}
2929
{% tab 'Scala 2' for=sbt-welcome-1 %}
3030

31-
1. `cd` to an empty folder.
32-
1. Run the following command `sbt new scala/hello-world.g8`.
33-
This pulls the 'hello-world' template from GitHub.
34-
It will also create a `target` folder, which you can ignore.
35-
1. When prompted, name the application `hello-world`. This will
36-
create a project called "hello-world".
37-
1. Let's take a look at what just got generated:
31+
1. `cd` в пустую папку.
32+
1. Запустите следующую команду `sbt new scala/hello-world.g8`.
33+
Она извлекает шаблон 'hello-world' из GitHub.
34+
Она также создаст папку `target`, которую пока можно игнорировать.
35+
1. При появлении запроса назовите приложение `hello-world`. Это создаст проект под названием "hello-world".
36+
1. Давайте взглянем на то, что только что было сгенерировано:
3837

3938
{% endtab %}
4039
{% tab 'Scala 3' for=sbt-welcome-1 %}
4140

42-
1. `cd` to an empty folder.
43-
1. Run the following command `sbt new scala/scala3.g8`.
44-
This pulls the 'scala3' template from GitHub.
45-
It will also create a `target` folder, which you can ignore.
46-
1. When prompted, name the application `hello-world`. This will
47-
create a project called "hello-world".
48-
1. Let's take a look at what just got generated:
41+
1. `cd` в пустую папку.
42+
1. Запустите следующую команду `sbt new scala/scala3.g8`.
43+
Она извлекает шаблон 'scala3' из GitHub.
44+
Она также создаст папку `target`, которую пока можно игнорировать.
45+
1. При появлении запроса назовите приложение `hello-world`. Это создаст проект под названием "hello-world".
46+
1. Давайте взглянем на то, что только что было сгенерировано:
4947

5048
{% endtab %}
5149
{% endtabs %}
5250

5351

5452
```
5553
- hello-world
56-
- project (sbt uses this to install and manage plugins and dependencies)
54+
- project (sbt использует эту папку для установки и настройки плагинов и зависимостей)
5755
- build.properties
5856
- src
5957
- main
60-
- scala (All of your scala code goes here)
61-
- Main.scala (Entry point of program) <-- this is all we need for now
62-
- build.sbt (sbt's build definition file)
58+
- scala (весь Scala код находится в этой папке)
59+
- Main.scala (точка входа в программу) <-- это все, что вам сейчас нужно
60+
- build.sbt (файл определения сборки для sbt)
6361
```
6462

65-
After you build your project, sbt will create more `target` directories
66-
for generated files. You can ignore these.
63+
После того как вы создадите свой проект, sbt создаст дополнительные каталоги `target` для сгенерированных файлов.
64+
Вы можете игнорировать их.
6765

68-
## Running the project
69-
1. `cd` into `hello-world`.
70-
1. Run `sbt`. This will open up the sbt console.
71-
1. Type `~run`. The `~` is optional and causes sbt to re-run on every file save,
72-
allowing for a fast edit/run/debug cycle. sbt will also generate a `target` directory
73-
which you can ignore.
66+
## Запуск проекта
67+
1. `cd` в `hello-world`.
68+
1. Запустите `sbt`. Эта команда запустит sbt console.
69+
1. Запустите `~run`. `~` опциональна и заставляет sbt перекомпилировать
70+
и повторно запускать проект при каждом сохранении изменений в файле проекта
71+
для быстрого цикла редактирование/запуск/отладка.
72+
sbt также сгенерит директорию `target`, которую можно игнорировать.
7473

75-
## Modifying the code
76-
1. Open the file `src/main/scala/Main.scala` in your favorite text editor.
77-
1. Change "Hello, World!" to "Hello, New York!"
78-
1. If you haven't stopped the sbt command, you should see "Hello, New York!"
79-
printed to the console.
80-
1. You can continue to make changes and see the results in the console.
74+
## Доработка кода
75+
1. Откройте файл `src/main/scala/Main.scala` в вашем любимом текстовом редакторе.
76+
1. Измените "Hello, World!" на "Hello, New York!"
77+
1. Если вы не остановили команду sbt, то должны увидеть "Hello, New York!", напечатанным в консоли.
78+
1. Вы можете продолжить вносить изменения и видеть результаты доработки в консоли.
8179

82-
## Adding a dependency
83-
Changing gears a bit, let's look at how to use published libraries to add
84-
extra functionality to our apps.
80+
## Добавление зависимости
81+
Немного меняя тему, давайте посмотрим, как использовать опубликованные библиотеки
82+
для добавления дополнительных функций в наши приложения.
8583

86-
1. Open up `build.sbt` and add the following line:
84+
1. Откройте `build.sbt` и добавьте следующую строку:
8785

8886
```
8987
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
9088
```
91-
Here, `libraryDependencies` is a set of dependencies, and by using `+=`,
92-
we're adding the [scala-parser-combinators](https://github.com/scala/scala-parser-combinators) dependency to the set of dependencies that sbt will go
93-
and fetch when it starts up. Now, in any Scala file, you can import classes,
94-
objects, etc, from `scala-parser-combinators` with a regular import.
89+
Здесь `libraryDependencies` представляет набор зависимостей,
90+
и с помощью `+=` мы добавляем зависимость [scala-parser-combinators](https://github.com/scala/scala-parser-combinators)
91+
к набору зависимостей, которые sbt будет загружать при запуске.
92+
Теперь в любом файле Scala можно импортировать классы, объекты и т.д. из `scala-parser-combinators` с помощью обычного импорта.
9593

96-
You can find more published libraries on
97-
[Scaladex](https://index.scala-lang.org/), the Scala library index, where you
98-
can also copy the above dependency information for pasting into your `build.sbt`
99-
file.
94+
Вы можете найти больше опубликованных библиотек на [Scaladex](https://index.scala-lang.org/), каталоге библиотек Scala,
95+
где вы также можете скопировать указанную выше информацию о зависимостях для вставки в свой файл `build.sbt`.
10096

101-
> **Note for Java Libraries:** For a regular Java library, you should only use one percent (`%`) between the
102-
> organization name and artifact name. Double percent (`%%`) is a specialisation for Scala libraries.
103-
> You can learn more about the reason for this in the [sbt documentation][sbt-docs-lib-dependencies].
97+
> **Примечание для Java библиотек:** Для обычной библиотеки Java следует использовать только один знак процента (`%`)
98+
> между названием организации и именем артефакта. Двойной процент (`%%`) — это специализация Scala библиотек.
99+
> Подробнее об этом можно узнать в [документации sbt][sbt-docs-lib-dependencies].
104100
105-
## Next steps
101+
## Следующие шаги
106102

107-
Continue to the next tutorial in the _getting started with sbt_ series, and learn about [testing Scala code with sbt in the command line](testing-scala-with-sbt-on-the-command-line.html).
103+
Перейдите к следующему учебнику из серии _getting started with sbt_ и узнайте, как [тестировать Scala c sbt и ScalaTest в командной строке](testing-scala-with-sbt-on-the-command-line.html).
108104

109-
**or**
105+
**или**
110106

111-
- Continue learning Scala interactively online on
107+
- Продолжайте изучать Scala в интерактивном режиме на
112108
[Scala Exercises](https://www.scala-exercises.org/scala_tutorial).
113-
- Learn about Scala's features in bite-sized pieces by stepping through our [Tour of Scala]({{ site.baseurl }}/tour/tour-of-scala.html).
109+
- Узнайте о возможностях Scala с помощью небольших статей, ознакомившись с нашим [туром по Scala]({{ site.baseurl }}/ru/tour/tour-of-scala.html).
114110

115111
[sbt-docs-lib-dependencies]: https://www.scala-sbt.org/1.x/docs/Library-Dependencies.html#Getting+the+right+Scala+version+with

0 commit comments

Comments
 (0)