Skip to content

Commit

Permalink
chore: Configuring Docusaurus to build with FR translations
Browse files Browse the repository at this point in the history
  • Loading branch information
fguitton committed Apr 2, 2021
1 parent 8275806 commit 31076a5
Show file tree
Hide file tree
Showing 54 changed files with 859 additions and 87 deletions.
34 changes: 28 additions & 6 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
* @format
*/

function makeDocsEditUrl(locale, docPath) {
if (locale === 'en')
return `https://github.com/facebookexperimental/Recoil/edit/docs/docs/docs/${docPath}`
else
return `https://github.com/facebookexperimental/Recoil/edit/docs/docs/i18n/${locale}/docusaurus-plugin-content-docs/${docPath}`
}

module.exports = {
title: 'Recoil',
tagline: 'A state management library for React',
Expand All @@ -15,8 +22,20 @@ module.exports = {
favicon: 'img/favicon.png',
organizationName: 'facebookexperimental', // Usually your GitHub org/user name.
projectName: 'Recoil', // Usually your repo name.
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
localeConfigs: {
en: {
label: 'English',
},
fr: {
label: 'Français',
},
},
},
themeConfig: {
algolia: {
algolia: {
apiKey: '9c5a009951e793525603922b8ca66628',
indexName: 'recoiljs'
},
Expand All @@ -39,14 +58,18 @@ module.exports = {
label: 'Docs',
position: 'left',
},
{to: 'blog', label: 'Blog', position: 'left'},
{to: 'resources', label: 'External Resources', position: 'left'},
{ to: 'blog', label: 'Blog', position: 'left' },
{ to: 'resources', label: 'External Resources', position: 'left' },
// Please keep GitHub link to the right for consistency.
{
href: 'https://github.com/facebookexperimental/Recoil',
label: 'GitHub',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
}
],
},
footer: {
Expand Down Expand Up @@ -129,14 +152,13 @@ module.exports = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebookexperimental/Recoil/edit/docs/docs/',
editUrl: ({ locale, docPath }) => makeDocsEditUrl(locale, docPath),
},
blog: {
showReadingTime: true,
editUrl:
'https://github.com/facebookexperimental/Recoil/edit/docs/docs/blog/',
feedOptions: {
feedOptions: {
type: 'all',
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
},
Expand Down
194 changes: 194 additions & 0 deletions docs/i18n/fr/code.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"theme.NotFound.title": {
"message": "Page introuvable",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "Nous n'avons pas trouvé ce que vous recherchez.",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "Veuillez contacter le propriétaire du site qui vous a lié à l'URL d'origine et leur faire savoir que leur lien est cassé.",
"description": "The 2nd paragraph of the 404 page"
},
"theme.AnnouncementBar.closeButtonAriaLabel": {
"message": "Fermer",
"description": "The ARIA label for close button of announcement bar"
},
"theme.blog.paginator.navAriaLabel": {
"message": "Pagination de la liste des posts du blog",
"description": "The ARIA label for the blog pagination"
},
"theme.blog.paginator.newerEntries": {
"message": "Nouvelles entrées",
"description": "The label used to navigate to the newer blog posts page (previous page)"
},
"theme.blog.paginator.olderEntries": {
"message": "Anciennes entrées",
"description": "The label used to navigate to the older blog posts page (next page)"
},
"theme.blog.post.readingTime.plurals": {
"message": "Une minute de lecture|{readingTime} minutes de lecture",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.tags.tagsListLabel": {
"message": "Tags :",
"description": "The label alongside a tag list"
},
"theme.blog.post.readMore": {
"message": "Lire plus",
"description": "The label used in blog post item excerpts to link to full blog posts"
},
"theme.blog.post.paginator.navAriaLabel": {
"message": "Pagination des blog posts",
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "Article plus récent",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "Article plus ancien",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.tags.tagsPageTitle": {
"message": "Tags",
"description": "The title of the tag list page"
},
"theme.blog.post.plurals": {
"message": "Un article|{count} articles",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.blog.tagTitle": {
"message": "{nPosts} tagués avec « {tagName} »",
"description": "The title of the page for a blog tag"
},
"theme.tags.tagsPageLink": {
"message": "Voir tous les tags",
"description": "The label of the link targeting the tag list page"
},
"theme.CodeBlock.copyButtonAriaLabel": {
"message": "Copier le code",
"description": "The ARIA label for copy code blocks button"
},
"theme.CodeBlock.copied": {
"message": "Copié",
"description": "The copied button label on code blocks"
},
"theme.CodeBlock.copy": {
"message": "Copier",
"description": "The copy button label on code blocks"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "Déplier le menu latéral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.expandButtonAriaLabel": {
"message": "Déplier le menu latéral",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.paginator.navAriaLabel": {
"message": "Pagination des documents",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
"message": "Précédent",
"description": "The label used to navigate to the previous doc"
},
"theme.docs.paginator.next": {
"message": "Suivant",
"description": "The label used to navigate to the next doc"
},
"theme.docs.sidebar.responsiveCloseButtonLabel": {
"message": "Fermer le menu latéral",
"description": "The ARIA label for close button of mobile doc sidebar"
},
"theme.docs.sidebar.responsiveOpenButtonLabel": {
"message": "Ouvrir le menu latéral",
"description": "The ARIA label for open button of mobile doc sidebar"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "Réduire le menu latéral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.sidebar.collapseButtonAriaLabel": {
"message": "Réduire le menu latéral",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "Ceci est la documentation de la prochaine version {versionLabel} de {siteTitle}.",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "Ceci est la documentation de {siteTitle} {versionLabel}, qui n'est plus activement maintenue.",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "Pour une documentation à jour, consultez la {latestVersionLink} ({versionLabel}).",
"description": "The label userd to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionLinkLabel": {
"message": "dernière version",
"description": "The label used for the latest version suggestion link label"
},
"theme.common.editThisPage": {
"message": "Éditer cette page",
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "Lien direct vers le titre",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
"message": " le {date}",
"description": "The words used to describe on which date a page has been last updated"
},
"theme.lastUpdated.byUser": {
"message": " par {user}",
"description": "The words used to describe by who the page has been last updated"
},
"theme.lastUpdated.lastUpdatedAtBy": {
"message": "Dernière mise à jour{atDate}{byUser}",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.common.skipToMainContent": {
"message": "Aller au contenu principal",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.SearchPage.documentsFound.plurals": {
"message": "Un document trouvé|{count} documents trouvés",
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.existingResultsTitle": {
"message": "Résultats de recherche pour « {query} »",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "Rechercher dans la documentation",
"description": "The search page title for empty query"
},
"theme.SearchPage.inputPlaceholder": {
"message": "Tapez votre recherche ici",
"description": "The placeholder for search page input"
},
"theme.SearchPage.inputLabel": {
"message": "Chercher",
"description": "The ARIA label for search page input"
},
"theme.SearchPage.algoliaLabel": {
"message": "Recharche Algolia",
"description": "The ARIA label for Algolia mention"
},
"theme.SearchPage.noResultsText": {
"message": "Aucun résultat trouvé",
"description": "The paragraph for empty search result"
},
"theme.SearchPage.fetchingNewResults": {
"message": "Chargement de nouveaux résultats...",
"description": "The paragraph for fetching new search results"
},
"theme.SearchBar.label": {
"message": "Chercher",
"description": "The ARIA label and placeholder for search button"
}
}
42 changes: 42 additions & 0 deletions docs/i18n/fr/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version.label": {
"message": "Suivant",
"description": "The label for version current"
},
"sidebar.docs.category.Introduction": {
"message": "Introduction",
"description": "The label for category Introduction in sidebar docs"
},
"sidebar.docs.category.Basic Tutorial": {
"message": "Tutoriel de base",
"description": "The label for category Basic Tutorial in sidebar docs"
},
"sidebar.docs.category.Guides": {
"message": "Guides",
"description": "The label for category Guides in sidebar docs"
},
"sidebar.docs.category.API Reference": {
"message": "Référence API",
"description": "The label for category API Reference in sidebar docs"
},
"sidebar.docs.category.Core": {
"message": "Concepts clés",
"description": "The label for category Core in sidebar docs"
},
"sidebar.docs.category.State": {
"message": "État",
"description": "The label for category State in sidebar docs"
},
"sidebar.docs.category.Snapshots": {
"message": "Instantané",
"description": "The label for category Snapshots in sidebar docs"
},
"sidebar.docs.category.Misc": {
"message": "Divers",
"description": "The label for category Misc in sidebar docs"
},
"sidebar.docs.category.Utils": {
"message": "Outils",
"description": "The label for category Utils in sidebar docs"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: class Loadable
sidebar_label: Loadable
---

Un objet `Loadable` représente l'état actuel d'un Recoil [atome](/docs_FR-fr/api-reference/core/atom) ou [sélecteur](/docs_FR-fr/api-reference/core/selector). Cet état peut avoir une valeur disponible, être dans un état d'erreur ou encore être en attente de résolution asynchrone. Un `Loadable` a l'interface suivante:
Un objet `Loadable` représente l'état actuel d'un Recoil [atome](/docs/api-reference/core/atom) ou [sélecteur](/docs/api-reference/core/selector). Cet état peut avoir une valeur disponible, être dans un état d'erreur ou encore être en attente de résolution asynchrone. Un `Loadable` a l'interface suivante:

- `state`: l'état actuel de l'atome ou du sélecteur. Les valeurs possibles sont `'hasValue'`, `'hasError'`, ou `'loading'`.
- `contents`: La valeur représentée par ce `Loadable`. Si l'état est `hasValue`, c'est la valeur réelle, si l'état est `hasError`, c'est l'objet `Error` qui a été lancé, et si l'état est `loading`, alors vous pouvez utiliser `toPromise()` pour obtenir une `Promise` de la valeur.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Fournit le contexte dans lequel les atomes ont des valeurs. Doit être un ancêt

**Props**:
- `initializeState?`: `(MutableSnapshot => void)`
- Une fonction optionnelle qui prend un [`MutableSnapshot`](/docs_FR-fr/api-reference/core/Snapshot#transforming-snapshots) à [initialize](/docs_FR-fr/api-reference/core/Snapshot#state-initialization) le `<RecoilRoot>` état de l'atome. Cela configure l'état du rendu initial et n'est pas destiné aux changements d'état ultérieurs ou à l'initialisation asynchrone. Utilisez des hooks tels que [`useSetRecoilState()`](/docs_FR-fr/api-reference/core/useSetRecoilState) ou [`useRecoilCallback()`](/docs_FR-fr/api-reference/core/useRecoilCallback) pour les changements d'état asynchrone.
- Une fonction optionnelle qui prend un [`MutableSnapshot`](/docs/api-reference/core/Snapshot#transforming-snapshots) à [initialize](/docs/api-reference/core/Snapshot#state-initialization) le `<RecoilRoot>` état de l'atome. Cela configure l'état du rendu initial et n'est pas destiné aux changements d'état ultérieurs ou à l'initialisation asynchrone. Utilisez des hooks tels que [`useSetRecoilState()`](/docs/api-reference/core/useSetRecoilState) ou [`useRecoilCallback()`](/docs/api-reference/core/useRecoilCallback) pour les changements d'état asynchrone.

---

Expand Down
Loading

0 comments on commit 31076a5

Please sign in to comment.