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

French translation for the lazy-loading reference #2055

Merged
merged 14 commits into from
Sep 22, 2021

Conversation

audrasjb
Copy link
Contributor

This PR aims to add a French translation for the lazy-loading reference on MDN.

@audrasjb audrasjb requested a review from a team as a code owner August 13, 2021 22:28
@audrasjb audrasjb requested review from SphinxKnight and removed request for a team August 13, 2021 22:28
@github-actions github-actions bot added the l10n-fr Issues related to French content. label Aug 13, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2021

Preview URLs

Flaws

URL: /fr/docs/Web/Performance/Lazy_loading
Title: Le chargement différé
on GitHub
Flaw count: 6

  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • and 1 more flaws omitted

External URLs

URL: /fr/docs/Web/Performance/Lazy_loading
Title: Le chargement différé
on GitHub

(this comment was updated 2021-09-22 11:37:14.318783)

Copy link
Contributor Author

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

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

@tristantheb thanks for the changes.
However, I don't feel comfortable with some of these changes, especially concerning the lang attribute :)

---
<p>Le <strong>chargement différé</strong> (en anglais <i lang="en">lazy loading</i>) est une stratégie d'identification des ressources non bloquantes (non critiques) afin de ne les charger qu'au moment où elles sont utiles. C'est une façon de raccourcir le <a href="/fr/docs/Web/Performance/Critical_rendering_path">chemin critique de rendu</a>, ce qui se traduit par une réduction du temps de chargement de la page.</p>
<p>Le <strong>chargement différé</strong> (<em>lazy loading</em> en anglais) est une stratégie d'identification des ressources non bloquantes (non critiques) afin de ne les charger qu'au moment où elles sont utiles. C'est une façon de raccourcir le <a href="/fr/docs/Web/Performance/Critical_rendering_path">chemin critique de rendu</a>, ce qui se traduit par une réduction du temps de chargement de la page.</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tristantheb lang attributes are useful for screen reader users (allow to indicate the lang speech to use to vocalize the text). I'd not remove them, as it provides a better accessibility for these users.
Also, is not the best choice here. We don't want to emphasize this text, we want to write it in italics to visually indicate that this text is in English.


<h2 id="strategies">Stratégies</h2>

<p>Le chargement différé peut être appliqué sur de multiples ressources et avec de multiples stratégies.</p>

<h3 id="general">En général</h3>

<p id="code_splitting"><strong>Division du code&nbsp;:</strong><br>
Le code JavaScript, CSS et HTML peuvent être divisés en petit morceaux. Cela permet de n'envoyer que la portion de code nécessaire à l'affichage sur l'écran de l'internaute, et donc d'améliorer les temps de chargement. Le reste sera chargé sur demande. Deux systèmes sont possibles&nbsp;:</p>
<p id="code_splitting"><strong>Division du code :</strong><br>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tristantheb non-breaking spaces are needed here to avoid orphaned ponctuation on small screens.


<ul>
<li>division par points d'entrée&nbsp;: séparation du code en différents points d'entrée au sein de l'application&nbsp;;</li>
<li>division dynamique&nbsp;: séparation du code où des déclarations <a href="/fr/docs/Web/JavaScript/Reference/Statements/import"><code>import()</code></a> dynamiques sont utilisées.</li>
<li>division par points d'entrée : séparation du code en différents points d'entrée au sein de l'application ;</li>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here, no-breaking spaces are needed, please don't remove them :)

</ul>

<h3 id="javascript">JavaScript</h3>

<p><strong>Module <code>type</code> pour les balises <code>script</code>&nbsp;:</strong><br>
Toute balise script utilisant <code>type="module"</code> sera traitée comme un <a href="/fr/docs/Web/JavaScript/Guide/Modules">module JavaScript</a> et son chargement sera différé par défaut.</p>
<p><strong>Module <code>type</code> pour les balises <code>script</code> :</strong><br>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here, no-breaking spaces are needed, please don't remove them :)


<h3 id="css">CSS</h3>

<p>Par défaut, les fichiers CSS sont traités comme des ressources <a href="/fr/docs/Web/Performance/Critical_rendering_path">bloquant le rendu</a>, donc le navigateur n'affichera aucun contenu traité tant que le <a href="/fr/docs/Web/API/CSS_Object_Model">CSSOM (pour <i lang="en">CSS Object Model</i>)</a> est construit. Les fichiers CSS doivent être légers, délivrés aussi rapidement que possible, et l'utilisation des types de médias et des requêtes média est conseillé pour ne pas bloquer le rendu&nbsp;:</p>
<p>Par défaut, les fichiers CSS sont traités comme des ressources <a href="/fr/docs/Web/Performance/Critical_rendering_path">bloquant le rendu</a>, donc le navigateur n'affichera aucun contenu traité tant que le <a href="/fr/docs/Web/API/CSS_Object_Model">CSSOM (pour <i>CSS Object Model</i>)</a> est construit. Les fichiers CSS doivent être légers, délivrés aussi rapidement que possible, et l'utilisation des types de médias et des requêtes média est conseillé pour ne pas bloquer le rendu :</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lang attribute is needed for better accessibility.


