Skip to content
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

🌐 Add Russian translation for docs/async.md #4036

Merged
merged 17 commits into from May 9, 2022

Conversation

Winand
Copy link
Contributor

@Winand Winand commented Oct 11, 2021

  • Отмечу сразу, что я только знакомлюсь с фреймворком и в проектах его ещё не использовал.
  • Как я понимаю переведённый файл необходимо добавлять в mkdocs.yml? В других PR этого не увидел.
  • В разделе "Path operation functions" есть фраза "it's better to use async def unless your <...> functions use code that performs blocking I/O". Нужно уточнить, верно ли я передал смысл в переводе.

@ArcLightSlavik
Copy link
Contributor

Как я понимаю переведённый файл необходимо добавлять в mkdocs.yml? В других PR этого не увидел.

Yes, you need to add it to mkdocs.yml not sure why it's not consistent though 🤔

Copy link
Contributor

@FedorGN FedorGN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перевод хороший, пара комментариев:

  1. Добавить один параграф "Write your own async code". Написал его перевод в комментарии.

и дальше с этим разберётся FastAPI.

Но если вы хотите использовать синтаксис `async` / `await` без FastAPI, <a href="https://docs.python.org/3/library/asyncio-task.html#coroutine" class="external-link" target="_blank">загляните в официальную документацию Python</a>.

Copy link
Contributor

@FedorGN FedorGN Feb 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавить пропущенный параграф

### Напишите свой асинхронный код

Starlette (и **FastAPI**) основаны на <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>, что делает кего совместимым с стандартной библиотекой Python <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">asyncio</a> и <a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">Trio</a>.

В частности, вы можете использовать <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a> в ваших проектах с конкурентностью, требующих более продвинутых паттернов в вашем коде.

Даже если вы не используете FastAPI, вы можете писать ваши собственные асинхронные приложения с <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO<a>, чтобы они были максимально совместимы и получали его преимущества (например *структурная конкурентность*).

что с **FastAPI** вы получите противоположный эффект. В таком случае больше подходит
`async def`, если только *функция обработки пути* не использует код, приводящий
к блокировке <abbr title="Ввод/вывод: чтение и запись на диск, сетевые соединения.">I/O</abbr>.
<!--Уточнить: Не использовать async def, если код приводит к блокировке IO?-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Видимо, на английском говорится именно об этом. Если есть блокировка IO, лучше использовать 'def' вместо 'async def'. Перевод получается верный.

@Winand
Copy link
Contributor Author

Winand commented Feb 21, 2022

I'm not completely sure about translation of "path operation function".

Я сам не уверен по поводу термина "функция обработки пути" (path operation function), поскольку path - это действительно путь (endpoint, route), но operation - это HTTP-метод (GET, POST и т.п.). См. Features (FastAPI), Paths and Operations (Swagger)

@h0rn3t
Copy link

h0rn3t commented Apr 2, 2022

I think need to delete russian documentation because of
fascist war against Ukraine, 38 days of war was died more then 150 children and many civilian, many towns was destroyed

@tiangolo
Copy link
Owner

tiangolo commented May 9, 2022

Thanks for the contribution @Winand! 🍰

And thanks for the reviews @dimaqq, @solomein-sv, @FedorGN! 🍪

@tiangolo tiangolo enabled auto-merge (squash) May 9, 2022 18:28
@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #4036 (f34dc05) into master (b7d5746) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #4036   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          531       531           
  Lines        13629     13629           
=========================================
  Hits         13629     13629           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7d5746...f34dc05. Read the comment docs.

@tiangolo tiangolo merged commit e0962d0 into tiangolo:master May 9, 2022
JeanArhancet pushed a commit to JeanArhancet/fastapi that referenced this pull request Aug 20, 2022
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants