locale property

String? get locale

Retrieves client locale from accept-language header.

Implementation

String? get locale {
  final raw = header('accept-language');
  if (raw == null || raw.isEmpty) return null;
  return raw.split(',').first.split(';').first.trim();
}