Laravel localization in Spanish Español

Everything you need to ship Spanish in a Laravel app: the right locale codes, the exact plural forms trans_choice() expects, real localized Carbon output and Latin-script considerations. Every value on this page was generated by running ICU, CLDR and Carbon — not copied from another article.

ISO 639-1

es

Script / Direction

Latin · LTR

Plural forms (Laravel)

2

Text vs English

Expands

Locale codes

Set the base locale in config/app.php. For regional variants, Spanish commonly uses: es_ES, es_MX, es_AR, es_CO, es_CL

// config/app.php
'locale' => 'es',
'fallback_locale' => 'en',

// Or switch at runtime
App::setLocale('es');

Plural rules: what Spanish actually needs

CLDR defines 3 cardinal categories for Spanish. The sample numbers below were computed by ICU for this exact locale:

CLDR category Numbers that select it
one 1
many 1000000
other 0, 2–130, 200, 1000, 1.5

Laravel's trans_choice() maps numbers to 2 pipe-separated forms for this locale:

Form index Numbers that select it
0 1
1 0, 2–130, 200, 1000
// lang/es/messages.php
'items' => ':count item|:count items'

// Usage
trans_choice('messages.items', $count, ['count' => $count]);

Try any number live in the pluralization tester.

Localized dates with Carbon

Real output for Spanish (es locale), generated by Carbon for March 21, 2026:

$date = now()->locale('es');

$date->translatedFormat('l, j F Y');
// "sábado, 21 marzo 2026"

$date->isoFormat('LLLL');
// "sábado, 21 de marzo de 2026 14:30"

$date->isoFormat('L');
// "21/03/2026"

$date->subDays(3)->diffForHumans();
// "hace 3 meses"

What to watch out for in Spanish

One language, twenty markets, several conventions

Spanish is spoken natively by around 500 million people across more than twenty countries, and the decision that shapes every other one is which Spanish you are shipping. Unlike German or French, where regional variation is mostly vocabulary and formatting, Spanish varies in the pronoun system itself — which means the verb conjugations change too.

Spain (es_ES) Latin America (es_MX, es_AR…)
Informal plural "you" vosotros ustedes
Computer ordenador computadora
Mobile phone móvil celular
To upload subir cargar / subir
Car coche carro / auto
Decimal separator 1.234,56 1,234.56 (Mexico) / 1.234,56 (Argentina)

The vosotros form is the sharpest divide. It exists only in Spain, and Latin American readers find it archaic or theatrical. Conversely, Spaniards notice its absence immediately. There is no neutral form that satisfies both, which is why most products either pick one market or maintain es_ES and es_419 (Latin America) as separate locales.

If you can only afford one Spanish, a "neutral" Latin American Spanish reaches the larger audience and reads as merely formal rather than wrong in Spain. Avoid country-specific slang, use ustedes, and prefer vocabulary that is understood everywhere even when it is not the most idiomatic choice in any single market.

Argentina and Uruguay add voseovos instead of , with its own conjugations (vos tenés rather than tú tienes). If those markets matter commercially, they need their own locale rather than a shared Latin American one.

Tú or usted, and why it matters less than in German

Spanish has the same formal-informal split as German, but the conventions in software have shifted decisively toward the informal across almost all consumer and business products. The formal usted now reads as distant in most contexts, and survives mainly in banking, government, healthcare and communications with older audiences.

English Informal (tú) Formal (usted)
Your account tu cuenta su cuenta
Save changes Guarda los cambios Guarde los cambios
Do you want to continue? ¿Quieres continuar? ¿Desea continuar?
Log in Inicia sesión Inicie sesión

Note that usted takes third-person verb forms, so the grammatical change runs through the whole sentence rather than just the pronoun. As in German, this is not a decision you can revisit cheaply — switching means retranslating every string that addresses the user.

A common middle path in interface copy is to avoid addressing the user directly at all. Rather than "Guarda tus cambios", the impersonal infinitive "Guardar cambios" works as a button label in both registers and across all markets. Spanish interfaces use this construction far more than English ones do.

Inverted punctuation and the characters people forget

Spanish opens questions and exclamations with inverted marks: ¿Quieres continuar? and ¡Guardado!. These are mandatory, not decorative, and their absence is the single most reliable sign that a Spanish string was written by a non-native speaker or machine-translated carelessly.

They also break naive validation. A regex that strips "punctuation" using an ASCII-only character class will remove ¿ and ¡ while leaving the closing marks, producing sentences that look half-finished. Any string-cleaning code applied to user-facing copy needs to be Unicode-aware.

The letter ñ is a distinct letter of the alphabet rather than an accented n, and it sorts between n and o. Treating it as n for sorting produces orders that look wrong to Spanish readers, and stripping the tilde changes meaning outright — año (year) becomes ano (anus), which is a genuinely common and embarrassing production bug.

Sorting Spanish correctly

<?php

// Wrong: byte order puts 'ñ' after 'z'
sort($names);

// Right: locale-aware collation
$collator = new Collator('es_ES');
$collator->sort($names);

Accented vowels (á é í ó ú) and the diaeresis (ü in pingüino) carry meaning too: esta (this) and está (is) are different words. Ensure your database collation, search indexing and any normalisation step preserve them rather than folding them away.

Text expansion and gender agreement

Spanish runs roughly twenty to twenty-five per cent longer than English. It is less extreme than German because Spanish separates words rather than compounding them, so text wraps naturally, but buttons and fixed-width labels still need room.

