Laravel localization in Malay Bahasa Melayu
Everything you need to ship Malay 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
ms
Script / Direction
Latin · LTR
Plural forms (Laravel)
1
Text vs English
Similar
Locale codes
Set the base locale in config/app.php. For regional variants,
Malay commonly uses:
ms_MY, ms_BN, ms_SG
// config/app.php
'locale' => 'ms',
'fallback_locale' => 'en',
// Or switch at runtime
App::setLocale('ms');
Plural rules: what Malay actually needs
CLDR defines 1 cardinal category for Malay. The sample numbers below were computed by ICU for this exact locale:
| CLDR category | Numbers that select it |
|---|---|
| other | 0–130, 200, 1000, 1000000, 1.5 |
Laravel's trans_choice() maps numbers to
1 pipe-separated
form for this locale:
| Form index | Numbers that select it |
|---|---|
| 0 | 0–130, 200, 1000 |
// lang/ms/messages.php
'items' => ':count'
// Usage
trans_choice('messages.items', $count, ['count' => $count]);
This language has no grammatical plural, so a single form covers every number.
Try any number live in the pluralization tester.
Localized dates with Carbon
Real output for Malay (ms locale),
generated by Carbon for March 21, 2026:
$date = now()->locale('ms');
$date->translatedFormat('l, j F Y');
// "Sabtu, 21 Mac 2026"
$date->isoFormat('LLLL');
// "Sabtu, 21 Mac 2026 pukul 14.30"
$date->isoFormat('L');
// "21/03/2026"
$date->subDays(3)->diffForHumans();
// "3 bulan yang lepas"
What to watch out for in Malay
- No plural inflection (optional reduplication: buku-buku) and no verb tense conjugation.
- No grammatical gender; polite second person Anda is common in formal UI copy.
- Malaysia uses the decimal point with comma thousands separator (1,234.56), unlike Indonesian.
Framework strings already translated
Laravel's own validation, auth and pagination strings are maintained in Malay 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 ms
php artisan lang:update
Translate your app into Malay today
Import your lang files, translate every key into Malay with one AI click, and publish changes live — no deploy. Set up in 5 minutes.