Skip to content

Commit 00fcfd9

Browse files
authored
Merge pull request #2893 from bcgov/DEP-321-remove-default-french
DEP-321: Remove French as a required/default language
2 parents 8685fc4 + 8465f6b commit 00fcfd9

4 files changed

Lines changed: 21 additions & 17 deletions

File tree

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## July 09, 2026
2+
3+
- **Chore** Removed French as a required language for multi-language engagements [🎟️ DEP-321](https://citz-gdx.atlassian.net/browse/DEP-321)
4+
- Removed French from list of required languages in front-end validation (no back-end changes were needed, as the API does not enforce any required languages).
5+
- Started tracking whether the user _wants_ multiple languages (rather than just if there _are_ multiple languages), allowing us to temporarily show the language picker so that the user has time to select an additional language.
6+
17
## July 07, 2026
28

39
- **Feature** Added ability to upload files to Object Storage during survey submission [🎟️ DEP-277](https://citz-gdx.atlassian.net/browse/DEP-277)

web/src/components/engagement/admin/config/LanguageManager.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ import { ROUTES, getPath } from 'routes/routes';
1616

1717
export const LanguageManager = () => {
1818
const SINGLE_LANGUAGE = [{ code: 'en', name: 'English' }] as Language[];
19-
const REQUIRED_LANGUAGES = [
20-
{ code: 'en', name: 'English' },
21-
{ code: 'fr', name: 'French' },
22-
] as Language[];
23-
const requiredLanguageCodes = REQUIRED_LANGUAGES.map((l) => l.code);
19+
const REQUIRED_LANGUAGES = [{ code: 'en', name: 'English' }] as Language[];
20+
const requiredLanguageCodes = new Set(REQUIRED_LANGUAGES.map((l) => l.code));
2421

2522
const engagementForm = useFormContext();
2623
const { setValue, watch } = engagementForm;
@@ -30,10 +27,11 @@ export const LanguageManager = () => {
3027
const { languages: availableLanguages } = fetcherData ?? { languages: [] };
3128

3229
const [searchTerm, setSearchTerm] = React.useState('');
30+
const [wantsMultiLanguage, setWantsMultiLanguage] = React.useState<boolean>(false);
3331

3432
const determineSingleLanguage = (languages: Language[]) => {
3533
if (languages.length === 0) return null;
36-
if (languages.length === 1) return true;
34+
if (languages.length === 1 && !wantsMultiLanguage) return true;
3735
return false;
3836
};
3937
const isSingleLanguage = determineSingleLanguage(selectedLanguages);
@@ -49,12 +47,12 @@ export const LanguageManager = () => {
4947
<RadioGroup
5048
onChange={(e) => {
5149
if (e.target.value === 'single') {
50+
setWantsMultiLanguage(false);
5251
setValue('languages', SINGLE_LANGUAGE, { shouldDirty: true });
5352
}
5453
if (e.target.value === 'multi') {
55-
const optionalLanguages = selectedLanguages.filter(
56-
(l) => !requiredLanguageCodes.includes(l.code),
57-
);
54+
setWantsMultiLanguage(true);
55+
const optionalLanguages = selectedLanguages.filter((l) => !requiredLanguageCodes.has(l.code));
5856
setValue('languages', [...REQUIRED_LANGUAGES, ...optionalLanguages], {
5957
shouldDirty: true,
6058
shouldValidate: true,
@@ -72,12 +70,12 @@ export const LanguageManager = () => {
7270
<MultiSelect<Language>
7371
containerProps={{ sx: { mt: 2 } }}
7472
onChange={(_, language, reason) => {
73+
setWantsMultiLanguage(false);
7574
if (reason === 'removeOption' && language) {
7675
setValue(
7776
'languages',
78-
selectedLanguages.filter((l) => l.code !== language.code, {
79-
shouldDirty: true,
80-
}),
77+
selectedLanguages.filter((l) => l.code !== language.code),
78+
{ shouldDirty: true },
8179
);
8280
}
8381
if (reason === 'selectOption' && language) {
@@ -109,9 +107,9 @@ export const LanguageManager = () => {
109107
return (
110108
<Grid container direction="row" spacing={1} alignItems="center">
111109
<Grid>
112-
<BodyText bold={requiredLanguageCodes.includes(option.code)}>
110+
<BodyText bold={requiredLanguageCodes.has(option.code)}>
113111
{`${option.name}`}
114-
{requiredLanguageCodes.includes(option.code) && ' (Default)'}
112+
{requiredLanguageCodes.has(option.code) && ' (Default)'}
115113
</BodyText>
116114
</Grid>
117115
</Grid>
@@ -153,7 +151,7 @@ export const LanguageManager = () => {
153151
selectedLabel={{ singular: 'Language Added', plural: 'Languages Added' }}
154152
searchPlaceholder="Select Language"
155153
getOptionDisabled={(option) => selectedLanguages.filter((l) => l.code === option.code).length > 0}
156-
getOptionRequired={(option) => requiredLanguageCodes.includes(option.code)}
154+
getOptionRequired={(option) => requiredLanguageCodes.has(option.code)}
157155
/>
158156
</When>
159157
</Box>

web/src/components/engagement/admin/config/wizard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const EngagementForm = ({
134134
step={4}
135135
completed={isEnglishOnly || hasAdditionalLanguage}
136136
question="Will your engagement be offered in multiple languages?"
137-
details="All engagements must be offered in English, but you may also add content in additional languages. If you select multi-language, you must include French."
137+
details="All engagements must be offered in English, but you may also add content in additional languages."
138138
isGroup
139139
>
140140
<LanguageManager />

web/src/routes/AuthenticatedRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ const AuthenticatedRoutes = resolveLazyRouteTree(
143143
<LazyRoute
144144
path="config/edit"
145145
handle={{ crumb: () => ({ name: 'Configuration', link: '../config' }) }}
146+
actionLazy={() => import('engagements/admin/config/EngagementUpdateAction')}
146147
>
147148
<LazyRoute
148149
index
149150
handle={{ crumb: () => ({ name: 'Edit' }) }}
150151
ComponentLazy={() => import('engagements/admin/config/wizard/ConfigWizard')}
151-
actionLazy={() => import('engagements/admin/config/EngagementUpdateAction')}
152152
/>
153153
</LazyRoute>
154154
{/* Wraps the tabs with the engagement title and TabContext */}

0 commit comments

Comments
 (0)