Laravel localization in Hungarian Magyar
Everything you need to ship Hungarian 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
hu
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,
Hungarian commonly uses:
hu_HU
// config/app.php
'locale' => 'hu',
'fallback_locale' => 'en',
// Or switch at runtime
App::setLocale('hu');
Plural rules: what Hungarian actually needs
CLDR defines 2 cardinal categories for Hungarian. The sample numbers below were computed by ICU for this exact locale:
| CLDR category | Numbers that select it |
|---|---|
| one | 1 |
| other | 0, 2–130, 200, 1000, 1000000, 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/hu/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 Hungarian (hu locale),
generated by Carbon for March 21, 2026:
$date = now()->locale('hu');
$date->translatedFormat('l, j F Y');
// "szombat, 21 március 2026"
$date->isoFormat('LLLL');
// "2026. március 21., szombat 14:30"
$date->isoFormat('L');
// "2026.03.21."
$date->subDays(3)->diffForHumans();
// "3 hónapja"
What to watch out for in Hungarian
- Agglutinative with an extensive case-suffix system; suffixes attach to nouns, so raw placeholder concatenation breaks grammar.
- Vowel harmony determines which suffix variant attaches (e.g. -ban/-ben).
- Dates are written year-first with dots (2026. 03. 01.) and family name precedes given name.
- No grammatical gender (a single pronoun ő covers he/she); decimal comma with space as thousands separator.
Framework strings already translated
Laravel's own validation, auth and pagination strings are maintained in Hungarian 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 hu
php artisan lang:update
Translate your app into Hungarian today
Import your lang files, translate every key into Hungarian with one AI click, and publish changes live — no deploy. Set up in 5 minutes.