Skip to content

Commit 317eea9

Browse files
authored
Merge pull request #212 from prika/cookbook/editable-svg-ivons-portuguese-translation
Docs: translate cookbook/editable-svg-icons.md
2 parents 0292e54 + e65ee91 commit 317eea9

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

src/cookbook/editable-svg-icons.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Editable SVG Icon Systems
1+
# Sistemas de Ícones SVG Editáveis
22

3-
## Base Example
3+
## Exemplo Base
44

5-
There are many ways to create an SVG Icon System, but one method that takes advantage of Vue's capabilities is to create editable inline icons as components. Some of the advantages of this way of working is:
5+
Existem muitas formas de criar um sistema de ícone SVG, mas o método que tira vantagem das capacidades do Vue é criar ícones *inline* editáveis como componente. Algumas das vantagens desta forma de trabalhar são:
66

7-
- They are easy to edit on the fly
8-
- They are animatable
9-
- You can use standard props and defaults to keep them to a typical size or alter them if you need to
10-
- They are inline, so no HTTP requests are necessary
11-
- They can be made accessible dynamically
7+
- São fáceis de se editar em tempo real
8+
- São animáveis
9+
- Pode se usar props, definindo padrões ou alterando-as caso necessário
10+
- São incorporados, então não exigem requisições HTTP adicionais
11+
- Eles podem ser acessados dinamicamente
1212

13-
First, we'll create a folder for all of the icons, and name them in a standardized fashion for easy retrieval:
13+
Primeiro, vamos criar uma pasta para todos os ícones, e nomeá-los de forma padronizada para fácil recuperação:
1414

1515
- `components/icons/IconBox.vue`
1616
- `components/icons/IconCalendar.vue`
1717
- `components/icons/IconEnvelope.vue`
1818

