Is er een probleem dat snel moet worden opgelost?Spoedfix nodig?Vraag spoedhulp aan →
Blog

Praktische Magento 2-gidsen over upgrades, beveiliging, snelheid en migratie, geschreven door het MageBooster-team.

Magento 2.4.9 store languages: store views, language packs and translations (Lesson 16)

Add a language to Magento 2.4.9: a store view per language, free language packs with Composer, the locale per store view, static content deploy, and a product and home page translated per store view.
Les 16MageBooster-lessen · Magento 2.4.9

Magento store languages: store views, language packs and translations

In Magento every language is a store view. Our Main Website already has English and German; in this lesson we add Turkish, install free language packs with Composer, set the locale per store view, and translate a product and the home page.

Bijgewerkt November 2026Video ongeveer 6 minNiveau Winkeleigenaren en developers

A store view per language

Website, store and store view: the website holds customers, prices and the timezone; the store holds the root category; the store view holds the language. One website can have many store views, one per language, that share the catalog and the cart.

VeldOur valueOpmerking
StoreMain Website StoreThe store whose catalog the new language shows.
NaamTürkçeCustomers see this name in the language switcher, so write it in its own language.
CodetrLowercase letters, numbers and underscores. It is used in URLs and on the command line.
StatusEnabled
Sort Order0Volgorde in de taalschakelaar.

Admin: Stores › All Stores › Create Store View, daarna Save Store View and confirm the dialog.

Locale Options per store view

Stores › Configuration › General › Locale Options with the scope switcher on the store view. Two things to know:

  • In production mode the Locale field is locked in the admin. The locale is set on the command line (config:set), together with the static files for that locale.
  • Timezone has no store view scope: it is a website setting, and all store views of one website share it.

Language packs with Composer

Magento’s own magento/language-* packages contain only a language.xml, no translations. The texts come from community packs. The two we installed and tested on Magento 2.4.9 with PHP 8.5:

PakketVersieUitgebrachtLicentie
splendidinternet/mage2-locale-de-de (Splendid Internet)1.74.317 November 2026OSL-3.0
hidonet/magento2-language-tr_tr (Hidonet)1.0.526 October 2026OSL-3.0

As the Magento file owner, in the Magento folder:

ls vendor/magento/language-de_de

bin/magento maintenance:enable

composer require splendidinternet/mage2-locale-de-de hidonet/magento2-language-tr_tr

for p in splendidinternet/mage2-locale-de-de hidonet/magento2-language-tr_tr; do composer show $p | grep -E '^(name|versions|released|license)'; done

Locale, static files and indexes

The store view tr gets tr_TR (German de got de_DE in Lesson 4):

bin/magento config:set --scope=stores --scope-code=tr general/locale/code tr_TR

Static files for every locale in use. In production mode a locale without deployed static files shows pages without styles:

bin/magento setup:static-content:deploy -f en_US en_GB de_DE tr_TR

A new store view needs its own index rows (products, prices, search):

bin/magento indexer:reindex

bin/magento maintenance:disable && bin/magento cache:flush

Then as root, because OPcache on our server does not check files for changes (Lesson 1):

systemctl reload php8.5-fpm

Product names per store view

Catalog › Products, open the product, switch Scope to the store view. Untick Use Default Value on each field you translate: here Product Name (MageBooster Seyahat Kupası) and, under Search Engine Optimization, URL Key (magebooster-seyahat-kupasi). Every untouched field keeps the default value. Category names, attribute labels and option labels work the same way.

A home page per store view

CMS pages are assigned to store views. Content › Pages › Add New Page: Page Title Ana Sayfa, Content Heading, URL Key ana-sayfa, and under Page in Websites only the Türkçe store view. Then Stores › Configuration › General › Web › Default Pages, scope Türkçe: CMS Home Page = Ana Sayfa. CMS blocks work the same way: one copy per language.

Saved settings invalidate the configuration cache:

bin/magento cache:flush

The language switcher

Luma shows the language switcher in the header as soon as a store has more than one store view. On our test store: English (Default Store View), German with menus and buttons from the German pack, and Türkçe with its own home page and the product under its Turkish name and URL.

OptionAddressWaar
One domain, language in a cookiehttps://www.example.com/Default (this lesson)
Storecode in de URLhttps://www.example.com/tr/Web › Url Options › Add Store Code to Urls
One domain per languagehttps://www.example.com.tr/Lesson 11 (multisite)

Downloads

languages-commands.shDownloaden

#!/bin/bash
# MageBooster Lesson 16: store languages in Magento 2.4.9. Run the parts one by one on the server.
# First create the store view in the admin: Stores > All Stores > Create Store View (here: Türkçe, code tr).

# 1) As the Magento file owner, in the Magento folder (production mode)
cd /var/www/magento
ls vendor/magento/language-de_de    # Magento's own language package: no CSV inside
bin/magento maintenance:enable
composer require splendidinternet/mage2-locale-de-de hidonet/magento2-language-tr_tr
for p in splendidinternet/mage2-locale-de-de hidonet/magento2-language-tr_tr; do composer show $p | grep -E '^(name|versions|released|license)'; done

# 2) The language of the store view "tr" (German "de" got de_DE in Lesson 4)
bin/magento config:set --scope=stores --scope-code=tr general/locale/code tr_TR

# 3) Static files for every locale your store views and admin users use, then the indexes
bin/magento setup:static-content:deploy -f en_US en_GB de_DE tr_TR
bin/magento indexer:reindex
bin/magento maintenance:disable && bin/magento cache:flush

# 4) As root: OPcache without timestamp checks needs a PHP-FPM reload (your PHP version)
systemctl reload php8.5-fpm

# 5) After the admin changes (product name, CMS page, Default Pages), as the Magento file owner
bin/magento cache:flush
languages-config.shDownloaden

#!/bin/bash
# MageBooster Lesson 16: store view settings from the command line. Use your own store view codes.
cd /var/www/magento
sudo -u magento bin/magento config:show --scope=stores --scope-code=tr general/locale/code
sudo -u magento bin/magento config:set --scope=stores --scope-code=de general/locale/code de_DE
sudo -u magento bin/magento config:set --scope=stores --scope-code=tr general/locale/code tr_TR
# the language in the address: https://your-domain/tr/ (all store views)
sudo -u magento bin/magento config:set web/url/use_store 1
sudo -u magento bin/magento cache:flush

Problemen oplossen

SymptoomOorzaak en oplossing
The new store view shows pages without stylesProduction mode: its locale has no static files. Run setup:static-content:deploy with that locale, flush the cache.
Buttons stay in English after the installThe store view locale is still en_US (config:show --scope=stores --scope-code=...), or the cache was not flushed / PHP-FPM not reloaded.
The Locale field is greyed outProduction mode locks it. Use bin/magento config:set --scope=stores.
No products or empty search in the new store viewVoer bin/magento indexer:reindex after creating the store view.
No language switcher on the storefrontThe store needs at least two active store views; one domain per language (Lesson 11) hides it.
A word in the pack is wrongOverride it in your theme: app/design/frontend/Vendor/theme/i18n/tr_TR.csv, then deploy static files.

Volgende les

Lesson 17: Locale and currencies: euro, pound and Turkish lira.

Opening your store in more languages?We set up multi-language Magento stores.

▶ Bekijk alle MageBooster-lessen op YouTube: alle lessen op volgorde · abonneer je op het kanaal

Zie je een fout op deze pagina? Laat het ons weten, dan passen we het meteen aan.

Gratis webshop-audit

Stuur ons de gegevens van je webshop. We controleren snelheid, beveiliging en extensies en sturen je binnen 3 werkdagen drie quick wins.

Laten we praten

Vraag een offerte aan

Vertel ons over je webshop, dan reageren we binnen één werkdag. Liever chatten? Stuur ons een WhatsApp

MageBooster Boek een UnoPim-demo Bekijk UnoPim live met producten zoals de jouwe. Een nieuwe PIM of een overstap van Akeneo: we sturen je een plan, een planning en een offerte.
✓ Officiële UnoPim-partner✓ AI-agent ingericht voor je team✓ Gekoppeld aan Magento
MageBooster Start je Hyvä-project Vanaf nul of vanuit je huidige webshop. We reageren met een projectplan, een tijdlijn en een offerte.
✓ Design en structuur door ons✓ Voor Hyvä geoptimaliseerde server✓ Bonusmodules inbegrepen

MageBooster

Wij nemen contact met je op

Laat je gegevens en het adres van je webshop achter. We bekijken eerst je webshop en nemen binnen één werkdag contact op, via telefoon, WhatsApp of e-mail, wat jij het liefst hebt.

Word partner