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

Traduction de editable-svg-icons.md #121

Merged
merged 17 commits into from
Jun 10, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions src/v2/cookbook/editable-svg-icons.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: Editable SVG Icon Systems (EN)
title: Système d'Icônes SVG Éditable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Éditables ? plus loin on parle d'icônes éditables

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qu'est ce que tu penses de Dynamique ?

type: cookbook
order: 4
---

## Base Example
## Exemple de base

<p>Cette page est en cours de traduction. Pour nous aider, vous pouvez participer sur <a href="https://github.com/vuejs-fr/vuejs.org" target="_blank">le dépôt GitHub dédié de Vuejs-FR</a>.</p><p>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:</p>
<p>Il y a plusieurs façons de créer un système d'icônes SVG. Une méthode qui tire parti des capacités de Vue est de créer des icônes en ligne éditables en tant que composants. Voici quelques avantages à procéder ainsi :</p>

* They are easy to edit on the fly
* They are animatable
* You can use standard props and defaults to keep them to a typical size or alter them if you need to
* They are inline, so no HTTP requests are necessary
* They can be made accessible dynamically
* Les icônes sont faciles à éditer à la volée
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

éditer | modifier ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

éditer ca parrait mieux. Plus naturel

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qui tire partie

non ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non, c'est parti. Et je vote aussi pour "modifier", éditer est un anglicisme qui n'a pas la même signification en français (http://www.larousse.fr/dictionnaires/francais/%C3%A9diter/27850)

* Elles sont animables
* On peut utiliser des `props` et des `defaults` pour les dimensionner ou les modifier.
* Tout est dans le html, aucune requête http supplémentaire

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elles sont déclarées en HTML, donc aucune requête HTTP n'est nécessaire

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aucune requete superflue ?

* Elles peuvent facilement être rendues accessibles dynamiquement

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retirer "facilement", non présent dans le texte original

Copy link
Author

@elevatebart elevatebart Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est vrai. Je vais changer. Mais du coup, ca fait mentir la doc. En effet il est tout a fait possible de rendre accessible les images d'un site en PNG. il suffit de les decouper en leurs parties uniques et de leur donner des alt. C'est juste moche.


First, we'll create a folder for all of the icons, and name them in a standardized fashion for easy retrieval:
Créons d'abord un dossier pour stocker tous nos icônes. Donnons à nos icônes des noms normalisés. Cela facilitera leurs appels plus tard.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Donnons des noms normalisés à nos icônes, cela permettra ensuite de les appeler plus facilement.


> components/icons/IconBox.vue
> components/icons/IconCalendar.vue
> components/icons/IconEnvelope.vue

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/)
Voici un exemple du système une fois terminé. [https://github.com/sdras/vue-sample-svg-icons/](https://github.com/sdras/vue-sample-svg-icons/)

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

We'll create a base icon (`IconBase.vue`) component that uses a slot.
Commençons par créer un composant icône de base (`IconBase.vue`) disposant d'un `slot`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Commençons" devrait être utilisé pour la première instruction, à permuter avec "Créons" deux paragraphes au-dessus


```html
<template>
Expand All @@ -43,9 +43,9 @@ We'll create a base icon (`IconBase.vue`) component that uses a slot.
</template>
```

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.
Ce composant peut être utilisé tel quel, le seul paramètre à vérifier sera le `viewBox` qui dépendra de celui de vos icônes. Dans l'icône de base, les paramètres `width`, `height`, `iconColor` et `iconName` sont des props pour pouvoir les piloter selon les besoins. La prop `iconName` sera utilisée comme le contenu de la balise `<titre>` et de l'attribut `id` de notre icône SVG pour assurer l'accessibilité.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point virgule après tel quel

le seul paramètre que vous pourrez avoir à modifier est la viewBox de vos icônes

pour pouvoir les modifier dynamiquement

sera utilisée à la fois pour le contenu de la balise <titre> et pour l'attribut

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<title> ne doit pas être traduit non ?
Vu que c'est une balise HTML ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je retire la traduction, c'est vrai que c'est mieux


Our script will look like this, we'll have some defaults so that our icon will be rendered consistently unless we state otherwise:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ressemble à ça prend un accent sur le a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai l'impression que l'interface GitHub a eu un soucis, j'ai ajouté un commentaire sur la partie Française évidemment.

Le `<script>` du composant icône de base ressemble a ça. Remarquons les valeurs par défaut. Notre icône sera toujours affichée avec les mêmes hauteur/largeur partout sauf si on les force à changer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La phrase "Remarquons" sonne bizarre. Je propose de l'enlever et remplacer la suivante par
"Nous mettons des valeurs par défaut afin que nos icônes soient dessinées de manière uniforme, sauf contre-indication."


```js
export default {
Expand All @@ -70,32 +70,32 @@ export default {
}
```

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.
La valeur `currentColor` de la prop `iconColor` donne aux icônes la couleur - `fill` - du texte qui l'encadre. On peut modifier cette couleur simplement en passant une prop au composant.

We can use it like so, with the only contents of `IconWrite.vue` containing the paths inside the icon:
Voici un exemple d'utilisation, avec le contenu de `IconWrite.vue` comme path du SVG:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Espace avant le :


```html
<icon-base icon-name="write"><icon-write /></icon-base>
```

Now, if we'd like to make many sizes for the icon, we can do so very easily:
Et si on souhaite afficher l'icône dans d'autres tailles:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Espace avant :


```html
<p>
<!-- you can pass in a smaller `width` and `height` as props -->
<!-- on peut lui passer une `width` et une `height` plus petite grace aux props -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grâce

<icon-base width="12" height="12" icon-name="write"><icon-write /></icon-base>
<!-- or you can use the default, which is 18 -->
<!-- ou ne rien passer du tout et utiliser la width par défaut: 18 -->
<icon-base icon-name="write"><icon-write /></icon-base>
<!-- or make it a little bigger too :) -->
<!-- ou même l'agrandir :) -->
<icon-base width="30" height="30" icon-name="write"><icon-write /></icon-base>
</p>
```

<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" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'il faut traduire le texte des images ou pas ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah les commentaires c'est toujours utiles, ca aide a comprendre.


## Animatable Icons
## Icônes animables

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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clic

Mettre des icônes SVG dans des composants devient clé dès que l'on souhaite les animer. D'autant plus quand cette animation se passe lors d'une interaction. Les SVG `inline` sont la forme de SVG la mieux supportée. Voici comment animer une icône lors d'un click:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mettre des icônes SVG dans des composants est bien pratique dès que l'on souhaite les animer, en particulier pendant une interaction.


```html
<template>
Expand All @@ -104,10 +104,10 @@ Keeping icons in components comes in very handy when you'd like to animate them,
viewBox="0 0 100 100"
width="100"
height="100"
aria-labelledby="scissors"
aria-labelledby="ciseaux"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

traduit en ciseaux ici, mais toujours leftscissor ligne 112

role="presentation"
>
<title id="scissors" lang="en">Scissors Animated Icon</title>
<title id="scissors" lang="fr">Icône de ciseaux animée</title>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l'aria-labelledby doit correspondre à l'id du title. Donc soit scissors dans les 2 cas, soit ciseaux dans les 2 cas.

<path id="bk" fill="#fff" d="M0 0h100v100H0z"/>
<g ref="leftscissor">
<path d="M..."/>
Expand Down Expand Up @@ -143,27 +143,27 @@ export default {
}
```

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.
Nous avons ajouté des attributs `ref` aux groupes de paths pour pouvoir les animer. Comme les deux cotés des ciseaux s'anime en même temps, nous allons écrire une fonction réutilisable a qui nous allons passer des `ref`. Nous pouvons compter sur GreenSock pour gérer la compatibilité de l'animation entre navigateurs notamment le problème de `transform-origin`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s'animent
réutilisable à
Nous pouvons compter sur GreenSock => L'utilisation de GreenSock gère la compatibilité
entre navigateurs**,** notamment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

une fonction réutilisable à laquelle nous allons passer

L'utilisation de GreenSock aide à gérer les problèmes de support des animations et de transform-origin entre les différents navigateurs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

les deux côtés des ciseaux s'animent en même temps

réutilisable à qui nous

Et voir la remarque de @sylvainpolletvillard sur la partie GreenSock 👍


<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>
<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="Système d'icônes SVG Éditables: Animation" class="codepen">Voir le Pen <a href="https://codepen.io/team/Vue/pen/dJRpgY/">Système d'icones SVG Editables: Animation</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>

<p style="margin-top:-30px">Pretty easily accomplished! And easy to update on the fly.</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En Français, contrairement à l'Anglais, il y a un espace avant les ? et !.

Et aussi à modifier à la volée.

<p style="margin-top:-30px">Pas trop dur! Et en plus, super facile a modifier à la volée!!</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

un point d'exclamation suffit ici, d'autant qu'il n'y en a pas dans le texte d'origine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'avoue je me suis un peu lache la dessus, je devais etre fatigue. Dsl


You can see more animated examples in the repo [here](https://github.com/sdras/vue-sample-svg-icons/)
D'autres exemples d'animations sont disponibles dans le dépôt [ici](https://github.com/sdras/vue-sample-svg-icons/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai souvent lu que c'était pas bien d'utiliser le texte "ici" pour un lien, car tu "perds de l'information".

Je pense que ça serait mieux si ça serait disponibles dans ce [dépôt](...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bonne idee


## Additional Notes
## Remarques additionnelles

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.
Les designers changent d'avis. Les besoins produit aussi. Conserver la logique pour l'ensemble des icons dans un seul composant de base nous permettra de mettre a jour toutes les icônes en modifiant un seul fichier. Même en utilisant un icon loader, il existe des situations où recréer ou éditer chaque SVG devient nécessaire si on souhaite la même modification sur chaque icône. Cette méthode nous économisera du temps.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l'ensemble des icônes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mettre le icon loader en italique, ou alors le traduire non ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

les loader sont un concept inventé par WebPack. Je ne pense pas qu'une traduction soit necessaire. Par contre l'itallique est une tres bonne idee. Cela facilitera la lecture.

Copy link
Member

@Kocal Kocal Apr 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui c'est vrai, de plus je viens de remarquer qu'on n'en n'avait pas parlé ici #4.

Go garder loader dans ce cas 🙂


## When To Avoid This Pattern
## Quand éviter ce pattern

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 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.
Ce système d'icônes est particulièrement utile quand la plupart des icônes du site sont différentes ou utilisées différemment. Si la même icône est utilisée de nombreuses fois sur la même page (par exemple, une table géante avec une icône de suppression sur chaque ligne), il peut être plus malin de définir un sprite SVG contenant des `<symbol/>` entre des balises `<defs>` et de les référencer dans des balises `<use>`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quand vous avez un certain nombre d'icônes qui sont utilisées de différentes façons à travers votre site.

définir une sprite sheet


## Alternative Patterns
## Alternatives possibles

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patterns alternatifs


Other tooling to help manage SVG icons includes:
Quelques outils annexes qui pourront vous aider:

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

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.
Ces outils compilent les SVG en même temps que le bundle webpack, mais rendent la modification des icônes plus compliquée à chaud. En effet, la balise `<use>` réagit bizarrement sous certains navigateurs avec les dessins complexes. Ils génèrent aussi deux propriétés `viewBox` imbriqués avec deux systèmes de coordonnées. Cela peut rendre l'implémentation plus délicate.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à chaud => à l'exécution