Skip to content

Commit 4710f51

Browse files
authored
New Crowdin updates (#115)
* 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)
1 parent 6458984 commit 4710f51

File tree

6 files changed

+16
-14
lines changed

6 files changed

+16
-14
lines changed

i18n/fr-FR/context-and-timeout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pageWithCancel.MustNavigate("http://github.com")
3131
pageWithCancel.MustElement("body")
3232
```
3333

34-
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.
34+
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.
3535

3636
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.
3737

i18n/fr-FR/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func main() {
6464
}
6565

6666
func handleError(err error) {
67-
var evalErr *rod.ErrEval
67+
var evalErr *rod.EvalError
6868
if errors.Is(err, context.DeadlineExceeded) { // timeout error
6969
fmt.Println("timeout err")
7070
} else if errors.As(err, &evalErr) { // eval error

i18n/pt-PT/context-and-timeout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pageWithCancel. MustNavigate("http://github.com")
3131
pageWithCancel.
3232
```
3333

34-
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.
34+
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.
3535

3636
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.
3737

i18n/pt-PT/error-handling.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@ Replace the `panic` in the above code with `handleError`:
5959

6060
```go
6161
func main() {
62-
_, err := page. Element("a")
62+
_, err := page.Element("a")
6363
handleError(err)
6464
}
6565

6666
func handleError(err error) {
67-
var evalErr *rod. ErrEval
68-
if errors. Is(err, context. DeadlineExceeded) { // timeout error
69-
fmt. Println("timeout err")
70-
} else if errors. As(err, &evalErr) { // eval error
71-
fmt. Println(evalErr. LineNumber)
67+
var evalErr *rod.EvalError
68+
if errors.Is(err, context.DeadlineExceeded) { // timeout error
69+
fmt.Println("timeout err")
70+
} else if errors.As(err, &evalErr) { // eval error
71+
fmt.Println(evalErr.LineNumber)
7272
} else if err != nil {
73-
fmt.
73+
fmt.Println("can't handle", err)
74+
}
75+
}
7476
```

i18n/zh-CN/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Rod 支持任何使用 [DevTools 协议](https://chromedevtools.github.io/devtoo
3737

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

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

4242
## API 版本号
4343

i18n/zh-CN/error-handling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ func main() {
6464
}
6565

6666
func handleError(err error) {
67-
var evalErr *rod.ErrEval
67+
var evalErr *rod.EvalError
6868
if errors.Is(err, context.DeadlineExceeded) { // 超时错误
69-
fmt.Println("超时错误")
69+
fmt.Println("timeout err")
7070
} else if errors.As(err, &evalErr) { // eval 错误
7171
fmt.Println(evalErr.LineNumber)
7272
} else if err != nil {
73-
fmt.Println("无法处理", err)
73+
fmt.Println("can't handle", err)
7474
}
7575
}
7676
```

0 commit comments

Comments
 (0)