Skip to content

fix: main communication language to accept english-alone client-side - #903

Open
yi171 wants to merge 3 commits into
need4deed-org:developfrom
yi171:yixuan/fix/main-communication-english-alone
Open

fix: main communication language to accept english-alone client-side#903
yi171 wants to merge 3 commits into
need4deed-org:developfrom
yi171:yixuan/fix/main-communication-english-alone

Conversation

@yi171

@yi171 yi171 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

fix for english alone to be accepted as the main communication language on client side
redo of closed PR fe#849 to use updated ISO codes instead of titles strings.

Related Issues

Closes #894

Changes

  • update mainCommunication Zod validation in opportunityDetailsSchema.ts to accept German and/or English.
  • update mainCommunicationInvalid error message in both en and de translation files

@need4deed
need4deed requested a review from nadavosa August 10, 2026 08:47
@nadavosa

nadavosa commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Hey @yi171 here is a review :

Review

Small, well-scoped fix: relaxes the client-side mainCommunication validation in opportunityDetailsSchema.ts to accept English-alone, matching the backend rule already relaxed in be#786. The new isOnlyGermanOrEnglish check correctly covers all three valid cases (German alone, English alone, both) and still rejects anything else, and it matches the fix prescribed in #894 essentially verbatim. Translation copy updates read correctly in both locales.

Nit

getMainCommunicationLanguageOptions (a few lines above the changed code, same file) has a comment that's now stale:

// The org's main communication language is German, with English as the only
// secondary option — unlike "Residents speak", which allows any language.

This describes exactly the old, now-relaxed rule ("German mandatory, English only as an addition"). Worth updating to reflect that German and English are each independently valid, together or alone, so a future reader doesn't get pointed at the wrong invariant.

Test coverage

No test exercises the three cases from #894's acceptance criteria (English-alone accepted, German-alone/both still work, a non-German/English pick still rejected) — worth a quick unit test on createOpportunityDetailsSchema's mainCommunication validation given this is the second attempt at this exact fix (the first, fe#849, was closed by mistake) and a regression here would be easy to miss without one.

Nothing blocking — logic is correct and matches the already-relaxed backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opportunity Details: main communication language still rejects English-alone client-side

3 participants