fix(l10n): consistent formal address across the German catalog
Some checks are pending
Security / Security check (push) Waiting to run
Some checks are pending
Security / Security check (push) Waiting to run
Store search, security panel, System-AI fix hint and the approvals payload hint addressed the operator informally while the rest of the app uses Sie — the panel flagged the break on every second screen. All DE strings now use the formal address, and a guard test rejects any future informal form in app_de.arb. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
3e1ce6e1fd
commit
ca01fd2ec0
3 changed files with 51 additions and 8 deletions
43
test/l10n_formality_test.dart
Normal file
43
test/l10n_formality_test.dart
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// 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<String, dynamic>;
|
||||
// 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 = <String>[];
|
||||
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')}',
|
||||
);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue