/React-Training-Multilangues

React Training exos 2: Create a Website that Allows Language Switching with useContext

Primary LanguageJavaScript

React Training Exercise 2: Language Switching with useContext

This is a Next.js project bootstrapped with create-next-app. The primary focus of this project is to demonstrate how to implement language switching on a website using React's useContext hook.

Project Objective

The main goal is to provide a hands-on example for developers to understand the power and flexibility of React's Context API. By the end of this tutorial, you should be able to:

  • Understand how useContext works
  • Implement language switching functionality
  • Use Next.js for server-side rendering

Getting Started

First, clone the repository and run the development server:

Copy code
git clone <repository_url>
cd <repository_name>
npm install
npm run dev

Open http://localhost:3000 with your browser to see the result.

How to Use

Navigate to the landing page and you'll see flags at the top of the page. Clicking on these flags will change the language of the content displayed.

Learn More

To deepen your understanding of these technologies, you can refer to:

  • React's Context API Documentation
  • Next.js Documentation