Skip to content

Commit 20db16d

Browse files
authored
Merge pull request #59 from fsmiamoto/master
Improve portuguese translation of the README
2 parents cda002d + 6dfa28a commit 20db16d

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

translations/pt/README.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
description: Uma documentação hospedada para que você possa começar a criar aplicativos da Web com o Fiber.
2+
description: Uma documentação hospedada para que você possa começar a criar aplicativos Web com o Fiber.
33
---
44

55
# 📖 Introdução
66

77
[![](https://img.shields.io/github/release/gofiber/fiber?style=flat-square)](https://github.com/gofiber/fiber/releases) [![](https://img.shields.io/badge/api-documentation-blue?style=flat-square)](https://fiber.wiki) ![](https://img.shields.io/badge/goreport-A%2B-brightgreen?style=flat-square) [![](https://img.shields.io/badge/coverage-91%25-brightgreen?style=flat-square)](https://gocover.io/github.com/gofiber/fiber) [![](https://img.shields.io/travis/gofiber/fiber/master.svg?label=linux&style=flat-square)](https://travis-ci.org/gofiber/fiber) [![](https://img.shields.io/travis/gofiber/fiber/master.svg?label=windows&style=flat-square)](https://travis-ci.org/gofiber/fiber)
88

9-
**O Fiber** é uma [estrutura da](https://github.com/expressjs/express) **Web** inspirada no [Expressjs](https://github.com/valyala/fasthttp) , construída sobre o [Fasthttp](https://github.com/valyala/fasthttp) , o mecanismo HTTP **mais rápido** do [Go](https://golang.org/doc/) . Projetado para **facilitar** o desenvolvimento **rápido** , com **zero de alocação de memória** e **desempenho** em mente.
9+
**Fiber** é um framework **web** inspirado no [Express](https://github.com/expressjs/express) e construído sobre o [Fasthttp](https://github.com/valyala/fasthttp), o engine HTTP **mais rápido** do [Go](https://golang.org/doc/). Projetado para **facilitar** o desenvolvimento **rápido**, com **zero de alocação de memória** e **performance** em mente.
1010

1111
## Instalando
1212

1313
Primeiro de tudo, faça o [download](https://golang.org/dl/) e instale o Go.
1414

15-
{% hint style = "success"%} É necessário **1,11** (com os [módulos de ativação](https://golang.org/doc/go1.11#modules) ativados) ou superior. {% endhint%}
15+
{% hint style = "success"%} É necessário o uso do Go **1.11** (com os [Go Modules](https://golang.org/doc/go1.11#modules) ativados) ou superior. {% endhint%}
1616

1717
A instalação é feita usando o comando [`go get`](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) :
1818

@@ -22,28 +22,29 @@ go get -u github.com/gofiber/fiber
2222

2323
## Olá Mundo!
2424

25-
Incorporado abaixo está o aplicativo **Fibre** essencialmente mais simples, que você pode criar.
25+
Abaixo temos o app **Fiber** mais simples que você pode criar:
2626

2727
```text
2828
touch server.go
2929
```
3030

3131
```go
32+
// server.go
3233
package main
3334

3435
import "github.com/gofiber/fiber"
3536

3637
func main() {
37-
// Create new Fiber instance:
38+
// Cria nova instância do Fiber
3839
app := fiber.New()
39-
40-
// Create route on root path, "/":
40+
41+
// Cria rota no caminho raíz, "/":
4142
app.Get("/", func(c *fiber.Ctx) {
42-
c.Send("Hello, World!")
43-
// => "Hello, World!"
43+
c.Send("Olá, Mundo!")
44+
// => "Olá, Mundo!"
4445
})
45-
46-
// Start server on "localhost" with port "8080":
46+
47+
// Inicia servidor no localhost e na porta 8080
4748
app.Listen(8080)
4849
}
4950
```
@@ -52,91 +53,91 @@ func main() {
5253
go run server.go
5354
```
5455

55-
Navegue para `http://localhost:8080` e você verá `Hello, World!` na página.
56+
Navegue para `http://localhost:8080` e você verá `Olá, Mundo!` na página.
5657

5758
## Roteamento básico
5859

59-
O roteamento refere-se à determinação de como um aplicativo responde a uma solicitação do cliente para um terminal específico, que é um URI (ou caminho) e um método de solicitação HTTP específico (GET, PUT, POST e assim por diante).
60+
O roteamento refere-se à como uma aplicação responde a uma requisição para um _endpoint_ específico, que é formado por um [URI](https://pt.wikipedia.org/wiki/URI) (ou caminho) e um [método de requisição HTTP](https://pt.wikipedia.org/wiki/Hypertext_Transfer_Protocol#M%C3%A9todos_de_solicita%C3%A7%C3%A3o) específico (GET, PUT, POST e outros).
6061

61-
{% hint style = "info"%} Cada rota pode ter **uma função de manipulador** , que é executada quando a rota é correspondida. {% endhint%}
62+
{% hint style = "info"%} Cada rota pode ter **várias funções _handler_**, que são executadas quando há uma correspondência da rota. {% endhint%}
6263

63-
A definição de rota utiliza as seguintes estruturas:
64+
A definição de rotas utiliza a seguinte estrutura:
6465

6566
```go
66-
// Function signature
67+
// Assinatura da função
6768
app.Method(func(*fiber.Ctx))
6869
app.Method(path string, func(*fiber.Ctx))
6970
```
7071

7172
- `app` é uma instância do **Fiber** .
72-
- `Method` é um [método de solicitação HTTP](https://fiber.wiki/application#methods) , em maiúsculas: `Get` , `Put` , `Post` , etc.
73+
- `Method` é um [método de requisição HTTP](https://fiber.wiki/application#methods) , em maiúsculas: `Get` , `Put` , `Post` , etc.
7374
- `path` é um caminho no servidor.
74-
- `func(*fiber.Ctx)` é uma função de retorno de chamada que contém o [contexto](https://fiber.wiki/context) executado quando a rota é correspondida.
75+
- `func(*fiber.Ctx)` é uma função _callback_ que recebe o [Context](https://fiber.wiki/context) executado quando a rota é correspondida.
7576

7677
### Rota simples
7778

7879
```go
79-
// Respond with "Hello, World!" on root path, "/":
80+
// Responde com "Olá, Mundo!" na caminho raíz, "/":
8081
app.Get("/", func(c *fiber.Ctx) {
81-
c.Send("Hello, World!")
82+
c.Send("Olá, Mundo!")
8283
})
8384
```
8485

8586
### Rota com parâmetro
8687

8788
```go
88-
// GET http://localhost:8080/hello%20world
89+
// GET http://localhost:8080/ola%20mundo
8990

90-
app.Get("/:value", func(c *fiber.Ctx) {
91-
c.Send("Get request with value: " + c.Params("value"))
92-
// => Get request with value: hello world
91+
app.Get("/:valor", func(c *fiber.Ctx) {
92+
c.Send("Requisição GET com valor: " + c.Params("valor"))
93+
// => Requisição GET com valor: ola mundo
9394
})
9495
```
9596

9697
### Rota com parâmetro opcional
9798

9899
```go
99-
// GET http://localhost:8080/hello%20world
100+
// GET http://localhost:8080/ola%20mundo
100101

101-
app.Get("/:value?", func(c *fiber.Ctx) {
102-
if c.Params("value") != "" {
103-
c.Send("Get request with value: " + c.Params("Value"))
104-
// => Get request with value: hello world
102+
app.Get("/:valor?", func(c *fiber.Ctx) {
103+
if c.Params("valor") != "" {
104+
c.Send("Requisição GET com valor: " + c.Params("valor"))
105+
// => Requisição GET com valor: ola mundo
105106
return
106107
}
107-
108-
c.Send("Get request without value")
108+
109+
c.Send("Requisição GET sem nenhum valor")
109110
})
110111
```
111112

112-
### Rota com curinga
113+
### Rota com _wildcard_
113114

114115
```go
115-
// GET http://localhost:8080/api/user/john
116+
// GET http://localhost:8080/api/usuario/joao
116117

117118
app.Get("/api/*", func(c *fiber.Ctx) {
118-
c.Send("API path with wildcard: " + c.Params("*"))
119-
// => API path with wildcard: user/john
119+
c.Send("Caminho na API com wildcard: " + c.Params("*"))
120+
// => Caminho na API com wildcard: usuario/joao
120121
})
121122
```
122123

123124
## Arquivos estáticos
124125

125-
Para veicular arquivos estáticos, como **imagens** , arquivos **CSS** e **JavaScript** , substitua o manipulador de funções por uma sequência de arquivos ou diretórios.
126+
Para servir arquivos estáticos, como **imagens**, arquivos **CSS** e **JavaScript**, substitua a função handler por strings de arquivos ou diretórios.
126127

127128
Assinatura da função:
128129

129130
```go
130-
app.Static(root string) // => without prefix
131-
app.Static(prefix, root string) // => with prefix
131+
app.Static(raiz string) // => sem prefixo
132+
app.Static(prefixo, raiz string) // => com prefixo
132133
```
133134

134135
Use o código a seguir para servir arquivos em um diretório chamado `./public` :
135136

136137
```go
137138
app := fiber.New()
138139

139-
app.Static("./public") // => Serve all files into ./public
140+
app.Static("./public") // => Serve todos os arquivos em ./public
140141

141142
app.Listen(8080)
142143
```

0 commit comments

Comments
 (0)