feat: i18n URL structure, language detection, layout width fix#2953
feat: i18n URL structure, language detection, layout width fix#2953immortal71 wants to merge 16 commits into
Conversation
73bcb35 to
ad181c2
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the cornucopia.owasp.org SvelteKit site to support language-prefixed URLs (e.g., /en/, /es/, /uk/), adds server-side browser language detection with redirects to the prefixed structure, fixes a layout width constraint to be responsive, and removes an unused i18n dependency as part of the redesign work for Issue #2194.
Changes:
- Add language-prefixed routing via
hooks.server.jsredirects andhooks.jsreroute. - Update UI routing behavior (language picker) and improve layout responsiveness.
- Update static prerender configuration and remove the unused
svelte-i18ndependency.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cornucopia.owasp.org/svelte.config.js | Adjusts adapter-static fallback and adds prerender entries for language-prefixed routes. |
| cornucopia.owasp.org/src/routes/+layout.svelte | Makes the main content container responsive (full width with max-width + padding). |
| cornucopia.owasp.org/src/routes/[lang]/[...path]/+server.js | Adds a language-prefixed catch-all endpoint intended to proxy requests to non-prefixed routes. |
| cornucopia.owasp.org/src/lib/components/languagePicker.svelte | Switches language navigation to goto() and rewrites URLs to include the language prefix. |
| cornucopia.owasp.org/src/hooks.server.js | Implements language-prefix detection and Accept-Language based redirect to /<lang>/.... |
| cornucopia.owasp.org/src/hooks.js | Adds reroute() to strip the language prefix for route matching. |
| cornucopia.owasp.org/pnpm-lock.yaml | Removes lock entries related to the removed svelte-i18n dependency (and associated transitive deps). |
| cornucopia.owasp.org/package.json | Removes svelte-i18n from dependencies. |
Files not reviewed (1)
- cornucopia.owasp.org/pnpm-lock.yaml: Language not supported
| pathname.startsWith('/cards') || | ||
| pathname.startsWith('/card') || |
|
hii @immortal71 can you resolve the conflicts so we can get review from sydseter. |
|
@Adarshkumar0509 well conflict is resolved, there is few suggestions that need to be implemented and test is failing it need fix that, give me time I can only those fix in proper device !! |
| entries: [ | ||
| '/', | ||
| '/en/', | ||
| '/es/', |
There was a problem hiding this comment.
Lets' not route to the spanish version for now.
- Remove /es/ and /es/about from svelte.config.js prerender entries - Revert fallback from 'error.html' back to '/error' - Remove 'es' from SUPPORTED_LANGS in [lang]/[...path]/+server.js - Remove 'es' from hooks.js reroute regex - Remove 'es' from hooks.server.js supportedLangs and pathMatch regex Co-authored-by: sydseter <sydseter@users.noreply.github.com>
|
@Adarshkumar0509 done |
|
@sydseter this is ready for review |
|
There are some issues: cd cornucopia.owasp.org Open http://localhost:3000/uk,Open http://localhost:3000/cardsNo card data is loaded.
The css is also strange:
|
sydseter
left a comment
There was a problem hiding this comment.
Please look at my comment above.



Summary
This PR is part of the redesign for cornucopia.owasp.org (Issue #2194).
Changes
Testing
Related Issue
Closes #2194
Notes
open for team review before merging