<p><strong>Polyfill</strong><br>
Pour ajouter la prise en charge de l'attribut <code>loading</code> sur les vieux navigateurs qui ne sont pas compatibles, vous pouvez utiliser le polyfill suivant&nbsp;: <a href="https://github.com/mfranzke/loading-attribute-polyfill" rel="noopener">loading-attribute-polyfill</a></p>
Pour ajouter la prise en charge de l'attribut <code>loading</code> sur les vieux navigateurs qui ne sont pas compatibles, vous pouvez utiliser le polyfill suivant : <a href="https://github.com/mfranzke/loading-attribute-polyfill">loading-attribute-polyfill</a></p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No-breaking spaces are needed here :)


<p><strong>API <i lang="en">Intersection Observer</i></strong><br>
<a href="/fr/docs/Web/API/IntersectionObserver">L'API Intersection Observers</a> permet à l'internaute de savoir si un élément suivi est entré ou est déjà dans la zone d'affichage.</p>

<p><strong>Gestionnaires d'évènements</strong><br>
Lorsque la compatibilité navigateur est cruciale, vous pouvez utiliser ces quelques options&nbsp;:</p>
Lorsque la compatibilité navigateur est cruciale, vous pouvez utiliser ces quelques options :</p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-breaking spaces are needed here :)


<ul>
<li><a href="https://github.com/w3c/IntersectionObserver">polyfill pour l'API <i lang="en">Intersection observer</i></a>&nbsp;;</li>
<li><a href="https://github.com/w3c/IntersectionObserver">polyfill pour l'API Intersection observer</a></li>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lang attribute is better for screen reader users

<li><a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-blocking-css"><i lang="en">CSS bloquant le rendu</i> (en anglais)</a></li>
<li><a href="https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization#optimizing_loading_and_rendering"><i lang="en">Optimiser le chargement et le rendu</i> (en anglais)</a></li>
<li><a href="https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video"><i lang="en">Chargement différé des images et des vidéos</i> (en anglais)</a></li>
<li><a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-blocking-css">CSS bloquant le rendu (en anglais)</a></li>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

please don't remove those lang attributes :)

@tristantheb
Copy link
Member

Simply for a question of compatibility with Markdown. Markdown doesn't support things like language attributes, classes, and many other elements that we don't convert.
Moreover, the converter will refuse to convert some of the lines that are not valid for it, which will create even more work to proofread for conversion errors as we can see on the PR for the JS section ;)

@SphinxKnight
Copy link
Member

If I may interject:

  • At this time, the markdown format won't care about such attributes, yes (aka: tooling does not support this subtlety, same as Markdown does not support every HTML feature)
  • However, semantically speaking, it is still better to have language indication born by this attribute.

With all that in mind: I think we shouldn't discourage good/"deep" semantics (like having the lang attribute for such cases) but we shouldn't be too strict for other contributors who are not aware of that when evolving in a markdown world

In other words (to me): having HTML lang attributes is fine, having italics text in Markdown for other languages is better that no typographic styling.

@wbamberg : have you had any similar request/feedback on Markdown format for typography/localization? (in French, we use italics and <i lang="locale-code"> to indicate words in another language, e.g. "Dans la zone du <i lang="en">viewport</i>"…)

@wbamberg
Copy link
Contributor

@wbamberg : have you had any similar request/feedback on Markdown format for typography/localization? (in French, we use italics and <i lang="locale-code"> to indicate words in another language, e.g. "Dans la zone du <i lang="en">viewport</i>"…)

No, we haven't. Of course Markdown is much more limited here. At the moment the only way to support this would be to use HTML.

For what it's worth I have pretty intimate knowledge of MDN's en-US markup over thousands of pages, and I can say that in general we don't use semantic HTML (because of 15 years of being a Wiki with no real policies or tooling for ensuring it), so in practice, in en-US anyway, we are not losing much.

@SphinxKnight
Copy link
Member

@tristantheb, @audrasjb I've "merged" your reviews and "applied" mine. My opinion is that for inline anglicisms (e.g. "lazy loading" here) <i lang="en"> should be used preferably (but not a blocker for new contributors as said earlier). However when the text of a link is in French and refers to an article which is in English, hreflang would be theoretically better but is not used as of today and I'm not sure it exists in GFM.

I'm going to merge this as the quality of this content is already great enough, let's not bikeshed too much 👼

@SphinxKnight SphinxKnight merged commit 069b69d into mdn:main Sep 22, 2021
@audrasjb
Copy link
Contributor Author

Sounds great to me, thanks @SphinxKnight 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-fr Issues related to French content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants