A multilingual store opens access to new markets and audiences. OpenCart has a powerful built-in localization system.
Adding a New Language
- System → Localisation → Languages
- Click "+" (Add New)
- Fill in language data
- Upload language pack
Language Pack Structure
catalog/language/en-gb/
├── en-gb.php # General texts
├── common/
│ ├── header.php
│ └── footer.php
├── product/
│ ├── product.php
│ └── category.php
└── checkout/
└── cart.php
Language File Format
<?php
// catalog/language/en-gb/common/header.php
// Text
$_['text_home'] = 'Home';
$_['text_wishlist'] = 'Wishlist (%s)';
$_['text_shopping_cart'] = 'Shopping Cart';
$_['text_account'] = 'My Account';
$_['text_login'] = 'Login';
$_['text_logout'] = 'Logout';
$_['text_checkout'] = 'Checkout';
$_['text_search'] = 'Search';
Translating Store Content
Products
Catalog → Products → Edit
↓
"Data" tab for each language:
- Name
- Description
- Meta Title
- Meta Description
- Meta Keywords
- Tags
Categories
Catalog → Categories → Edit
↓
Similarly for each language:
- Name
- Description
- Meta fields
Quality translation is not just word replacement. Adapt content to the cultural characteristics of the target audience.
— Localization vs Translation
SEO for Multilanguage
SEO URLs
Example URL structure:
Ukrainian:
/uk/kategoriya/smartfony/iphone-15
English:
/en/category/smartphones/iphone-15
German:
/de/kategorie/smartphones/iphone-15
Hreflang Tags
<!-- Add to header.twig -->
<link rel="alternate" hreflang="uk" href="https://store.com/uk/product" />
<link rel="alternate" hreflang="en" href="https://store.com/en/product" />
<link rel="alternate" hreflang="x-default" href="https://store.com/en/product" />
Automatic Language Detection
// Browser language detection
$browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$languages = [
'uk' => 'uk-ua',
'en' => 'en-gb',
'ru' => 'ru-ru'
];
if (isset($languages[$browser_lang])) {
// Redirect to corresponding version
}
// Geolocation detection (IP)
// Use MaxMind GeoIP or similar services
Language Switcher
{# common/language.twig #}
<div class="language-switcher">
{% for language in languages %}
<a href="{{ language.url }}"
class="{% if language.code == current_language %}active{% endif %}">
<img src="{{ language.image }}" alt="{{ language.name }}">
{{ language.name }}
</a>
{% endfor %}
</div>
Currencies and Formats
// Locale settings
setlocale(LC_ALL, 'en_US.UTF-8');
// Date format
$_['date_format_short'] = 'm/d/Y';
$_['date_format_long'] = 'F d, Y';
// Number format
$_['decimal_point'] = '.';
$_['thousand_sep'] = ',';
Localization Tips
- Consider text direction (RTL for Arabic, Hebrew)
- Adapt images and banners
- Localize email templates
- Translate system messages
- Test forms with different data formats
Conclusion
Multilanguage requires attention to detail: from technical setup to cultural content adaptation. Invest in quality translations — it will pay off with increased conversion in new markets.