Skip to content

Commit

Permalink
Merge branch 'master' into add-react-to-a-website
Browse files Browse the repository at this point in the history
  • Loading branch information
Nab69 authored Mar 6, 2019
2 parents 4bf37a9 + a9c719e commit 3791af9
Show file tree
Hide file tree
Showing 38 changed files with 1,204 additions and 1,157 deletions.
10 changes: 5 additions & 5 deletions content/blog/2019-02-23-is-react-translated-yet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ In addition, the following three languages have completed translating most of th

Special congratulations to [Alejandro Ñáñez Ortiz](https://github.com/alejandronanez), [Rainer Martínez Fraga](https://github.com/carburo), [David Morales](https://github.com/dmorales), [Miguel Alejandro Bolivar Portilla](https://github.com/Darking360), and all the contributors to the Spanish translation for being the first to *completely* translate the core pages of the docs!

## Why Localization Matters
## Why Localization Matters {#why-localization-matters}

React already has many meetups and conferences around the world, but many programmers don't use English as their primary language. We’d love to support local communities who use React by making our documentation available in most popular languages.

In the past, React community members have created unofficial translations for [Chinese](https://github.com/discountry/react), [Arabic](https://wiki.hsoub.com/React), and [Korean](https://github.com/reactjs/ko.reactjs.org/issues/4); by making an official channel for these translated docs we're hoping to make them easier to find and help make sure that non-English-speaking users of React aren't left behind.

## Contributing
## Contributing {#contributing}

If you would like to help out on a current translation, check out the [Languages](/languages) page and click on the "Contribute" link for your language.

Can't find your language? If you'd like to maintain your langauge's translation fork, follow the instructions in the [translation repo](https://github.com/reactjs/reactjs.org-translation#starting-a-new-translation)!

## Backstory
## Backstory {#backstory}

Hi everyone! I'm [Nat](https://twitter.com/tesseralis)! You may know me as the [polyhedra lady](https://www.youtube.com/watch?v=Ew-UzGC8RqQ). For the past few weeks, I've been helping the React team coordinate their translation effort. Here's how I did it.

Expand All @@ -45,7 +45,7 @@ After the trial period, we were ready to accept more languages. I created [a scr

Because of the automation, the rest of the maintance went mostly smoothly. We eventually created a [Slack channel](https://rt-slack-invite.herokuapp.com) to make it easier for translators to share information, and I released a guide solidifying the [responsibilities of maintainers](https://github.com/reactjs/reactjs.org-translation/blob/master/maintainer-guide.md). Allowing translators to talk with each other was a great boon -- for example, the Arabic, Persian, and Hebrew translations were able to talk to each other in order to get [right-to-left text](https://en.wikipedia.org/wiki/Right-to-left) working!

## The Bot
## The Bot {#the-bot}

The most challenging part was getting the bot to sync changes from the English version of the site. Initially we were using the [che-tsumi](https://github.com/vuejs-jp/che-tsumi) bot created by the Japanese Vue translation team, but we soon decided to build our own bot to suit our needs. In particular, the che-tsumi bot works by [cherry picking](https://git-scm.com/docs/git-cherry-pick) new commits. This ended up causing a cavalade of new issues that were interconnected, especially when [Hooks were released](/blog/2019/02/06/react-v16.8.0.html).

Expand All @@ -63,7 +63,7 @@ There were other smaller issues that I ran into. I tried using the [Heroku Sched

There are, as always, improvements I want to make to the bot. Right now it doesn't check whether there is an outstanding pull request before pushing another one. It's still hard to tell the exact change that happened in the original source, and it's possible to miss out on a needed translation change. But I trust the maintainers we've chosen to work through these issues, and the bot is [open source](https://github.com/reactjs/reactjs.org-translation) if anyone wants to help me make these improvements!

## Thanks
## Thanks {#thanks}

Finally, I would like to extend my gratitude to the following people and groups:

Expand Down
19 changes: 15 additions & 4 deletions content/community/conferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c

## Upcoming Conferences {#upcoming-conferences}

### React Iran 2019 {#react-iran-2019}
January 31, 2019 in Tehran, Iran
[Website](http://reactiran.com) - [Instagram](https://www.instagram.com/reactiran/)

### Reactathon 2019 {#reactathon-2019}
March 30-31, 2019 in San Francisco, USA

Expand All @@ -31,6 +27,11 @@ April 12, 2019 in Amsterdam, The Netherlands

[Website](https://react.amsterdam) - [Twitter](https://twitter.com/reactamsterdam) - [Facebook](https://www.facebook.com/reactamsterdam)

### ReactJS Girls Conference
May 3, 2019 in London, UK

[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)

### ReactEurope 2019 {#reacteurope-2019}
May 23-24, 2019 in Paris, France

Expand All @@ -51,6 +52,11 @@ June 21, 2019 Chicago, Illinois USA

[Website](https://reactloop.com) - [Twitter](https://twitter.com/ReactLoop)

### React Week '19 {#RWNY19}
July 15-21, 2019. New York City, USA

[Website](https://reactweek.nyc) - [Twitter](https://twitter.com/ReactWeek)

### ComponentsConf 2019 {#componentsconf-2019}
September 6, 2019 in Melbourne, Australia
[Website](https://www.componentsconf.com.au/) - [Twitter](https://twitter.com/componentsconf)
Expand Down Expand Up @@ -338,3 +344,8 @@ November 4 in Tel Aviv, Israel
November 30, Berlin, Germany

[Website](https://reactday.berlin) - [Twitter](https://twitter.com/reactdayberlin) - [Facebook](https://www.facebook.com/reactdayberlin/) - [Videos](https://www.youtube.com/channel/UC1EYHmQYBUJjkmL6OtK4rlw)

### React Iran 2019 {#react-iran-2019}
January 31, 2019 in Tehran, Iran

[Website](http://reactiran.com) - [Instagram](https://www.instagram.com/reactiran/)
4 changes: 2 additions & 2 deletions content/community/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ There are many example projects created by the React community. Feel free to add

* **[Calculator](https://github.com/ahfarmer/calculator)** Implementation of the iOS calculator built in React
* **[Emoji Search](https://github.com/ahfarmer/emoji-search)** Simple React app for searching emoji
* **[Github Battle App](https://github.com/ReactTraining/react-fundamentals/tree/hosting)** Battle two Github users and see the most popular Github projects for any language.
* **[Github Battle App](https://tm.dev/react-course-project/)** Battle two Github users and see the most popular Github projects for any language.
* **[React Powered Hacker News Client](https://github.com/insin/react-hn)** A React & react-router-powered implementation of Hacker News using its Firebase API.
* **[Pokedex](https://github.com/alik0211/pokedex)** The list of Pokémon with live search
* **[Shopping Cart](https://github.com/jeffersonRibeiro/react-shopping-cart)** Simple ecommerce cart application built using React
* **[Shopping Cart](https://github.com/jeffersonRibeiro/react-shopping-cart)** Simple ecommerce cart application built using React
* **[Progressive Web Tetris](https://github.com/skidding/flatris)** Besides a beautiful, mobile-friendly implementation of Tetris, this project is a playground for integrating and experimenting with web technologies.
* **[Product Comparison Page](https://github.com/Rhymond/product-compare-react)** Simple Product Compare page built in React
* **[Hacker News Clone React/GraphQL](https://github.com/clintonwoo/hackernews-react-graphql)** Hacker News clone rewritten with universal JavaScript, using React and GraphQL.
Expand Down
2 changes: 1 addition & 1 deletion content/community/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- id: debugging-tools
title: Débogage
- id: component-workbenches
title: Component Workbenches
title: Outils de mise au point
- id: jsx-integrations
title: Intégrations JSX
- id: starter-kits
Expand Down
34 changes: 17 additions & 17 deletions content/docs/addons-shallow-renderer.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
---
id: shallow-renderer
title: Shallow Renderer
title: Moteur de rendu superficiel
permalink: docs/shallow-renderer.html
layout: docs
category: Reference
---

**Importing**
**Importation**

```javascript
import ShallowRenderer from 'react-test-renderer/shallow'; // ES6
var ShallowRenderer = require('react-test-renderer/shallow'); // ES5 with npm
var ShallowRenderer = require('react-test-renderer/shallow'); // ES5 avec npm
```

## Overview {#overview}
## Aperçu {#overview}

When writing unit tests for React, shallow rendering can be helpful. Shallow rendering lets you render a component "one level deep" and assert facts about what its render method returns, without worrying about the behavior of child components, which are not instantiated or rendered. This does not require a DOM.
Quand on écrit des tests unitaires pour React, le rendu superficiel peut être utile. Le rendu superficiel vous permet de réaliser le rendu d'un composant « à un seul niveau de profondeur » afin de pouvoir vérifier ce que renvoie sa fonction de rendu, sans vous préoccuper des composants enfants, qui ne sont pas sollicités. Ça ne nécessite donc pas de DOM.

For example, if you have the following component:
Par exemple, si vous avez le composant suivant :

```javascript
function MyComponent() {
return (
<div>
<span className="heading">Title</span>
<span className="heading">Titre</span>
<Subcomponent foo="bar" />
</div>
);
}
```

Then you can assert:
Vous pouvez alors faire les vérifications suivantes :

```javascript
import ShallowRenderer from 'react-test-renderer/shallow';

// in your test:
// dans votre test :
const renderer = new ShallowRenderer();
renderer.render(<MyComponent />);
const result = renderer.getRenderOutput();

expect(result.type).toBe('div');
expect(result.props.children).toEqual([
<span className="heading">Title</span>,
<span className="heading">Titre</span>,
<Subcomponent foo="bar" />
]);
```

Shallow testing currently has some limitations, namely not supporting refs.
Le rendu superficiel a pour le moment quelques limites, notamment l'absence de prise en charge des refs.

> Note:
>
> We also recommend checking out Enzyme's [Shallow Rendering API](https://airbnb.io/enzyme/docs/api/shallow.html). It provides a nicer higher-level API over the same functionality.
> Nous vous conseillons par ailleurs de regarder [l'API de rendu superficiel](http://airbnb.io/enzyme/docs/api/shallow.html) (en anglais) d'Enzyme. Elle propose une meilleure API de haut niveau pour ce type de fonctionnalité.
## Reference {#reference}
## Référence de l'API {#reference}

### `shallowRenderer.render()` {#shallowrendererrender}

You can think of the shallowRenderer as a "place" to render the component you're testing, and from which you can extract the component's output.
Vous pouvez voir le `shallowRenderer` comme un « endroit » dans lequel faire le rendu du composant que vous testez, et depuis lequel vous pouvez extraire la sortie que ce composant produit.

`shallowRenderer.render()` is similar to [`ReactDOM.render()`](/docs/react-dom.html#render) but it doesn't require DOM and only renders a single level deep. This means you can test components isolated from how their children are implemented.
`shallowRenderer.render()` est similaire à [`ReactDOM.render()`](/docs/react-dom.html#render), à ceci près qu'elle n'a pas besoin du DOM et n’effectue le rendu qu’à un seul niveau de profondeur. Ça signifie que vous pouvez tester des composants indépendamment de l'implémentation de leurs enfants.

### `shallowRenderer.getRenderOutput()` {#shallowrenderergetrenderoutput}

After `shallowRenderer.render()` has been called, you can use `shallowRenderer.getRenderOutput()` to get the shallowly rendered output.
Après avoir appelé `shallowRenderer.render()`, vous pouvez utiliser `shallowRenderer.getRenderOutput()` pour récupérer le rendu superficiel obtenu.

You can then begin to assert facts about the output.
Vous pouvez alors vérifier ce que vous souhaitez sur le résultat attendu.
Loading

0 comments on commit 3791af9

Please sign in to comment.