-
Notifications
You must be signed in to change notification settings - Fork 103
Traduction conditional.md #30
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 conditional.md #30
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bien joué ! Pas grand chose, assez souvent la même chose ;)
src/v2/guide/conditional.md
Outdated
type: guide | ||
order: 7 | ||
--- | ||
|
||
## `v-if` | ||
|
||
<p class="tip">**Cette page est en cours de traduction française. Revenez une autre fois pour lire une traduction achevée ou [participez à la traduction française ici](https://github.com/vuejs-fr/vuejs.org).**</p>In string templates, for example Handlebars, we would write a conditional block like this: | ||
Dans les templates de chaines, par exemple Handlebars, nous pouvons écrire un bloc conditionnel comme ceci : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une structure conditionnelle
https://developer.mozilla.org/fr/docs/Glossaire/Structure_de_contr%C3%B4le
src/v2/guide/conditional.md
Outdated
``` | ||
|
||
It is also possible to add an "else" block with `v-else`: | ||
Il est également possible d’ajouter un bloc « sinon » avec `v-else` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une structure « sinon »
src/v2/guide/conditional.md
Outdated
``` | ||
|
||
### Conditional Groups with `v-if` on `<template>` | ||
### Groupes conditionnels avec `v-if` sur `<template>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je propose
dans un
à la place de
sur
même si la traduction littéral n'est pas mauvaise en sois.
src/v2/guide/conditional.md
Outdated
</template> | ||
``` | ||
|
||
### `v-else` | ||
|
||
You can use the `v-else` directive to indicate an "else block" for `v-if`: | ||
Vous pouvez utiliser la directive `v-else` pour indiquer un « bloc sinon » pour `v-if` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une « structure sinon »
Ici les guillemets indiquent que c'est pas réellement une « structure » puisque ce n'est qu'un simple attribut HTML qu'on appel « directive » dans Vue. Mais si on utilise block en tant que bloc, en français le mot n'étant pas attaché spécifiquement au JavaScript, les guillemets n'auraient pas de sens. Pour finir comme vu plus haut un « Statement Block » se traduit par « Structure de contrôle » et les dérivés garde le mot « Structure ».
</div> | ||
``` | ||
|
||
A `v-else` element must immediately follow a `v-if` or a `v-else-if` element - otherwise it will not be recognized. | ||
Un élément `v-else` doit immédiatement suivre un élément `v-if` ou un élément `v-else-if` (sinon il ne sera pas reconnu). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'aime bien transformé les « - » en parenthèse. Faudrait le refaire rétroactivement sur toutes les pages déjà traduite !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai prévu de relire l'intégralité des traductions déjà faite (une relecture supplémentaire ne ferait pas de mal), je pourrais en profiter pour faire cela.
src/v2/guide/conditional.md
Outdated
|
||
### `v-else-if` | ||
|
||
> New in 2.1.0 | ||
> Nouveau dans 2.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nouveau dans la
src/v2/guide/conditional.md
Outdated
|
||
The `v-else-if`, as the name suggests, serves as an "else if block" for `v-if`. It can also be chained multiple times: | ||
Le `v-else-if`, comme le nom le suggère, sert comme un « bloc sinon si » pour `v-if`. Il peut également être enchaîné plusieurs fois : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une « structure sinon si »
src/v2/guide/conditional.md
Outdated
``` | ||
|
||
The difference is that an element with `v-show` will always be rendered and remain in the DOM; `v-show` simply toggles the `display` CSS property of the element. | ||
La différence est qu'un élément avec `v-show` sera toujours restitué et restera dans le DOM; `v-show` permute simplement la propriété CSS `display` de l'élément. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dans le DOM ;
(espace)
src/v2/guide/conditional.md
Outdated
|
||
## `v-if` vs `v-show` | ||
|
||
`v-if` is "real" conditional rendering because it ensures that event listeners and child components inside the conditional block are properly destroyed and re-created during toggles. | ||
`v-if` est un « vrai » rendu conditionnel car il garantit que les écouteurs d'événements et les composants enfants à l'intérieur du bloc conditionnel soient correctement détruits et recréés lors des permutations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de la structure conditionnelle
src/v2/guide/conditional.md
Outdated
|
||
`v-if` is also **lazy**: if the condition is false on initial render, it will not do anything - the conditional block won't be rendered until the condition becomes true for the first time. | ||
`v-if` est également **paresseux** : si la condition est fausse sur le rendu initial, il ne fera rien (le bloc conditionnel sera rendu quand la condition sera vraie pour la première fois). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(la structure conditionnelle sera rendue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super boulot; j'ai juste une question sur un singulier (du coup j'approuve quand même déjà, ce sera fait)
src/v2/guide/conditional.md
Outdated
|
||
Generally speaking, `v-if` has higher toggle costs while `v-show` has higher initial render costs. So prefer `v-show` if you need to toggle something very often, and prefer `v-if` if the condition is unlikely to change at runtime. | ||
D'une manière générale, `v-if` a des coûts de permutations plus élevés alors que `v-show` a des coûts de rendus initiaux plus élevés. Donc préférez `v-show` si vous avez besoin de permuter quelque chose très souvent et préférez `v-if` si la condition ne change probablement pas à l'exécution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
un doute sur l'orthographe, "permutation" ne devrait-il pas être au singulier dans ce contexte ? (exemple que je vois au singulier: les coûts de production , les coûts de stockage)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nyl-auster singulier en effet. Aussi j'aurais traduit par "coûts à la permutation" et "coûts au rendu initial"
@forresst, @sylvainpolletvillard et @nyl-auster : bon pour un merge ? |
src/v2/guide/conditional.md
Outdated
type: guide | ||
order: 7 | ||
--- | ||
|
||
## `v-if` | ||
|
||
<p class="tip">**Cette page est en cours de traduction française. Revenez une autre fois pour lire une traduction achevée ou [participez à la traduction française ici](https://github.com/vuejs-fr/vuejs.org).**</p>In string templates, for example Handlebars, we would write a conditional block like this: | ||
Dans les templates de chaines, par exemple Handlebars, nous pouvons écrire une structure conditionnelle comme ceci : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans les templates en chaîne de caractères
src/v2/guide/conditional.md
Outdated
@@ -126,34 +126,34 @@ new Vue({ | |||
</script> | |||
{% endraw %} | |||
|
|||
This isn't always desirable though, so Vue offers a way for you to say, "These two elements are completely separate - don't re-use them." Just add a `key` attribute with unique values: | |||
Ce n’est pas toujours souhaitable, donc Vue vous offre un moyen de dire, « Ces deux éléments sont complètement distincts - ne les réutilise pas. ». Ajoutez juste un attribut `key` avec des valeurs uniques : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce n’est pas toujours souhaitable cependant, c'est pourquoi Vue
src/v2/guide/conditional.md
Outdated
|
||
## `v-if` vs `v-show` | ||
|
||
`v-if` is "real" conditional rendering because it ensures that event listeners and child components inside the conditional block are properly destroyed and re-created during toggles. | ||
`v-if` est un « vrai » rendu conditionnel car il garantit que les écouteurs d'événements et les composants enfants à l'intérieur de la structure conditionnelle soient correctement détruits et recréés lors des permutations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sont correctement détruits
(http://grammaire.cordial-enligne.fr/manuels/QUE_INDSUB.htm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour moi c'était "soient". Je vais lire ton lien.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amusant, je dis :
Il garantit que les écouteurs d'événements et les composants enfants à l'intérieur de la structure conditionnelle sont correctement détruits.
Mais je dis :
v-if` est un « vrai » rendu conditionnel car il garantit que les écouteurs d'événements et les composants enfants à l'intérieur de la structure conditionnelle soient correctement détruits.
Il doit y avoir un rapport avec "car".
Génial ton site, vraiment !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai pas mal potassé et je suis certain maintenant que c'est à cause du "car", ou plutôt de son utilité en tant que "attends je vais lever tous les points qui peuvent te faire douter que c'est un vrai rendu conditionnel".
On sait que :
L'emploi du subjonctif est complexe. Pour lui, il faut raisonner surtout au niveau du sens et moins au niveau des règles, cependant...
Le subjonctif s'emploie quand la réalisation de l'action exprimée par le verbe est mise en doute, est incertaine ou rejetée.
http://www.bonjourdefrance.com/exercices/contenu/indicatif-ou-subjonctif.html
Plus en détail :
Dans les subordonnées complétives introduites par : que, à ce que, de ce que... on emploie le subjonctif si la valeur de vérité de ce qui est dit est mise en doute sinon on utilise l'indicatif.
Pourquoi on a "car" ? C'est pour levé le doute auprès du lecteur sur l'affirmation "v-if
est un « vrai » rendu conditionnel".
C'est pour ça que sans la principale avec "car", on utiliserait sont car dans ce cas le principale menante contient le verbe "garantit" qui ne laisse pas de place au doute.
Meme si fondamentalement un indicatif est compréhensible, ici le subjonctif ici est à sa place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Justement, ici elle n'est ni mise en doute ni rejetée donc indicatif.
Je doute qu'il soit réel.
Je vous garantis qu'il est réel.
Je ne pense pas qu'il soit réel.
Je pense qu'il est réel.
C'est aussi simple que ça.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je n'ai pas dit que c'était obligatoirement subjonctif ou indicatif, j'ai dit que le subjonctif avait tout autant sa place dans ce cas précis grâce à l'utilisation du car. Mais même sans envisagé ce car.
Pour toi, dans l'exemple suivant :
Mon garde du corps
est
cool
car, il garantit que
ma sécurité
soit
assuré.
tu mettrais plutôt est « Mon garde du corps est cool car, il garantit que ma sécurité est assuré donc ?
PS : structure initial
v-if
est
un « vrai » rendu conditionnel
car, il garantit que
les écouteurs d'événements et les composants enfants à l'intérieur de la structure conditionnelle
soient
correctement détruits et recréés lors des permutations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@haeresis oui, un garde du corps est cool car il garantit que ma sécurité est assurée.
Pour les écouteurs d'évènements, on évoque un fait absolument certain et inévitable de programmation : ils sont détruits ( et en plus c'est garanti :D )
Ca te donne l'impression de sonner bizarre car dans le langage courant on entend souvent le subjonctif à la place de l'indicatif (par exemple on dit souvent "après que je sois parti" alors que c'est bien "après que je suis parti").
src/v2/guide/conditional.md
Outdated
|
||
Generally speaking, `v-if` has higher toggle costs while `v-show` has higher initial render costs. So prefer `v-show` if you need to toggle something very often, and prefer `v-if` if the condition is unlikely to change at runtime. | ||
D'une manière générale, `v-if` a des coûts de permutations plus élevés alors que `v-show` a des coûts de rendus initiaux plus élevés. Donc préférez `v-show` si vous avez besoin de permuter quelque chose très souvent et préférez `v-if` si la condition ne change probablement pas à l'exécution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nyl-auster singulier en effet. Aussi j'aurais traduit par "coûts à la permutation" et "coûts au rendu initial"
le plus gros de la relecture a déjà été fait, mais j'ai encore 2-3 commentaires :) |
src/v2/guide/conditional.md
Outdated
|
||
## `v-if` vs `v-show` | ||
|
||
`v-if` is "real" conditional rendering because it ensures that event listeners and child components inside the conditional block are properly destroyed and re-created during toggles. | ||
`v-if` est un « vrai » rendu conditionnel car il garantit que les écouteurs d'événements et les composants enfants à l'intérieur de la structure conditionnelle soient correctement détruits et recréés lors des permutations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encore un meilleur exemple pour s'en convaincre:
"car je pense qu'il soit" et "car je ne pense pas qu'il est"
vs
"car je pense qu'il est" et "car je ne pense pas qu'il soit"
J'ai corrigé les derniers remarques. Je vous laisse merger si c'est ok pour vous. |
Je laisse @sylvainpolletvillard passé en approved. Je vais faire une relecture là. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deux pétouilles :)
|
||
Because `v-if` is a directive, it has to be attached to a single element. But what if we want to toggle more than one element? In this case we can use `v-if` on a `<template>` element, which serves as an invisible wrapper. The final rendered result will not include the `<template>` element. | ||
Comme `v-if` est une directive, elle doit être attachée à un seul élément. Mais comment faire si nous voulons permuter plusieurs éléments ? Dans ce cas, nous pouvons utiliser `v-if` sur un élément `<template>`, qui sert d'enveloppe invisible. Le résultat final rendu n’inclura pas l’élément `<template>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retrait d'un espace entre « invisible. » et « Le résultat ».
@@ -126,34 +126,34 @@ new Vue({ | |||
</script> | |||
{% endraw %} | |||
|
|||
This isn't always desirable though, so Vue offers a way for you to say, "These two elements are completely separate - don't re-use them." Just add a `key` attribute with unique values: | |||
Ce n’est pas toujours souhaitable cependant, c'est pourquoi Vue vous offre un moyen de dire, « Ces deux éléments sont complètement distincts - ne les réutilise pas. ». Ajoutez juste un attribut `key` avec des valeurs uniques : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n'est
avec une apostrophe standard pour la consistance.
Je merge, je m'occupe des deux points mineurs. |
Signed-off-by: Bruno Lesieur <[email protected]>
Merci pour les deux points mineurs |
J'attends vos commentaires