English Spanish Growth
Save Guardar +75%
Search Buscar +50%
Settings Configuración +63%
Sign up Registrarse +38%
Delete Eliminar +33%

Every Spanish noun is masculine or feminine, and adjectives, articles and past participles must agree with it. This makes sentence assembly from fragments unreliable in exactly the way it is in German, though for a different reason.

Agreement makes concatenation fail

// 'Deleted' must agree with what was deleted
// el archivo eliminado   (masculine)
// la carpeta eliminada   (feminine)
// los archivos eliminados (masculine plural)

// So this cannot work:
__('status.deleted') . ' ' . __("types.{$type}")

Gender-inclusive forms are an active and unsettled question in Spanish. Variants such as todes or tod@s appear in some communities but are not accepted in formal writing and are rejected by the Real Academia Española. Most products use the traditional masculine plural as the generic form, or rephrase to avoid the issue entirely — Bienvenido becomes Te damos la bienvenida, which sidesteps gender altogether.

Plurals, dates and numbers

Spanish takes two plural forms, so trans_choice() works with a simple two-part string. Formation is regular: add -s after a vowel, -es after a consonant. Archivo becomes archivos, usuario becomes usuarios, and mes becomes meses.

The zero case uses the plural, as in English: 0 archivos. Laravel maps zero to the "other" form for Spanish, so this works by default provided the translator supplied the plural rather than copying the singular.

Dates are written day-first, and — importantly — months and weekdays are lowercase unless they begin a sentence. 21 de marzo de 2026, not 21 de Marzo de 2026. English-centric formatting code that capitalises month names is a recurring and visible error.

Spain Mexico Argentina
Thousands 1.234.567 1,234,567 1.234.567
Decimal 1234,56 1234.56 1234,56
Currency 1.234,56 € $1,234.56 $ 1.234,56
Short date 21/03/2026 21/03/2026 21/03/2026

Mexico following the English convention for separators while Spain and Argentina invert it is the trap here. A single "Spanish" number formatter will be wrong for a large part of your audience, so format from the full locale rather than the language code alone.

Search, sorting and stored data

Spanish text causes problems below the presentation layer, in the places where strings are compared rather than displayed. Getting these wrong produces bugs that look like missing data rather than like translation issues, which is why they tend to survive for a long time.

Search is the most visible. A user typing anos expects to find años, and a user typing Jose expects to find José. Accent-insensitive matching is the expected behaviour in Spanish-language search, and it requires either a collation that folds accents or an explicitly normalised search column alongside the display value.

Accent-insensitive search in MySQL

-- utf8mb4_unicode_ci folds accents for comparison
-- while preserving them in storage
ALTER TABLE products
    MODIFY name VARCHAR(255)
    CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

-- Now: WHERE name LIKE '%ano%' matches 'año'

Sorting needs the opposite care. Spanish sorts ñ as its own letter between n and o, so niño comes after nino and before nota. A byte-order sort places ñ after z, which puts every word containing it at the end of the list. Use PHP's Collator or a locale-aware database collation rather than sort().

Historically ch and ll were treated as single letters in Spanish alphabetisation, and you will still find legacy systems that sort that way. The Real Academia Española abandoned the practice in 1994, so modern collations treat them as two letters each. Unless you are matching an existing dataset, follow the modern rule.

Finally, be careful with case transformations on Spanish text. Uppercasing ñ to Ñ requires multi-byte-aware functions; strtoupper() will corrupt it, as it will every accented vowel. Use mb_strtoupper() or Laravel's Str::upper() throughout.

Getting the locale wiring right

Most Spanish bugs that reach production are not translation errors but locale-configuration errors: the strings are correct and the framework was never told which Spanish to use. Because Spanish has so many regional variants, falling back to a bare language code silently picks defaults that are wrong for most of your users.

Set the full locale wherever formatting happens, not just the translation locale. Laravel resolves translations from lang/es/, but Carbon, the Number helper and PHP's intl formatters each need the region to decide separators, currency placement and month names. A user in Mexico and a user in Spain should get different numbers from the same code path.

Store the user's locale as a full tag such as es-MX rather than es, and derive the translation locale from it. That way adding a regional variant later is a data change rather than a migration, and users who set their preference once do not silently drift back to a default.

Install the community-maintained Laravel-Lang Spanish files rather than translating framework strings yourself. Validation messages, password reset text and pagination labels are already professionally translated, they cover the regional variants, and writing your own guarantees worse copy alongside more maintenance.

Finally, remember that a fallback locale of English is visible. When a Spanish key is missing, the user sees an English sentence in the middle of Spanish copy, which reads as broken rather than as graceful degradation. A key-parity check in CI is a better safety net than a fallback nobody notices until a customer does.

What ships broken most often

Spanish is forgiving in layout terms and unforgiving in orthography. The layout will survive; the missing inverted question mark will be the first thing a native speaker mentions.

Framework strings already translated

Laravel's own validation, auth and pagination strings are maintained in Spanish by the open-source Laravel-Lang project (MIT). Install them, then manage your app's own strings live:

composer require laravel-lang/common --dev
php artisan lang:add es
php artisan lang:update

Translate your app into Spanish today

Import your lang files, translate every key into Spanish with one AI click, and publish changes live — no deploy. Set up in 5 minutes.

We use cookies to improve your experience and analyze site traffic. Cookie Policy

Cookie Preferences

Essential

Required for the site to work

Analytics

Help us improve the site

Marketing

Personalized ads and content