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

Translate 1 file to ko - Understanding Errors #129

Merged
merged 20 commits into from
Jan 17, 2022

Conversation

hyunjinee
Copy link
Contributor

#6

Understanding Errors를 한국어로 번역하였습니다.

@ghost
Copy link

ghost commented Nov 29, 2021

CLA assistant check
All CLA requirements met.

@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @bumkeyy, @yeonjuan, @guyeol, and @dvlprsh - if they write a comment saying "LGTM" then it will be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2021

Translation of Understanding Errors.md

title: Understanding Errors
layout: docs
permalink: /ko/docs/handbook/2/understanding-errors.html

oneline: "How to see errors in TypeScript."

Understand errors (Understanding Errors)

If TypeScript finds an error, it wants to explain in as much detail as possible what went wrong.
Because TypeScript's type system is structured, you can provide a detailed description of where you found the problem.

Term (Terminology)

Knowing the terms that appear frequently in error messages can help you understand them.

assignable (assignable to)

TypeScript can replace a type with a different type. Assignables I express it.
In other words, 고양이 동물because it can be replaced 동물to Assignables You.

As the name suggests, this relationship tand sby examining the type of t = s;Used to verify the validity of the assignment of .
It is also used to check in most places where the two types interact.
For example, when you call a function, the type of each argument is Assignables must be.

informally T is not assignable to STypeScript is a "_Tand Sis incompatible"_You can think of it as saying.
However, this directional Note that it's a relationship: Sprice Tcan be assigned to Tprice SIt cannot be assigned to .

Examples

Let's take a look at some examples of error messages and see what's happening.

Elaborations errors

Each error starts with a leading message and sometimes leads to more sub-messages.
Each sub-message can be thought of as answering the "why?" question for the message above.
Let's take a look at some examples to see how it actually works.

Here's an example of generating an error message that's longer than the example itself:

// @errors: 2322
let a: { m: number[] }
let b = { m: [""] }
a = b

In the last line, TypeScript noticed an error.
The logic for errors comes from the logic of making sure the allocation is ok:

  1. b The type a Can I assign it to a type? no. Why?
  2. because m This is because the type of property is incompatible. Why?
  3. because bof m Properties (string[]) aof m Properties (number[]) because it cannot be assigned to . Why?
  4. Element types in an array (string) different types (number) because it cannot be assigned to .

Additional Properties (Extra Properties)

// @errors: 2322
type A = { m: number }
const a: A = { m: 10, n: "" }

Union Associations

// @errors: 2322
type Thing = "none" | { name: string }

const a: Thing = { name: 0 }

Generated by 🚫 dangerJS against 2f04992

@bumkeyy
Copy link
Contributor

bumkeyy commented Jan 15, 2022

@hyunjinee

안녕하세요!

확인이 늦어서 죄송합니다 😢
어색한 표현이나 오역을 약간 수정해봤습니다.

번역시 너무 원문에 맞춰 가다보면 어색해질 수 있어 적당한 의역은 좋다고 생각합니다 :)

확인 부탁드려요~

hyunjinee and others added 3 commits January 15, 2022 08:48
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
hyunjinee and others added 12 commits January 15, 2022 08:49
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
요구사항 수정

Co-authored-by: Kibeom Kwon <kgbum2222@gmail.com>
@hyunjinee
Copy link
Contributor Author

@bumkeyy

번역이 처음이라 수정해야 할 부분이 많았는데

꼼꼼히 신경써 주셔서 감사합니다..!!

타입스크립트에 관심이 많이 생겨서 공부하고 있는데 앞으로도 번역에 많이 참여해보려고합니다!

감사합니다.☺️

@bumkeyy
Copy link
Contributor

bumkeyy commented Jan 17, 2022

LGTM

@github-actions github-actions bot merged commit 9819f47 into microsoft:main Jan 17, 2022
@github-actions
Copy link
Contributor

Merging because @bumkeyy is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants