Free cookie consent management tool by TermsFeedAktualizacja preferencji plików cookie

Language Flags Module for Magento 2

€30.75 €25.00
COMPOSER Installation
M2-FLAGS
Requires changes to the template
No
Minor changes
Significant changes
Requires programming knowledge
No
Basic
Advanced
Difficulty in configuration
Impact on performance
Compliance with Magento standards
  • Polnisch Polnisch
  • English English
  • 2.4.9
  • 2.4.8
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.3
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.7
  • 2.3.6
  • 2.3.5
  • 2.3.4

One switcher for multiple language scenarios

Kowal_LanguageFlags solves the problem of a poorly readable language switcher in Magento 2. Instead of the standard list of store view codes, the customer sees an intuitive switcher with flags, language names, and the ability to switch not only between store views, but also between websites and external stores.

This solution is especially useful where:

  • one store supports several language versions;
  • different markets operate as separate websites;
  • part of the traffic should go to another Magento instance;
  • one consistent switcher is needed for different types of target addresses.

What the module provides

  • flags for store views;
  • flags for other websites in the same Magento instance;
  • flags for any URLs, for example to a separate Magento store;
  • custom labels and shortened language codes;
  • two display variants: dropdown and inline;
  • support for the native Magento switcher and the widget.

Business benefits

  • faster recognition of the language version by the customer;
  • fewer errors when selecting a market or language;
  • a more professional presentation of a multilingual store;
  • the ability to conveniently connect multiple storefronts in one navigation point;
  • a shorter implementation path than building a dedicated component from scratch.

Technical benefits

  • configuration from the admin panel;
  • compatibility with the native Magento mechanism for store view switching;
  • one configuration for the native switcher and the widget;
  • a default set of ready-made SVG flags copied to pub/media/language_flags/ during installation;
  • no need to build a separate data table at the start;
  • the option to deploy via Composer.

Ready-made flag set

The module includes a set of ready-made SVG icons in 24x18 format, which can be automatically copied to pub/media/language_flags/ during bin/magento setup:upgrade.

Available flags:

  • at Austria
  • be Belgium
  • bg Bulgaria
  • cy Cyprus
  • cz Czech Republic
  • de Germany
  • dk Denmark
  • ee Estonia
  • es Spain
  • eu European Union
  • fi Finland
  • fr France
  • gr Greece
  • hr Croatia
  • hu Hungary
  • ie Ireland
  • it Italy
  • lt Lithuania
  • lu Luxembourg
  • lv Latvia
  • mt Malta
  • nl Netherlands
  • pl Poland
  • pt Portugal
  • ro Romania
  • se Sweden
  • si Slovenia
  • sk Slovakia
  • uk United Kingdom
  • us United States

Who it is for

The module is intended for:

  • Magento 2 stores operating in multiple markets;
  • installations with multiple store views and websites;
  • projects where some language versions operate outside the main storefront;
  • teams that want to implement a clear switcher without rebuilding Magento core.

Example use cases

One Magento, multiple store views

The store has the following versions:

  • PL
  • EN
  • DE

Each of them can have a separate flag and label assigned.

One Magento, multiple websites

The store uses separate websites for different countries, for example:

  • Poland
  • Germany
  • France

The module allows these websites to be shown in the same switcher as local store views.

Distributed storefronts

Some markets operate in a different Magento instance or under a different domain. In such a case, Custom URL Flags allow them to be added to a shared switcher.

Implementation result

The customer gets one consistent language and market switcher, and the administrator can manage it from the Magento configuration without creating additional frontend components.

Installation and configuration guide for the Magento 2 Language Flags module

Installation

Installation via Composer

composer require kowal/module-language-flagsbin/magento module:enable Kowal_LanguageFlagsbin/magento setup:upgradebin/magento cache:flush

Installation from the Git repository

composer config repositories.kowal-language-flags vcs https://github.com/kowalco/language-flagscomposer require kowal/module-language-flagsbin/magento module:enable Kowal_LanguageFlagsbin/magento setup:upgradebin/magento cache:flush

Additional commands for production mode

bin/magento setup:di:compilebin/magento setup:static-content:deploy -fbin/magento cache:flush

Configuration location

Admin panel:

Stores > Configuration > Kowal > Language Flags

CMS editor widget

The module provides the following widget:

Language Flags Switcher

It can be inserted in:

  • Content > Blocks
  • Content > Pages

Editor path:

Edit > Insert Widget > Language Flags Switcher

The widget supports:

  • dropdown or inline mode;
  • showing or hiding language names;
  • an additional CSS class.

Default flags

During bin/magento setup:upgrade, the module copies default SVG files from:

view/frontend/web/images/flags/

to the directory:

pub/media/language_flags/

Only missing files are copied, without overwriting existing flags.

General configuration

The General Settings section contains fields that control the module behavior.

Enable Module

Path:

language_flags/general/enabled

Meaning:

  • Yes enables the module;
  • No disables the module on the frontend.

Replace Native Store View Switcher

Path:

language_flags/general/native_enabled

Meaning:

  • Yes replaces the native Magento switcher with a flag version;
  • No leaves the native switcher unchanged.

Native Display Mode

Path:

language_flags/general/native_display_mode

Available options:

  • dropdown
  • inline

Meaning:

  • dropdown shows the current item and a dropdown list of the remaining ones;
  • inline shows all flags at once in a single line.

Show Language Names

Path:

language_flags/general/show_labels

Meaning:

  • Yes shows language names next to flags;
  • No hides the names in the main view, but keeps them for accessibility.

Fallback to Store View Name

Path:

language_flags/general/fallback_to_store_name

Meaning:

  • Yes uses the store view name when Label is not filled in;
  • No uses the store view code in uppercase.

Inline Flag Gap (px)

Path:

language_flags/general/inline_gap

Meaning:

  • sets the spacing between switcher elements in inline mode;
  • the value is measured in pixels;
  • the default value is 8.

Icon Scale (%)

Path:

language_flags/general/icon_scale_percent

Meaning:

  • 100 preserves the original image dimensions;
  • a lower value reduces width and height proportionally;
  • scales flags in both rendering modes.

Configuration of flag tables

The module supports three separate sets of entries:

  1. Store View Flags
  2. Website Flags
  3. Custom URL Flags

On the frontend, the entries are combined into one set of switcher elements.

Store View Flags

Path:

language_flags/general/flag_config

Purpose:

Configuration of flags for store views handled by the native Magento mechanism.

Form columns

Store Code

Selects a store view from the Magento list.

Meaning:

  • assigns a flag to a specific store view;
  • uses the native Magento store view switching mechanism.

Flag File

The path to the flag file selected from the built-in file picker.

Meaning:

  • defines the image displayed on the frontend;
  • can be saved as pl.svg or language_flags/pl.svg;
  • relative paths are resolved from the directory:
pub/media/language_flags/

Label

The full language or market name, for example:

  • Polish
  • English
  • German

Meaning:

  • is displayed next to the flag when Show Language Names is enabled;
  • also serves as helper text for accessibility.

Short Label

A shortened label, for example:

  • PL
  • EN
  • DE

Meaning:

  • is used in a more compact view;
  • can be used instead of the full name.

Website Flags

Path:

language_flags/general/website_flag_config

Purpose:

Configuration of flags pointing to other websites in the same Magento instance.

How it works

  • clicking does not perform the native store switch post;
  • the entry is rendered as a regular link to the target website base URL;
  • the current website is not added as a separate option.

Form columns

Website

Selects a Magento website from the list.

Meaning:

  • defines the target website for the entry;
  • is used to retrieve the base URL of the target storefront.

Flag File

Works the same as in Store View Flags.

Label

The full label displayed on the frontend.

If left empty:

  • the module will use the website name.

Short Label

A shortened label, for example:

  • UK
  • DE
  • FR

If left empty:

  • the module will use the website code in uppercase.

Custom URL Flags

Path:

language_flags/general/custom_url_flag_config

Purpose:

Configuration of flags pointing to any URLs, for example to another Magento instance or an external store.

Form columns

URL

The target link address.

Examples:

  • https://example.de/
  • https://en.example.com/
  • https://shop.example.cz/

Meaning:

  • the entry is rendered as a regular href link;
  • it does not use the native Magento store switch mechanism.

Flag File

Works the same as in the other tables.

Label

The full label displayed on the frontend.

If left empty:

  • the module will try to use the host from the URL.

Short Label

A shortened label for the compact variant.

If left empty:

  • the module will build a shortcut based on the host;
  • if that is not possible, it will use the URL value.

Preparing flag files

Recommended location:

pub/media/language_flags/

Recommended formats:

  • svg
  • png

Examples of file names:

pl.svgen.svgde.svgfr.svg

Basic configuration flow

  1. Enable the module via Enable Module.
  2. Decide whether you want to replace the native Magento switcher.
  3. Set Native Display Mode.
  4. Add flag files to pub/media/language_flags/.
  5. Complete Store View Flags.
  6. Add optional entries in Website Flags.
  7. Add optional entries in Custom URL Flags.
  8. Save the configuration and clear the cache.

Useful CLI commands

bin/magento module:status Kowal_LanguageFlagsbin/magento cache:cleanbin/magento cache:flush

Questions and Answers

Question
What does the Language Flags module do?
Answer
It allows country flags to be displayed graphically in the language switcher, making the store interface look more professional and easier to read.
Question
What are the main benefits of using flags?
Answer
They add professionalism and streamline navigation, making it easier for customers to choose a language and improving the overall look of the store.
Question
What customization options does the module offer?
Answer
It allows you to change the size and content of the flags, hide the names of language views, and upload your own graphic files in JPG/JPEG/GIF/PNG formats.
Question
Which versions of Magento is it compatible with?
Answer
It supports Magento from version 2.3.4 to 2.4.7 and newer.
Question
Which versions of Magento is it compatible with?
Answer
The module can be purchased directly from the Kowal store and installed in your store; the company also offers support with implementation and customization to meet the client’s needs.
Write Your Own Review
You're reviewing:Language Flags Module for Magento 2
Your Rating
Products