Locale and translations

One setting, $padLocale, says which language and conventions a request is written in. The {trans} tag and the trans, currency and localDate functions all read it.

PHP
fragments/locale_1.php
HTML
fragments/locale_1.pad
Result
<?php

// The page picks Dutch; an application listing $padLocales lets the visitor's
// Accept-Language or ?lang= choose instead.

$padLocale = 'nl';

$count = 3;
$user = 'Ann';
$total = 1234.5;
$when = '2026-10-05';

?>
<h4>{trans 'cart.title'}</h4>
<p>{trans 'cart.items', count=$count} - {trans 'cart.owner', name=$user}</p>
<p>{$total | currency('EUR', 'nl_NL')} - {$when | localDate('d MMMM y')}</p>

Je winkelwagen

3 artikelen - Bewaard voor Ann

€ 1.234,50 - 5 oktober 2026

Catalogs

The texts live in _lang/<locale>.json, one flat object of keys:

{
  "cart.title": "Je winkelwagen",
  "cart.items": "%d artikel|%d artikelen",
  "cart.owner": "Bewaard voor :name"
}

Choosing the locale