Skip to content

fix(forms): make "also available in" language link switch language - #1102

Merged
japsu merged 1 commit into
con2:mainfrom
jkjuopperi:fix/survey-also-available-language-link
Oct 26, 2026
Merged

japsu merged 1 commit into
con2:mainfrom
jkjuopperi:fix/survey-also-available-language-link

Conversation

@jkjuopperi

@jkjuopperi jkjuopperi commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

The "This form is also available in English" banner on surveys (and invitations) did nothing when clicked, while the top bar language switcher worked.

Cause: the banner used next/link, so clicking did a client-side transition to /<lang>/<path>. With next-intl localePrefix: "never", the locale only switches when the i18n proxy handles a real request (sets the locale cookie and redirects to the unprefixed path). The client-side transition just ended up on the same unprefixed URL in the old language.

Fix: use a plain <a>, the same as the top bar switcher in NavigationMenus.tsx.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Navigation
    • Alternate-language links now use standard browser navigation while retaining their localized destinations and language information. Selecting a language may reload the page instead of navigating within the app without a full page load.

…nguage

The link used next/link, so clicking it did a client-side transition to
/<lang>/<path>. With localePrefix "never" the i18n proxy only switches the
locale on a real request; the client transition just landed back on the
unprefixed path in the old language. Use a plain <a> like the top bar
language switcher does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b7e1d71-68e4-4cdf-9da6-2dc1aa1bf17d
Commits

Reviewing files that changed from the base of the PR and between db804f7 and 28c19ac.

Files selected for processing: 1
  • kompassi-v2-frontend/src/components/forms/AlsoAvailableInLanguage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Alternate-language URLs now render as plain anchors instead of Next.js Link. The links retain their localized destination and lang attribute.

Changes: Alternate-language links

Layer / File(s) Summary
Render alternate-language URLs as anchors
kompassi-v2-frontend/src/components/forms/AlsoAvailableInLanguage.tsx
The component removes the next/link import and uses plain anchors for alternate-language URLs. The localized destination and lang attribute remain.

Priority: Normal

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Merge Risk: Minimal · up to 28c19

The language-switch links use full-page anchors as intended, so the PR is mergeable with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: fixing the language link so it switches the form language.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jkjuopperi
jkjuopperi requested a review from japsu October 26, 2026 15:27
@japsu
japsu merged commit 2d9497e into con2:main Oct 26, 2026
14 checks passed
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.

2 participants