19-
Here's an example repo to get you going, where you can see the entire setup: [https://github.com/sdras/vue-sample-svg-icons/](https://github.com/sdras/vue-sample-svg-icons/)
19+
Eis um exemplo de repositório, onde pode ver toda a configuração: [https://github.com/sdras/vue-sample-svg-icons/](https://github.com/sdras/vue-sample-svg-icons/)
2020

2121
![Documentation site](https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/screendocs.jpg 'Docs demo')
2222

23-
We'll create a base icon (`IconBase.vue`) component that uses a slot.
23+
Vamos criar um componente de ícone base (`IconBase.vue`) que usa um `slot`.
2424

2525
```html
2626
<template>
@@ -40,9 +40,9 @@ We'll create a base icon (`IconBase.vue`) component that uses a slot.
4040
</template>
4141
```
4242

43-
You can use this base icon as is- the only thing you might need to update is the `viewBox` depending on the `viewBox` of your icons. In the base, we're making the `width`, `height`, `iconColor`, and name of the icon props so that it can be dynamically updated with props. The name will be used for both the `<title>` content and its `id` for accessibility.
43+
Você pode usar esse ícone base como está – a única coisa que você pode precisar atualizar é a `viewBox` dependendo da `viewBox` dos ícones que for utilizar. Na base, vamos usar propriedades `width`, `height`, `iconColor` e `iconName`, para que possam ser atualizados dinamicamente. O nome será usado tanto para o conteúdo do `<title>` como para o `id` para acessibilidade.
4444

45-
Our script will look like this, we'll have some defaults so that our icon will be rendered consistently unless we state otherwise:
45+
Nosso *script* ficará assim, teremos alguns valores padrão para que nosso ícone seja renderizado de forma consistente, a menos que declaremos o contrário:
4646

4747
```js
4848
export default {
@@ -67,32 +67,32 @@ export default {
6767
}
6868
```
6969

70-
The `currentColor` property that's the default on the fill will make the icon inherit the color of whatever text surrounds it. We could also pass in a different color as a prop if we wish.
70+
A propriedade `currentColor` , usada como padrão para o preenchimento, irá permitir ao ícone herdar a cor do texto que o rodeia. Também poderíamos passar uma cor diferente como `prop` se quisermos.
7171

72-
We can use it like so, with the only contents of `IconWrite.vue` containing the paths inside the icon:
72+
Podemos usá-lo assim, bastando que o conteúdo do componente `IconWrite.vue` seja um conjunto de `path` referente ao desenho desejado:
7373

7474
```html
7575
<icon-base icon-name="write"><icon-write /></icon-base>
7676
```
7777

78-
Now, if we'd like to make many sizes for the icon, we can do so very easily:
78+
Agora, se quisermos fazer vários tamanhos para o ícone, podemos fazer isso facilmente:
7979

8080
```html
8181
<p>
82-
<!-- you can pass in a smaller `width` and `height` as props -->
82+
<!-- pode-se passar um `width` e `height` mais pequenos como props -->
8383
<icon-base width="12" height="12" icon-name="write"><icon-write /></icon-base>
84-
<!-- or you can use the default, which is 18 -->
84+
<!-- ou você pode usar o padrão, que é 18 -->
8585
<icon-base icon-name="write"><icon-write /></icon-base>
86-
<!-- or make it a little bigger too :) -->
86+
<!-- ou torná-lo um pouco maior também :) -->
8787
<icon-base width="30" height="30" icon-name="write"><icon-write /></icon-base>
8888
</p>
8989
```
9090

9191
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/Screen%20Shot%202018-01-01%20at%204.51.40%20PM.png" width="450" />
9292

93-
## Animatable Icons
93+
## Ícones Animáveis
9494

95-
Keeping icons in components comes in very handy when you'd like to animate them, especially on an interaction. Inline SVGs have the highest support for interaction of any method. Here's a very basic example of an icon that's animated on click:
95+
Manter os ícones como componentes é muito útil quando você deseja animá-los, especialmente em uma interação. Os SVGs embutidos (*inline*) têm maior suporte a interações, seja através de *script* ou de *style*. Eis um exemplo básico de um ícone animado no evento `@click`:
9696

9797
```html
9898
<template>
@@ -105,7 +105,7 @@ Keeping icons in components comes in very handy when you'd like to animate them,
105105
aria-labelledby="scissors"
106106
role="presentation"
107107
>
108-
<title id="scissors" lang="en">Scissors Animated Icon</title>
108+
<title id="scissors" lang="en">Ícone de Tesoura Animado</title>
109109
<path id="bk" fill="#fff" d="M0 0h100v100H0z" />
110110
<g ref="leftscissor">
111111
<path d="M..." />
@@ -141,27 +141,27 @@ export default {
141141
}
142142
```
143143

144-
We're applying `refs` to the groups of paths we need to move, and as both sides of the scissors have to move in tandem, we'll create a function we can reuse where we'll pass in the `refs`. The use of GreenSock helps resolve animation support and `transform-origin` issues across browser.
144+
Estamos aplicando `refs` aos grupos de caminhos que precisamos mover e, como ambos os lados da tesoura devem mover-se em conjunto, criamos uma função que permite a reutilização em ambas as `refs`. O uso da biblioteca GreenSock ajuda a resolver questões de suporte às animações e problemas de `transform-origin` entre os navegadores.
145145

146-
<p data-height="300" data-theme-id="0" data-slug-hash="dJRpgY" data-default-tab="result" data-user="Vue" data-embed-version="2" data-pen-title="Editable SVG Icon System: Animated icon" class="codepen">See the Pen <a href="https://codepen.io/team/Vue/pen/dJRpgY/">Editable SVG Icon System: Animated icon</a> by Vue (<a href="https://codepen.io/Vue">@Vue</a>) on <a href="https://codepen.io">CodePen</a>.</p><script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
146+
<p data-height="300" data-theme-id="0" data-slug-hash="dJRpgY" data-default-tab="result" data-user="Vue" data-embed-version="2" data-pen-title="Editable SVG Icon System: Animated icon" class="codepen">Veja o Exemplo <a href="https://codepen.io/team/Vue/pen/dJRpgY/">Sistema de Ícones SVG Editáveis: Ícone Animado</a> by Vue (<a href="https://codepen.io/Vue">@Vue</a>) no <a href="https://codepen.io">CodePen</a>.</p><script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
147147

148-
<p style="margin-top:-30px">Pretty easily accomplished! And easy to update on the fly.</p>
148+
Um resultado atingido facilmente! E fácil de se atualizar sempre que necessário.
149149

150-
You can see more animated examples in the repo [here](https://github.com/sdras/vue-sample-svg-icons/)
150+
Pode ver mais exemplos de animações [neste repositório](https://github.com/sdras/vue-sample-svg-icons/)
151151

152-
## Additional Notes
152+
## Notas Adicionais
153153

154-
Designers may change their minds. Product requirements change. Keeping the logic for the entire icon system in one base component means you can quickly update all of your icons and have it propagate through the whole system. Even with the use of an icon loader, some situations require you to recreate or edit every SVG to make global changes. This method can save you that time and pain.
154+
Os *designers* podem mudar de ideias. Ou podem ocorrer mudanças nos requisitos do produto. Manter a lógica para todo o sistema de ícones em um componente base garante a possibilidade de atualizá-los todos, e ter isso automaticamente propagado por todo o sistema. Mesmo com o uso de uma ferramenta do tipo *icon loader*, algumas situações irão requerer que você recrie ou edite todos os SVG, para fazer alterações globais. O presente método pode ainda poupar-lhe tempo e dor.
155155

156-
## When To Avoid This Pattern
156+
## Quando Evitar Este Padrão
157157

158-
This type of SVG icon system is really useful when you have a number of icons that are used in different ways throughout your site. If you're repeating the same icon many times on one page (e.g. a giant table with a delete icon in each row), it might make more sense to have all of the sprites compiled into a sprite sheet and use `<use>` tags to load them.
158+
Este tipo de sistema de ícones SVG é realmente útil quando você tem vários ícones que são usados de maneiras diferentes em todo o *site*. Entretanto, se houver grande repetição do mesmo ícone em uma página (ex.: uma grande tabela com um ícone *delete* em cada linha), poderá fazer mais sentido ter todos os ícones compilados em um arquivo de sprites, com a *tag* `<use>` para carregá-los.
159159

160-
## Alternative Patterns
160+
## Padrões Alternativos
161161

162-
Other tooling to help manage SVG icons includes:
162+
Outras ferramentas para ajudar no gerenciamento de ícones SVG:
163163

164164
- [svg-sprite-loader](https://github.com/kisenka/svg-sprite-loader)
165165
- [svgo-loader](https://github.com/rpominov/svgo-loader)
166166

167-
These tools bundle SVGs at compile time, but make them a little harder to edit during runtime, because `<use>` tags can have strange cross-browser issues when doing anything more complex. They also leave you with two nested `viewBox` properties and thus two coordinate systems. This makes the implementation a little more complex.
167+
Essas ferramentas agrupam SVGs em tempo de compilação, mas os tornam um pouco mais difíceis de editar em *runtime* (durante o tempo de execução), porque as tags `<use>` pode introduzir problemas de compatibilidade entre navegadores para quaisquer ações mais complexas. Eles também deixam você com duas propriedades `viewBox` aninhadas e, desta forma, dois sistemas de coordenadas. Isto torna a implementação um pouco mais complexa.

0 commit comments

Comments
 (0)