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
Created Russian translation #1363
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1363 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 226 226
Lines 6785 6785
=========================================
Hits 6785 6785 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I really like your translation!
Added minor refinements and omissions in the translation
|
||
This project is licensed under the terms of the MIT license. | ||
Проект распространяется под лицензие MIT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проект распространяется под лицензией MIT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Этот проект лицензирован в соответствии с условиями лицензии MIT.
|
||
Used by FastAPI / Starlette: | ||
Используют FastAPI / Starlette: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Используются
* **WebSockets** | ||
* **GraphQL** | ||
* extremely easy tests based on `requests` and `pytest` | ||
* **GraphQL** API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a typo?
|
||
```Python | ||
... "item_price": item.price ... | ||
``` | ||
|
||
...and see how your editor will auto-complete the attributes and know their types: | ||
...и вы увидите, как ваш редактор или IDE поможет вам с автодополнением: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...и вы увидите, как ваш редактор или IDE будет авто-дополнять атрибуты и знать их типы:
|
||
```Python | ||
return {"item_name": item.name, "item_id": item_id} | ||
``` | ||
|
||
...from: | ||
...из: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...с
|
||
</details> | ||
|
||
### Run it | ||
### Запуск |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Запусти
|
||
</details> | ||
|
||
### Check it | ||
### Проверяем, всё ли работает |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проверь
|
||
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance). | ||
* **Скорость**: FastAPI работает не хуже движков на **NodeJS** или **Go** (спасибо движкам Starlette и Pydantic). Без шуток, это [один из самых быстрых движков на Python в мире](#_9). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There in second position in original we have Fast to code
feature. I propose to add such a translation:
* **Быстрая разработка**: Увеличивает скорость разработки фич примерно на 200-300%. *
|
||
--- | ||
|
||
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. | ||
FastAPI — это современный и шустрый веб-фреймворк для создания API на Python 3.6+. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FastAPI — это современный и шустрый веб-фреймворк для создания API на Python 3.6+, основанный на стандартной аннотации типов Python.
* **Чистый код**: FastAPI без проблем работает в современных редакторах и IDE. Хорошо поддерживает <abbr title="это то же самое, что и автодополнение или IntelliSense">дополнение кода</abbr>. На отладку и чтение кода у вас будет уходить меньше времени. | ||
* **Легкий и понятный**: Мы сделали FastAPI проще для учебы или работы над реальными проектами. Документацию написали простым, понятным языком и сдобрили большим количеством примеров — почаще заходите сюда, если что-то непонятно. | ||
* **Простой, но не примитивный**: FastAPI поможет писать код без копипасты и багов. Он гибкий и с большим набором фич «из коробки». | ||
* **Сразу на выпуск**: На FastAPI удобно писать полностью готовый к коммерческому использованию код. FastAPI автоматически, без усилий со стороны программиста создаст документацию к API для проекта (см. ниже). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* **Сразу в бой**:
instead * **Сразу на выпуск**:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leaved quite much "optional" comments for things that more non-formal, feel free to ignore them but imo it will improve readability
|
||
</div> | ||
|
||
## Примеры |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пример
<details markdown="1"> | ||
<summary>Либо то же самое, но асинхронно...</summary> | ||
|
||
Просто замените `def` на `async def`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если в вашем коде применяется async / await
It's quite important note since if you not using async await and just change for async def
it could be worse
* `app`: объект, к которому сервер обращается в `main.py`, он создается строчкой `app = FastAPI()`. | ||
* `--reload`: приказывает серверу перезапускаться после изменений в исходниках. Удобно для разработки, но не делайте так в итоговом проекте. | ||
|
||
Если вкратце, эта команда указывает `uvicorn` обратиться к файлу `main.py`, найти объект `app` и запустить сервер. Сервер перезапустится, если файл `main.py` будет изменен. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicates previous list and not presents on original page
|
||
### Проверяем, всё ли работает | ||
|
||
Откройте в браузере URL <a href="http://127.0.0.1:8000/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1:8000/items/5?q=medved</a>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why url goes for 'q=somequery' but in text its q=medved. I'd leave it as somequery
Вы увидите ответ от локального сервера в формате JSON: | ||
|
||
```JSON | ||
{"item_id": 5, "q": "medved"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, tag opens page with q=somequery
* Объявление **параметров** из других источников: **заголовков HTTP**, **куков**, **форм** и даже **файлов**. | ||
* Как расширить **проверки**, например для максимальной длины строк или с помощью регулярных выражений. | ||
* Мощная, но легкая в освоении система **<abbr title="она же компоненты, ресурсы, провайдеры, сервисы">внедрения зависимостей</abbr>**. | ||
* Примочки для авторизации и безопасности, включая поддержку **OAuth2** с **JWT-токерами** и **HTTP-авторизацией**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Авторизации и безопасность, включая поддержку OAuth2 с JWT-токенов и HTTP-авторизации.
* Как расширить **проверки**, например для максимальной длины строк или с помощью регулярных выражений. | ||
* Мощная, но легкая в освоении система **<abbr title="она же компоненты, ресурсы, провайдеры, сервисы">внедрения зависимостей</abbr>**. | ||
* Примочки для авторизации и безопасности, включая поддержку **OAuth2** с **JWT-токерами** и **HTTP-авторизацией**. | ||
* Техники для объявления **продвинутых моделей для сериализации данных** (благослови Линукс человека, придумавшего Pydantic). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Продвинутые, но простые техники объявления глубоко вложенных JSON моделей (спасибо Pydantic).
* Мощная, но легкая в освоении система **<abbr title="она же компоненты, ресурсы, провайдеры, сервисы">внедрения зависимостей</abbr>**. | ||
* Примочки для авторизации и безопасности, включая поддержку **OAuth2** с **JWT-токерами** и **HTTP-авторизацией**. | ||
* Техники для объявления **продвинутых моделей для сериализации данных** (благослови Линукс человека, придумавшего Pydantic). | ||
* Много дополнительных фичей (спасибо Starlette), вроде: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
на подобие: or таких как:
* **CORS** | ||
* **Сессии в куках** | ||
* ...и так далее. | ||
Это всё есть в документации :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary
|
||
## Производительность | ||
|
||
Бенчмарки от TechEmpower говорят, что приложения **FastAPI** под Uvicorn <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">являются одними их самых быстрых приложений на Python</a>, только наравне с Starlette и Uvicorn (эти две библиотеки используются внутри FastAPI). (*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Независимые бенчмарки от TechEmpower говорят, что приложения FastAPI под Uvicorn являются одними их самых быстрых приложений на Python, уступая только Starlette и Uvicorn (эти две библиотеки используются внутри FastAPI). (*)
<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI"></a> | ||
</p> | ||
<p align="center"> | ||
<em>FastAPI — быстрый, понятный фреймворк для реальных проектов</em> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FastAPI — легко обучаемы фреймворк позволяющий быстрое программирование и производительность для реальных проектов
Explanation: The current fix is missing easy to learn, fast to code
part so I added that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FastAPI — легко изучаемый фреймворк с высокой производительностью, быстрой разработкой, готовый для реальных проектов
Your variant looks kinda "Google translate" stuff, I think this version will be more like native
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better. Thanks
Sadly the original author of this PR is no longer available in GitHub, so they will not be able to update this PR anymore. But now there's a new translation here: #2985 🎉 If a couple of you could review it, that would be great, I would be able to merge it after a couple of reviews. ✔️ |
@tiangolo I created a translated index.md. The translation works perfectly on the live server, but to run in production, you need to test and review someone from the Russian-speaking community. Or Google Translate ;-(
Issue #1362