// German strings address the operator as "Sie" — never "Du". // The usertest panel flagged Du/Sie breaks (store search, flow // empty states) as a recurring trust issue for the regulated // audience, so this guard scans the DE catalog for unambiguous // second-person-singular forms. Progress messages in the first // person ("Starte …" = the app announcing its own action) stay // legal; only forms that address the reader are rejected. import 'dart:convert'; import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; void main() { test('DE catalog contains no informal (Du) address', () { final raw = File('lib/l10n/app_de.arb').readAsStringSync(); final map = jsonDecode(raw) as Map; // Pronouns + possessives + common 2nd-person-singular verb // forms. Word-bounded so "individuell" or "Bedingungen" // never match. final informal = RegExp( r"\b(du|dich|dir|dein|deine|deiner|deinem|deinen|deins|" r"brauchst|tippst|willst|kannst|hast|bist|machst|siehst|" r"klickst|wählst|öffnest|startest|versuchst|versuch's)\b", caseSensitive: false, ); final offenders = []; map.forEach((key, value) { if (key.startsWith('@') || value is! String) return; final m = informal.firstMatch(value); if (m != null) { offenders.add('$key: "${m.group(0)}" in "$value"'); } }); expect( offenders, isEmpty, reason: 'German UI strings must use the formal Sie address:\n' '${offenders.join('\n')}', ); }); }