Skip to content

Commit

Permalink
Merge pull request #456 from reactjs/ui/more-in-page-widgets
Browse files Browse the repository at this point in the history
Localize remaining in-page doc widgets
  • Loading branch information
tdd authored Apr 26, 2023
2 parents 522452a + 8ba3290 commit c0fcd07
Show file tree
Hide file tree
Showing 9 changed files with 319 additions and 316 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ yarn-error.log*

# external fonts
public/fonts/**/Optimistic_*.woff2

# contributors likely have their own workspace settings and shouldn't
# version them (e.g. markdownlint tweaks, etc.)
.vscode/settings.json
14 changes: 7 additions & 7 deletions src/components/MDX/Challenges/Challenge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function Challenge({
className="text-xl text-primary dark:text-primary-dark mb-2 mt-0 font-medium"
id={currentChallenge.id}>
<div className="font-bold block md:inline">
{isRecipes ? 'Example' : 'Challenge'} {currentChallenge.order} of{' '}
{isRecipes ? 'Exemple' : 'Défi'} {currentChallenge.order} sur{' '}
{totalChallenges}
<span className="text-primary dark:text-primary-dark">: </span>
</div>
Expand All @@ -63,14 +63,14 @@ export function Challenge({
<div>
<Button className="mr-2" onClick={toggleHint} active={showHint}>
<IconHint className="mr-1.5" />{' '}
{showHint ? 'Hide hint' : 'Show hint'}
{showHint ? 'Masquer l’indice' : 'Afficher l’indice'}
</Button>
<Button
className="mr-2"
onClick={toggleSolution}
active={showSolution}>
<IconSolution className="mr-1.5" />{' '}
{showSolution ? 'Hide solution' : 'Show solution'}
{showSolution ? 'Masquer la solution' : 'Afficher la solution'}
</Button>
</div>
) : (
Expand All @@ -80,7 +80,7 @@ export function Challenge({
onClick={toggleSolution}
active={showSolution}>
<IconSolution className="mr-1.5" />{' '}
{showSolution ? 'Hide solution' : 'Show solution'}
{showSolution ? 'Masquer la solution' : 'Afficher la solution'}
</Button>
)
)}
Expand All @@ -94,7 +94,7 @@ export function Challenge({
)}
onClick={handleClickNextChallenge}
active>
Next {isRecipes ? 'Example' : 'Challenge'}
Prochain {isRecipes ? 'exemple' : 'défi'}
<IconArrowSmall displayDirection="right" className="block ml-1.5" />
</Button>
)}
Expand All @@ -109,7 +109,7 @@ export function Challenge({
{currentChallenge.solution}
<div className="flex justify-between items-center mt-4">
<Button onClick={() => setShowSolution(false)}>
Close solution
Fermer la solution
</Button>
{hasNextChallenge && (
<Button
Expand All @@ -118,7 +118,7 @@ export function Challenge({
)}
onClick={handleClickNextChallenge}
active>
Next Challenge
Prochain défi
<IconArrowSmall
displayDirection="right"
className="block ml-1.5"
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Challenges/Challenges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function Challenges({
children,
isRecipes,
noTitle,
titleText = isRecipes ? 'Try out some examples' : 'Try out some challenges',
titleText = isRecipes ? 'Jouez avec ces exemples' : 'Relevez ces défis',
titleId = isRecipes ? 'examples' : 'challenges',
}: ChallengesProps) {
const challenges = parseChallengeContents(children);
Expand Down
4 changes: 2 additions & 2 deletions src/components/MDX/Challenges/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function Navigation({
<div className="flex z-10 pb-2 pl-2">
<button
onClick={handleScrollLeft}
aria-label="Scroll left"
aria-label="Défiler vers la gauche"
className={cn(
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-l border-gray-20 border-r',
{
Expand All @@ -118,7 +118,7 @@ export function Navigation({
</button>
<button
onClick={handleScrollRight}
aria-label="Scroll right"
aria-label="Défiler vers la droite"
className={cn(
'bg-secondary-button dark:bg-secondary-button-dark h-8 px-2 rounded-r',
{
Expand Down
8 changes: 4 additions & 4 deletions src/components/MDX/ExpandableCallout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ interface ExpandableCalloutProps {

const variantMap = {
deprecated: {
title: 'Deprecated',
title: 'Dépréciation',
Icon: IconWarning,
containerClasses: 'bg-red-5 dark:bg-red-60 dark:bg-opacity-20',
textColor: 'text-red-50 dark:text-red-40',
overlayGradient:
'linear-gradient(rgba(249, 247, 243, 0), rgba(249, 247, 243, 1)',
},
note: {
title: 'Note',
title: 'Remarque',
Icon: IconNote,
containerClasses:
'bg-green-5 dark:bg-green-60 dark:bg-opacity-20 text-primary dark:text-primary-dark text-lg',
Expand All @@ -35,15 +35,15 @@ const variantMap = {
'linear-gradient(rgba(245, 249, 248, 0), rgba(245, 249, 248, 1)',
},
pitfall: {
title: 'Pitfall',
title: 'Piège',
Icon: IconPitfall,
containerClasses: 'bg-yellow-5 dark:bg-yellow-60 dark:bg-opacity-20',
textColor: 'text-yellow-50 dark:text-yellow-40',
overlayGradient:
'linear-gradient(rgba(249, 247, 243, 0), rgba(249, 247, 243, 1)',
},
wip: {
title: 'Under Construction',
title: 'En construction',
Icon: IconNote,
containerClasses: 'bg-yellow-5 dark:bg-yellow-60 dark:bg-opacity-20',
textColor: 'text-yellow-50 dark:text-yellow-40',
Expand Down
6 changes: 3 additions & 3 deletions src/components/MDX/ExpandableExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
{isDeepDive && (
<>
<IconDeepDive className="inline mr-2 dark:text-purple-30 text-purple-40" />
Deep Dive
En détail
</>
)}
{isExample && (
<>
<IconCodeBlock className="inline mr-2 dark:text-yellow-30 text-yellow-50" />
Example
Exemple
</>
)}
</h5>
Expand All @@ -101,7 +101,7 @@ function ExpandableExample({children, excerpt, type}: ExpandableExampleProps) {
<span className="mr-1">
<IconChevron displayDirection={isExpanded ? 'up' : 'down'} />
</span>
{isExpanded ? 'Hide Details' : 'Show Details'}
{isExpanded ? 'Masquer les détails' : 'Afficher les détails'}
</Button>
</summary>
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/Recap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Recap({children}: RecapProps) {
return (
<section>
<H2 isPageAnchor id="recap">
Recap
En résumé
</H2>
{children}
</section>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import type {RouteTag} from './Layout/getRouteMeta';

const variantMap = {
foundation: {
name: 'Foundation',
name: 'Fondamentaux',
classes: 'bg-yellow-50 text-white',
},
intermediate: {
name: 'Intermediate',
name: 'Intermédiaire',
classes: 'bg-purple-40 text-white',
},
advanced: {
name: 'Advanced',
name: 'Avancé',
classes: 'bg-green-40 text-white',
},
experimental: {
name: 'Experimental',
name: 'Expérimental',
classes: 'bg-ui-orange text-white',
},
deprecated: {
name: 'Deprecated',
name: 'Déprécié',
classes: 'bg-red-40 text-white',
},
};
Expand Down
Loading

0 comments on commit c0fcd07

Please sign in to comment.