Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🌐 Add Russian translation fordocs/ru/docs/tutorial/middleware.md#13412

Merged
alejsdev merged 12 commits intofastapi:masterfrom
alv2017:translate-ru-tutorial-middleware
Feb 28, 2025
Merged

🌐 Add Russian translation fordocs/ru/docs/tutorial/middleware.md#13412
alejsdev merged 12 commits intofastapi:masterfrom
alv2017:translate-ru-tutorial-middleware

Conversation

@alv2017
Copy link
Contributor

No description provided.

@github-actionsgithub-actionsbot added the lang-allTranslations labelFeb 23, 2025
@alv2017alv2017 changed the titleRussian translation added: docs/ru/docs/tutorial/middleware.mdAdd Russian translation fordocs/ru/docs/tutorial/middleware.mdFeb 23, 2025
@github-actions
Copy link
Contributor

@alv2017alv2017 marked this pull request as ready for reviewFebruary 23, 2025 01:02
@svlandegsvlandeg changed the titleAdd Russian translation fordocs/ru/docs/tutorial/middleware.md🌐 Add Russian translation fordocs/ru/docs/tutorial/middleware.mdFeb 24, 2025
@svlandegsvlandeg added lang-ruRussian translations awaiting-review labelsFeb 24, 2025
@github-actions
Copy link
Contributor

@alv2017
Copy link
ContributorAuthor

alv2017 commentedFeb 24, 2025
edited
Loading

@Rishat-F,@Yarous,@Xewus, @Stepakinoyan,@gitgernit

сделайте review пожалуйста 😊

Rishat-F and Yarous reacted with eyes emoji

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@alv2017
Copy link
ContributorAuthor

@Rishat-F : последние поправки удобно просмотреть здесь:bb4077a

Rishat-F reacted with eyes emoji

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor


Вы можете добавить промежуточный слой (middleware) в **FastAPI** приложения.

"Middleware" это функция, которая выполняется с каждым запросом до его обработки *функцией эндпоинта*.
Copy link
Contributor

Choose a reason for hiding this comment

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

не знаю, как лучше, но в оригинале используется "path operation", да и в других местах доки это называют операцией пути

Rishat-F reacted with thumbs up emoji
Copy link
ContributorAuthor

@alv2017alv2017Feb 25, 2025
edited
Loading

Choose a reason for hiding this comment

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

@Yarous: имхо,функция эндпоинта понятнее и используется чаще. Но можно и обсудить. 😊

"Middleware" это функция, которая выполняется с каждым запросом до его обработкифункцией эндпоинта.

"Middleware" это функция, которая выполняется с каждым запросом до его обработкиоперацией пути.

"эндпоинт at fastapi.tiangolo.com"

Yarous reacted with thumbs up emoji
Copy link
Contributor

@Rishat-FRishat-FFeb 25, 2025
edited
Loading

Choose a reason for hiding this comment

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

Я согласен с@Yarous.
@alv2017, ведь в переводе "Большие приложения, в которых много файлов", ты все "path operation" перевела либо как "операция пути", либо как "эндпоинт".
А "функция операции пути" или "функция эндпоинта" - это уже "operation path function".

Yarous reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

я исхожу из контекста, в данном контексте нужно переводить operation как функцию (тут проблем нет), а
path как эндпоинт (это некорректно с точки зрения русского языка)

вообще-то, если дословно, то "path operation" = "функция пути"

Copy link
Contributor

Choose a reason for hiding this comment

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

Исходя из предыдущих переводов я думал так:
"path operation" = "операция пути" или "эндпоинт"
"path operation function" = "функция операции пути" или "функция эндпоинта"

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@Rishat-F

endpoint -> url
pass operations -> набор функций/операций, обслуживающих запросы на определенный url
pass operation -> "операция пути" ~ "операция эндпоинта" ~ "функция эндпоинта"
path operation decorator:@app.get("/")
path operation function:async def root()

Copy link
Contributor

Choose a reason for hiding this comment

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

@alv2017 , разве мы не можем просто следующим образом переводить:

  • если в оригинале написано "path operation", то переводим "операция пути"
  • если в оригинале написано "path operation function", то переводим "функция операции пути"

?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@Rishat-F

  1. можем, но это не всегда работает.
  2. операция пути не( самый )удачный термин, и в обычной жизни не используется
  3. и хочется объяснить более доступно, но не всегда получается 😊

Copy link
Contributor

@Rishat-FRishat-FFeb 27, 2025
edited
Loading

Choose a reason for hiding this comment

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

@alv2017 , но ведь мы можем пока придерживаться такой (пусть и не самой удачной) терминологии, просто чтобы везде было однообразно.
И потом если кому-то в голову придет более удачный термин, то тогда массово разом везде поправить.
И если везде будут одинаковые неудачные термины, то массово поправить будет легче, чем если они будут везде по-разному прописаны.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@Rishat-F, мы такой стратегии и придерживаемся, разве нет? 😄

Rishat-F reacted with thumbs up emojiRishat-F reacted with laugh emoji
@alv2017
Copy link
ContributorAuthor

экспериментальная middleware 😄

fromfastapiimportFastAPI,Requestapp=FastAPI()@app.get("/")defhello():return {"message":"Hello from GET"}@app.post("/")defhello():return {"message":"Hello from POST"}@app.middleware("http")asyncdefadd_demo_middleware(request:Request,call_next):ifrequest.scope["method"]=="GET":request.scope["method"]="POST"elifrequest.scope["method"]=="POST":request.scope["method"]="GET"response=awaitcall_next(request)response.headers["X-Method"]=f"Request method:{request.method}"returnresponseif__name__=="__main__":importuvicornuvicorn.run(app,host="localhost",port=8080,lifespan="on")
alv2017 reacted with laugh emojiYarous reacted with confused emoji

@github-actions
Copy link
Contributor

@alv2017
Copy link
ContributorAuthor

@Yarous,@Rishat-F: добавила поправки и уточнила перевод 😇

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@alv2017
Copy link
ContributorAuthor

@Yarous, уже всё поправили, ждём тебя 😄

Copy link
Contributor

@YarousYarous left a comment

Choose a reason for hiding this comment

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

Хорошая работа 👍

@github-actions
Copy link
Contributor

@alejsdevalejsdev merged commitbb98f7d intofastapi:masterFeb 28, 2025
52 checks passed
@alejsdev
Copy link
Member

Great, thank you for your contribution!@alv2017 🚀
And thanks for your reviews@Rishat-F@Yarous

Rishat-F reacted with rocket emoji

@Rishat-F
Copy link
Contributor

@alv2017 , молодчина! Отличная работа!

@alv2017
Copy link
ContributorAuthor

@Rishat-F, народное творчество! 😄

@alv2017alv2017 deleted the translate-ru-tutorial-middleware branchMarch 6, 2025 14:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

3 more reviewers

@Rishat-FRishat-FRishat-F approved these changes

@YarousYarousYarous approved these changes

@ScrollDudeScrollDudeScrollDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

approved-2lang-allTranslationslang-ruRussian translations

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@alv2017@alejsdev@Rishat-F@Yarous@ScrollDude@svlandeg

Comments


[8]ページ先頭

©2009-2026 Movatter.jp