Phone App: finish the admin screen; translate the last English strings

Three loose ends from the last two commits, each of which was named as
deliberately-not-done and none of which is worth carrying further.

The phone's create-user sheet had no organization picker. The endpoint has
taken an `organization` since orgs existed and the Web App has offered the
choice all along, so a superadmin on the phone could only ever create
accounts in their own org - a silent restriction rather than a stated one.
The sheet now loads the orgs and offers them to a superadmin, with the same
blank "no organization" option and the same hint as the web. An admin still
gets no picker, because the server forces its own org on their members and a
picker that cannot change the outcome is a lie. The listing is manager-only
and can fail, in which case the picker offers only "no organization" rather
than blocking the form.

A locked role picker or delete action was greyed out with no reason given.
The web has explained itself in a title attribute since those guards existed,
and the sentences - admin.cantChangeOwnRole and the rest - have been sitting
translated in the phone's own language files since the screen was translated.
Hover has no touch equivalent, so the two controls take different routes: a
long-press on the role picker shows the reason as a tooltip, and the overflow
menu carries it under the action, because a disabled menu item cannot be
long-pressed and silently greying it out is the thing being fixed.

settings.integrations.* and charging.control.* were English-only in *both*
apps - 70 keys, identical text, identical key sets - so they are translated
once and land in all four language files. OCPP and CSMS are protocol names
and stay; product names (Toyota Connected, MyToyota, Anker Solix, Lexus) stay;
everything else follows the wording already in each language's file.

The Web App's files are edited as text rather than round-tripped through a
JSON dump, because they keep a blank line before every nested block and a
dump flattens it - a 900-line translation file is hard enough to read
without losing its paragraphs. Both diffs are purely additive as a result.

Both apps now have every key in all three languages: 738 in the web, and the
phone reports zero fallbacks. A new test locks that in - every key en.json
carries must exist in pl.json and da.json - and it was checked by deleting a
key and watching it fail, because a guard that cannot fire is not a guard.

Verified by flutter analyze (clean), flutter test - 21 pass, 1 of them new -
flutter build apk --debug, and npm run build for the Web App. The key checker
reports 575 static t() keys in the phone and 738 in the web resolving with no
fallbacks in either language.

Not verified: still nothing run against a live API Server or on a device. In
particular the organization picker's happy path - a superadmin creating an
account into a chosen org - has not been exercised end to end; it is the one
piece here that touches the API rather than only the language files.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tajniak81
2026-08-21 22:13:37 +02:00
co-authored by Claude Opus 5
parent 4372b870ac
commit dc6febf815
9 changed files with 508 additions and 43 deletions
+76
View File
@@ -66,6 +66,25 @@
"full": "Optaget",
"offPeak": "uden for spidsbelastning",
"homeCharger": "Hjemmelader"
},
"control": {
"title": "Laderstyring",
"connected": "Forbundet",
"disconnected": "Offline",
"serialPlaceholder": "Laderens serienummer (f.eks. A5191-XXXXXXXX)",
"refresh": "Opdater",
"status": "Stik",
"meter": "Energi",
"start": "Start opladning",
"stop": "Stop opladning",
"limit": "Strømgrænse",
"applyLimit": "Anvend grænse",
"clearLimit": "Ryd grænse",
"reset": "Genstart laderen",
"resetConfirm": "Genstart denne lader nu? En igangværende opladning bliver afbrudt. Indtast din adgangskode igen for at bekræfte.",
"resetPassword": "Din kontoadgangskode",
"connectHint": "Indtast laderens serienummer og opdater. Laderen skal være forbundet til DriverVaults OCPP-backend (opsættes under Indstillinger → Integrationer)."
}
},
@@ -222,6 +241,63 @@
"saveBio": "Gem beskrivelse"
},
"integrations": {
"title": "Integrationer",
"subtitle": "Forbind eksterne tjenester til din konto.",
"toyota": "Toyota Connected (MyToyota)",
"toyotaDesc": "Log ind med din MyToyota-konto for at hente køretøjsdata fra Toyota Connected Europe. Kun Europa.",
"enable": "Aktivér for min konto",
"enableOrg": "Aktivér for organisationen",
"unavailable": "Denne integration er slået fra af administratoren.",
"orgDisabled": "Denne integration er slået fra for din organisation.",
"scopeMy": "Mine indstillinger",
"scopeOrg": "Organisation",
"scopeHint": "Organisationens indstillinger gælder for alle i din organisation, der lader et felt stå tomt.",
"readOnly": "Denne integrations fælles indstillinger administreres i API-serverens panel; her er de skrivebeskyttede.",
"email": "MyToyota-e-mail",
"password": "MyToyota-adgangskode",
"brand": "Mærke",
"brandToyota": "Toyota",
"brandLexus": "Lexus",
"inherited": "Sat på et højere niveau",
"inheritedFrom": "Nedarvet fra {source}",
"sourceGlobal": "administratoren",
"sourceOrg": "din organisation",
"sourceUser": "dig",
"passwordKeep": "Lad feltet stå tomt for at beholde den gemte adgangskode.",
"test": "Test forbindelsen",
"testing": "Tester…",
"save": "Gem",
"saved": "Gemt ✓",
"connected": "Forbundet",
"notConnected": "Ikke forbundet",
"ankerSolix": "Anker Solix (V1 Smart EV Charger)",
"ankerSolixDesc": "Log ind med din Anker-konto for at hente laderdata fra Anker Solix-skyen.",
"ankerEmail": "E-mail til Anker-konto",
"ankerPassword": "Adgangskode til Anker-konto",
"country": "Land",
"countryHint": "Landekode på to bogstaver for din Anker-konto (f.eks. DE, GB, US).",
"controlMode": "Styringstilstand",
"controlModeHint": "Hvordan DriverVault styrer laderen over OCPP.",
"controlOff": "Fra (kun overvågning)",
"controlOwn": "Eget CSMS (fuld styring)",
"controlProxy": "Proxy-CSMS (videresendelse + styring)",
"controlTitle": "Laderstyring (OCPP)",
"controlOwnHint": "Laderen forbinder direkte til DriverVault som sit centralsystem. Peg laderens OCPP-backend på endepunktet nedenfor.",
"controlProxyHint": "DriverVault videresender til Ankers sky og kan indsætte kommandoer. Peg laderens OCPP-backend på endepunktet nedenfor.",
"controlProvisionSteps": "I Anker-appen (eller laderens OCPP-indstillinger) sættes OCPP-backend-URL'en til endepunktet og autorisationsnøglen til tokenet ovenfor.",
"chargerSerial": "Laderens serienummer",
"controlCheck": "Tjek status",
"controlGenerate": "Generér token",
"controlEndpoint": "OCPP-endepunkt",
"controlToken": "Autorisationstoken",
"controlTokenOnce": "Kopiér dette token nu — det vises kun én gang og kan ikke hentes frem igen.",
"controlRevoke": "Tilbagekald token",
"controlRevokeConfirm": "Tilbagekald denne laders styringstoken? Den bliver afbrudt og kan ikke forbinde igen, før du genererer et nyt.",
"controlConnected": "Forbundet til styrings-backend",
"controlDisconnected": "Ikke forbundet"
},
"org": {
"title": "Organisation",
"titleAll": "Organisationer",