Magento 2 is a robust eCommerce platform that supports multi-language functionality. Configuring multiple languages allows businesses to cater to a global audience effectively. In this guide, we will walk you through step-by-step instructions to set up multiple language stores in Magento 2.

Step 1: Create a New Store View

To support multiple languages, you need to create a store view for each language. Follow these steps:

  1. Log in to the Magento 2 Admin Panel.
  2. Navigate to Stores > Settings > All Stores.
  3. Click on the Create Store View button.
  4. Fill in the following details:
    • Store: Select the main store to which this view belongs.
    • Name: Enter the name of the store view (e.g., "French Store").
    • Code: Enter a unique identifier for the store view (e.g., "french").
    • Status: Set to Enabled.
    • Sort Order: Define the order in which this view will appear in the frontend (optional).
  5. Click Save Store View.
Create Store View in Magento 2

Step 2: Configure Locale Settings

After creating the store view, configure its locale settings to reflect the desired language:

  1. Go to Stores > Settings > Configuration.
  2. In the left-hand panel, select General > Locale Options.
  3. From the Store View dropdown, select the store view you created (e.g., "French Store").
  4. Uncheck the Use Website checkbox next to Locale.
  5. Choose the appropriate language for the store view (e.g., French - France).
  6. Click Save Config.
Locale Settings in Magento 2

Step 3: Translate Static Content

Magento 2 uses static content like buttons, labels, and messages that can be translated into your chosen language. To do this:

  1. Log in to your server via SSH or terminal.
  2. Run the following command to deploy static content for the new language:
    php bin/magento setup:static-content:deploy fr_FR
  3. Replace fr_FR with the locale code of your chosen language.
  4. Clear the cache by running:
    php bin/magento cache:flush

This will generate the necessary translation files for the selected locale.

Step 4: Add Translations for Custom Text

For custom text on your website, you can create a CSV file to manage translations:

  1. Create a file named translate.csv in the folder app/design/frontend/{Vendor}/{Theme}/i18n.
  2. Add translations in the format:
    "Original Text","Translated Text"
  3. For example:
    "Add to Cart","Ajouter au Panier"
  4. Deploy the theme again using:
    php bin/magento setup:static-content:deploy

Step 5: Configure the Language Switcher

Magento 2 automatically adds a language switcher on the frontend if multiple store views are enabled:

  1. Go to the frontend of your Magento 2 store.
  2. Ensure the language switcher is visible in the header or footer area.
  3. Select a language to verify the translation works as expected.
Language Switcher in Magento 2

Step 6: Test and Verify

Once the configuration is complete, test the following:

  • Switch between languages using the language switcher.
  • Check if all static content and custom text are translated correctly.
  • Verify product pages, category pages, and checkout pages to ensure proper functionality.

Clear the cache if changes are not reflected immediately.

Conclusion

Configuring a multi-language website in Magento 2 is essential for businesses targeting international customers. By following these steps, you can seamlessly manage multiple languages on your Magento 2 store. Ensure to test thoroughly to provide a localized and user-friendly shopping experience.