Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md#12933

Merged
alejsdev merged 6 commits into
fastapi:masterfrom
AndreBBM:response-model-pt
Nov 26, 2024
Merged

🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md#12933
alejsdev merged 6 commits into
fastapi:masterfrom
AndreBBM:response-model-pt

Conversation

@AndreBBM

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the lang-all Translations label Nov 14, 2024
@github-actions

Copy link
Copy Markdown
Contributor

@alejsdev alejsdev added lang-zh Chinese translations awaiting-review lang-pt Portuguese translations and removed lang-zh Chinese translations labels Nov 18, 2024

@ceb10n ceb10n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really great work @AndreBBM

I didn't find anything wrong. But I've added some suggestions to keep the standards for the portuguse translation...

It's approved since there are only suggestions, but feel free to add them if you want :D

Comment thread docs/pt/docs/tutorial/response-model.md Outdated
@@ -0,0 +1,357 @@
# Modelo de resposta - Tipo de retorno

Você pode declarar o tipo usado para a resposta anotando o **tipo de retorno** *da função de operação de caminho (path operation function)*.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The pattern used in portuguese translations for path operation is "operação de rota".

So it would be nice to keep it. It would be something like:

Você pode declarar o tipo usado para a resposta anotando o tipo de retorno da função de operação de rota

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

Nesses casos, você pode usar o parâmetro `response_model` do *path operation decorator* em vez do tipo de retorno.

Você pode usar o parâmetro `response_model` em qualquer uma das *operações de caminho (path operations)*:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can remove the (path operations) and just keep the translation to operações de rota

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

Se você adicionasse a anotação do tipo de retorno, ferramentas e editores reclamariam com um erro (correto) informando que sua função está retornando um tipo (por exemplo, um dict) diferente do que você declarou (por exemplo, um modelo Pydantic).

Nesses casos, você pode usar o parâmetro `response_model` do *path operation decorator* em vez do tipo de retorno.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can translate path operation decorator to decorador de operação de rota.

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

{* ../../docs_src/response_model/tutorial001_py310.py hl[17,22,24:27] *}

/// note

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can add the translation for this admonition:

/// note | Nota

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

/// note

Observe que `response_model` é um parâmetro do método "decorator" (`get`, `post`, etc). Não da sua *função de operação de caminho (path operation function)*, como todos os parâmetros e corpo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can change

função de operação de caminho (path operation function)

to

função de operação de rota

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

### `response_model_include` e `response_model_exclude`

Você também pode usar os parâmetros `response_model_include` e `response_model_exclude` do *path operation decorator*.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can translate to decorador de operação de rota

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

Isso pode ser usado como um atalho rápido se você tiver apenas um modelo Pydantic e quiser remover alguns dados da saída.

/// tip | dica

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can use a capital letter here:

/// tip | Dica

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

{* ../../docs_src/response_model/tutorial005_py310.py hl[29,35] *}

/// tip | dica

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can use a capital letter here:

/// tip | Dica

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

///

#### Usando `listas` em vez de `set`s

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you can remove the translation to lists here:

Usando `list`s em vez de `set`s

Comment thread docs/pt/docs/tutorial/response-model.md Outdated

## Recapitulação

Use o parâmetro `response_model` do *path operation decorator* para definir modelos de resposta e, especialmente, para garantir que dados privados sejam filtrados.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can translate to decorador de operação de rota.

@AndreBBM

Copy link
Copy Markdown
Contributor Author

Thank you for the review, @ceb10n I'll update the PR!

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@ceb10n ceb10n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@nazarepiedady nazarepiedady left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for your collaboration, @AndreBBM.

@alejsdev alejsdev changed the title 🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md 🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md Nov 26, 2024
@github-actions

Copy link
Copy Markdown
Contributor

@alejsdev alejsdev merged commit 66cadd9 into fastapi:master Nov 26, 2024
@alejsdev

Copy link
Copy Markdown
Member

Thanks for your contribution! @AndreBBM 💯
And thanks for your review @ceb10n 🔍

s-rigaud pushed a commit to s-rigaud/fastapi that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-2 lang-all Translations lang-pt Portuguese translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants