Skip to content

Commit

Permalink
New Crowdin updates (#115)
Browse files Browse the repository at this point in the history
* New translations context-and-timeout.md (French)

* New translations context-and-timeout.md (Portuguese)

* New translations compatibility.md (Chinese Simplified)

* New translations context-and-timeout.md (Chinese Simplified)

* New translations error-handling.md (French)

* New translations error-handling.md (Portuguese)

* New translations context-and-timeout.md (Chinese Simplified)

* New translations error-handling.md (Chinese Simplified)

* New translations error-handling.md (Chinese Simplified)
  • Loading branch information
ysmood authored Jul 22, 2024
1 parent 6458984 commit 4710f51
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion i18n/fr-FR/context-and-timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pageWithCancel.MustNavigate("http://github.com")
pageWithCancel.MustElement("body")
```

Nous utilisons la `page.Context` pour créer un clone peu profond de la `page`. Whenever we call the `cancel`, the all sub operations triggered by the `pageWithCancel` will be canceled, it can be any operation, not just `MustNavigate`. La page d'origine `` ne sera pas affectée, si nous l'utilisons pour les opérations d'appel, elles ne seront pas annulées.
Nous utilisons la `page.Context` pour créer un clone peu profond de la `page`. Whenever we call the `cancel`, all the sub operations triggered by the `pageWithCancel` will be canceled, it can be any operation, not just `MustNavigate`. La page d'origine `` ne sera pas affectée, si nous l'utilisons pour les opérations d'appel, elles ne seront pas annulées.

Ce style n'est pas spécial pour Rod, vous pouvez trouver des API similaires comme [Request.WithContext](https://golang.org/pkg/net/http/#Request.WithContext) dans la bibliothèque standard.

Expand Down
2 changes: 1 addition & 1 deletion i18n/fr-FR/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
}

func handleError(err error) {
var evalErr *rod.ErrEval
var evalErr *rod.EvalError
if errors.Is(err, context.DeadlineExceeded) { // timeout error
fmt.Println("timeout err")
} else if errors.As(err, &evalErr) { // eval error
Expand Down
2 changes: 1 addition & 1 deletion i18n/pt-PT/context-and-timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pageWithCancel. MustNavigate("http://github.com")
pageWithCancel.
```

Usamos o `page. Context` para criar um clone superficial da página ``. Whenever we call the `cancel`, the all sub operations triggered by the `pageWithCancel` will be canceled, it can be any operation, not just `MustNavigate`. A página `de origem` não será afetada, se usarmos para chamar operações, elas não serão canceladas.
Usamos o `page. Context` para criar um clone superficial da página ``. Whenever we call the `cancel`, all the sub operations triggered by the `pageWithCancel` will be canceled, it can be any operation, not just `MustNavigate`. A página `de origem` não será afetada, se usarmos para chamar operações, elas não serão canceladas.

Este estilo não é especial para Varda, pode encontrar APIs semelhantes a [Request. WithContext](https://golang.org/pkg/net/http/#Request.WithContext) na biblioteca padrão.

Expand Down
16 changes: 9 additions & 7 deletions i18n/pt-PT/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ Replace the `panic` in the above code with `handleError`:

```go
func main() {
_, err := page. Element("a")
_, err := page.Element("a")
handleError(err)
}

func handleError(err error) {
var evalErr *rod. ErrEval
if errors. Is(err, context. DeadlineExceeded) { // timeout error
fmt. Println("timeout err")
} else if errors. As(err, &evalErr) { // eval error
fmt. Println(evalErr. LineNumber)
var evalErr *rod.EvalError
if errors.Is(err, context.DeadlineExceeded) { // timeout error
fmt.Println("timeout err")
} else if errors.As(err, &evalErr) { // eval error
fmt.Println(evalErr.LineNumber)
} else if err != nil {
fmt.
fmt.Println("can't handle", err)
}
}
```
2 changes: 1 addition & 1 deletion i18n/zh-CN/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Rod 支持任何使用 [DevTools 协议](https://chromedevtools.github.io/devtoo

cdp 协议总是与 [launcher.DefaultRevision](https://pkg.go.dev/github.com/go-rod/rod/lib/launcher#DefaultRevision) 相同。 如果 Rod 找不到本地浏览器,它会下载 `launcher.DefaultRevision` 版本的浏览器。

每个版本的 Rod 指保证支持它的 `launcher.DefaultRevision` 版本的浏览器。
每个版本的 Rod 只保证支持它的 `launcher.DefaultRevision` 版本的浏览器。

## API 版本号

Expand Down
6 changes: 3 additions & 3 deletions i18n/zh-CN/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ func main() {
}

func handleError(err error) {
var evalErr *rod.ErrEval
var evalErr *rod.EvalError
if errors.Is(err, context.DeadlineExceeded) { // 超时错误
fmt.Println("超时错误")
fmt.Println("timeout err")
} else if errors.As(err, &evalErr) { // eval 错误
fmt.Println(evalErr.LineNumber)
} else if err != nil {
fmt.Println("无法处理", err)
fmt.Println("can't handle", err)
}
}
```

0 comments on commit 4710f51

Please sign in to comment.