English language localization setup for website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Development stages

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1171
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1094
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    831
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    879
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    453

Setting up website localization for English language

Adding English locale to your website is a standard task when reaching international audience. English is the fallback language for most i18n systems: if translation for another language is missing, the English version is shown.

Translation structure

resources/
  lang/
    en/
      messages.php
      validation.php
      auth.php
      pagination.php
    ru/
      messages.php
      ...
// resources/lang/en/messages.php
return [
    'welcome'       => 'Welcome to our website',
    'catalog'       => 'Catalog',
    'cart'          => 'Shopping Cart',
    'checkout'      => 'Checkout',
    'search'        => 'Search',
    'add_to_cart'   => 'Add to Cart',
    'price'         => 'Price',
    'in_stock'      => 'In Stock',
    'out_of_stock'  => 'Out of Stock',
    'items_count'   => ':count item|:count items',
];

Laravel supports pluralization via |:

trans_choice('messages.items_count', 1)  // "1 item"
trans_choice('messages.items_count', 5)  // "5 items"

Formatting in American and British English

// en-US vs en-GB — different date and number formats
const date = new Date('2026-03-28')

new Intl.DateTimeFormat('en-US').format(date)  // "3/28/2026"
new Intl.DateTimeFormat('en-GB').format(date)  // "28/03/2026"

new Intl.DateTimeFormat('en-US', { dateStyle: 'long' }).format(date)
// "March 28, 2026"

new Intl.DateTimeFormat('en-GB', { dateStyle: 'long' }).format(date)
// "28 March 2026"

// Numbers
new Intl.NumberFormat('en-US').format(1234567.89)  // "1,234,567.89"
new Intl.NumberFormat('en-GB').format(1234567.89)  // "1,234,567.89"

// Currency
new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(99.99)
// "$99.99"

new Intl.NumberFormat('en-GB', { style: 'currency', currency: 'GBP' }).format(99.99)
// "£99.99"

Detecting browser's preferred language

function detectLanguage(available: string[]): string {
  const preferred = navigator.languages ?? [navigator.language]

  for (const lang of preferred) {
    // Exact match: 'en-US'
    if (available.includes(lang)) return lang
    // Partial: 'en-US' → 'en'
    const base = lang.split('-')[0]
    if (available.includes(base)) return base
  }

  return 'en' // fallback
}

const userLang = detectLanguage(['ru', 'en', 'de'])

On the server: detection via Accept-Language header

// Laravel Middleware
namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;

class SetLocale
{
    private array $available = ['ru', 'en', 'de', 'fr'];

    public function handle(Request $request, Closure $next): mixed
    {
        // Priority: explicit parameter > session > browser header
        $locale = $request->get('lang')
            ?? $request->session()->get('locale')
            ?? $this->parseAcceptLanguage($request->header('Accept-Language'));

        $locale = in_array($locale, $this->available) ? $locale : 'ru';
        App::setLocale($locale);

        return $next($request);
    }

    private function parseAcceptLanguage(?string $header): string
    {
        if (!$header) return 'ru';

        preg_match_all('/([a-z]{2})(?:-[A-Z]{2})?(?:;q=([0-9.]+))?/', $header, $m);
        $langs = array_combine($m[1], array_map(
            fn($q) => $q === '' ? 1.0 : (float) $q,
            $m[2]
        ));
        arsort($langs);

        foreach (array_keys($langs) as $lang) {
            if (in_array($lang, $this->available)) return $lang;
        }

        return 'ru';
    }
}

English as default language for API

Many projects use English as API response language regardless of user locale:

// Error messages — always in English in API
return response()->json([
    'error' => 'Resource not found',
    'code'  => 'NOT_FOUND',
], 404);

// User-facing text — localized
return response()->json([
    'message' => __('messages.order_placed'), // per user locale
    'data'    => $order,
]);

SEO: hreflang

<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="ru" href="https://example.com/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

x-default indicates the page for users whose language doesn't match any available option.

Timeframe

Connecting English translations, configuring middleware and hreflang — 1 working day.