Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
🌐 Add Russian translation fordocs/ru/docs/tutorial/middleware.md#13412
🌐 Add Russian translation fordocs/ru/docs/tutorial/middleware.md#13412alejsdev merged 12 commits intofastapi:masterfrom
docs/ru/docs/tutorial/middleware.md#13412Conversation
docs/ru/docs/tutorial/middleware.md📝 Docs preview for commit858b7eb at:https://eaaeb1c9.fastapitiangolo.pages.dev Modified Pages |
docs/ru/docs/tutorial/middleware.mddocs/ru/docs/tutorial/middleware.md📝 Docs preview for commit85b530a at:https://fbaf0b7c.fastapitiangolo.pages.dev Modified Pages |
alv2017 commentedFeb 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Rishat-F,@Yarous,@Xewus, @Stepakinoyan,@gitgernit сделайте review пожалуйста 😊 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commitcf513b9 at:https://24d98628.fastapitiangolo.pages.dev Modified Pages |
📝 Docs preview for commit574925f at:https://b80f0c27.fastapitiangolo.pages.dev Modified Pages |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commitbb4077a at:https://fdc1988c.fastapitiangolo.pages.dev Modified Pages |
alv2017 commentedFeb 25, 2025
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commit7492555 at:https://9f620048.fastapitiangolo.pages.dev Modified Pages |
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commit2ec9c79 at:https://7b9a8b67.fastapitiangolo.pages.dev Modified Pages |
docs/ru/docs/tutorial/middleware.md Outdated
| Вы можете добавить промежуточный слой (middleware) в **FastAPI** приложения. | ||
| "Middleware" это функция, которая выполняется с каждым запросом до его обработки *функцией эндпоинта*. |
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.
не знаю, как лучше, но в оригинале используется "path operation", да и в других местах доки это называют операцией пути
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.
@Yarous: имхо,функция эндпоинта понятнее и используется чаще. Но можно и обсудить. 😊
"Middleware" это функция, которая выполняется с каждым запросом до его обработкифункцией эндпоинта.
"Middleware" это функция, которая выполняется с каждым запросом до его обработкиоперацией пути.
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 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.
я исхожу из контекста, в данном контексте нужно переводить operation как функцию (тут проблем нет), а
path как эндпоинт (это некорректно с точки зрения русского языка)
вообще-то, если дословно, то "path operation" = "функция пути"
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.
Исходя из предыдущих переводов я думал так:
"path operation" = "операция пути" или "эндпоинт"
"path operation function" = "функция операции пути" или "функция эндпоинта"
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.
endpoint -> url
pass operations -> набор функций/операций, обслуживающих запросы на определенный url
pass operation -> "операция пути" ~ "операция эндпоинта" ~ "функция эндпоинта"
path operation decorator:@app.get("/")
path operation function:async def root()
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.
@alv2017 , разве мы не можем просто следующим образом переводить:
- если в оригинале написано "path operation", то переводим "операция пути"
- если в оригинале написано "path operation function", то переводим "функция операции пути"
?
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 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.
@alv2017 , но ведь мы можем пока придерживаться такой (пусть и не самой удачной) терминологии, просто чтобы везде было однообразно.
И потом если кому-то в голову придет более удачный термин, то тогда массово разом везде поправить.
И если везде будут одинаковые неудачные термины, то массово поправить будет легче, чем если они будут везде по-разному прописаны.
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.
@Rishat-F, мы такой стратегии и придерживаемся, разве нет? 😄
alv2017 commentedFeb 26, 2025
экспериментальная 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") |
📝 Docs preview for commit0d581e8 at:https://6f693e48.fastapitiangolo.pages.dev Modified Pages |
alv2017 commentedFeb 27, 2025
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commitb3958a1 at:https://6c9a7d4b.fastapitiangolo.pages.dev Modified Pages |
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commitf363260 at:https://16c4c7ce.fastapitiangolo.pages.dev Modified Pages |
alv2017 commentedFeb 28, 2025
@Yarous, уже всё поправили, ждём тебя 😄 |
Yarous left a comment
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.
Хорошая работа 👍
📝 Docs preview for commit53aaa87 at:https://94a40fe5.fastapitiangolo.pages.dev Modified Pages |
bb98f7d intofastapi:masterUh oh!
There was an error while loading.Please reload this page.
alejsdev commentedFeb 28, 2025
Rishat-F commentedFeb 28, 2025
@alv2017 , молодчина! Отличная работа! |
alv2017 commentedFeb 28, 2025
@Rishat-F, народное творчество! 😄 |
No description provided.