<?php
declare(strict_types=1);
function current_lang(): string {
  if (!empty($_GET['lang'])) { $_SESSION['lang'] = preg_replace('/[^a-z]/i','', (string)$_GET['lang']); }
  return $_SESSION['lang'] ?? 'en';
}
$__dict = [
  'en' => [
    'pay_now' => 'Pay Now',
    'payment' => 'Payment',
    'amount' => 'Amount',
    'reference' => 'Reference',
    'method' => 'Method',
    'card' => 'Card',
    'wallet' => 'Wallet',
    'bank_transfer' => 'Bank Transfer',
    'name_on_card' => 'Name on Card',
    'payment_token' => 'Payment Token',
    'process_payment' => 'Process Payment',
    'processing' => 'Processing',
    'success' => 'Success',
    'failed' => 'Failed',
    'history' => 'Payment History',
    'export_csv' => 'Export CSV',
    'consent_save' => 'Save my non‑sensitive details on this device',
  ],
  'fr' => [
    'pay_now' => 'Payer maintenant',
    'payment' => 'Paiement',
    'amount' => 'Montant',
    'reference' => 'Référence',
    'method' => 'Méthode',
    'card' => 'Carte',
    'wallet' => 'Portefeuille',
    'bank_transfer' => 'Virement bancaire',
    'name_on_card' => 'Nom sur la carte',
    'payment_token' => 'Jeton de paiement',
    'process_payment' => 'Traiter le paiement',
    'processing' => 'Traitement',
    'success' => 'Réussi',
    'failed' => 'Échoué',
    'history' => 'Historique des paiements',
    'export_csv' => 'Exporter CSV',
    'consent_save' => 'Enregistrer mes informations non sensibles sur cet appareil',
  ],
];
function t(string $key): string {
  global $__dict;
  $lang = current_lang();
  return $__dict[$lang][$key] ?? ($__dict['en'][$key] ?? $key);
}
?>
