Skip to content

docs(pt): translate handbook-v2/Narrowing#251

Open
guuszz wants to merge 1 commit into
microsoft:mainfrom
guuszz:docs/pt-br-handbook-v2-narrowing
Open

docs(pt): translate handbook-v2/Narrowing#251
guuszz wants to merge 1 commit into
microsoft:mainfrom
guuszz:docs/pt-br-handbook-v2-narrowing

Conversation

@guuszz
Copy link
Copy Markdown

@guuszz guuszz commented Jun 3, 2026

Summary

Adds the Brazilian Portuguese translation of Narrowing from the TypeScript v2 Handbook, into docs/documentation/pt/handbook-v2/.

This continues the handbook-v2 PT-BR effort (#247 Understanding Errors, #248 The Handbook, #249 Basics, #250 Everyday Types). Narrowing is page #4 in the reading order and one of the most important pages in the whole handbook — it covers typeof guards, truthiness, equality, the in operator, instanceof, type predicates, discriminated unions, never and exhaustiveness checking.

Translation choices

  • Followed the established pt/ frontmatter convention: translated title and oneline, adapted permalink to /pt/docs/handbook/2/narrowing.html.
  • Preserved every code sample verbatim — all 8 @errors directive lines (codes verified identical to EN), every // ---cut--- (12 of them), and all 26 positional query markers (// ^?) byte-for-byte, so the interactive type-display examples still render.
  • Kept the special twoslash/markdown pragmas: {class: "do-not-do-this"}, <!-- prettier-ignore --> and <!-- TODO -->.
  • Translated only the explanatory comments inside code blocks (e.g. // DON'T DO THIS! / KEEP READING// NÃO FAÇA ISSO! / CONTINUE LENDO, keeping the !!!! alignment); identifiers, strings and sample values left unchanged.
  • Kept technical terms with a PT gloss on first use (e.g. guarda de tipo (type guard), estreitamento (narrowing), união discriminada (discriminated union), predicado de tipo (type predicate)).

Source

microsoft/TypeScript-Website @ packages/documentation/copy/en/handbook-v2/Narrowing.md

Testing

Read side-by-side with the EN source; verified code fences (70), ---cut--- count (12), ^? marker count (26) and all @errors codes are identical between EN and PT. Cross-checked terminology against the already-merged pt/ pages and my sibling PRs in this series (#247#250).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant