fix(i18n): drive customer "Preferred language" select from SUPPORTED_LANGUAGES (#510)

Audit follow-up to the Spanish-locale commit: `CustomerDetailPage` had
a hardcoded `<option>` list for the customer's preferred-language
selector — 5 entries (en/de/nl/pt/ru) that were missing both fr (an
existing gap) and es (the new one). Every other language selector in
the frontend (the navbar `LanguageSelector`, the `GeneralTab` default-
language dropdown, the `EmailConfigPage` per-language tabs) already
reads from the shared `SUPPORTED_LANGUAGES` constant, so adding es
there was enough for those. This one had drifted.

Now mapped from `SUPPORTED_LANGUAGES` so future locales only need to
touch one place.
This commit is contained in:
Paul Nothaft
2026-05-17 00:57:03 +02:00
parent 061712ebf1
commit 51890e1aa5
@@ -20,6 +20,7 @@ import {
import { format } from 'date-fns';
import { Button, Card, Input, Loading } from '../../components/common';
import { SUPPORTED_LANGUAGES } from '../../components/common/LanguageSelector';
import { AssignedEventsDialog } from '../../components/admin/AssignedEventsDialog';
import {
customerAdminService,
@@ -227,11 +228,12 @@ export const CustomerDetailPage: React.FC = () => {
onChange={setField('preferredLanguage')}
className="input"
>
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="nl">Nederlands</option>
<option value="pt">Português</option>
<option value="ru">Русский</option>
{/* Drive the option list from SUPPORTED_LANGUAGES so adding a
locale (#510 added es; fr was already missing here) only
needs to touch LanguageSelector. */}
{SUPPORTED_LANGUAGES.map((lang) => (
<option key={lang.code} value={lang.code}>{lang.name}</option>
))}
</select>
</div>
</div>