Skip to content

Add Paraglide-based i18n with French locale support#150

Draft
Saterz wants to merge 7 commits intomainfrom
codex/implement-i18n-for-french-support
Draft

Add Paraglide-based i18n with French locale support#150
Saterz wants to merge 7 commits intomainfrom
codex/implement-i18n-for-french-support

Conversation

@Saterz
Copy link
Member

@Saterz Saterz commented Jan 11, 2026

Motivation

  • Add first-class internationalization using Paraglide to provide typesafe, tree-shakable translations and enable French locale support.
  • Persist and resolve user locale from cookie and Accept-Language header so the site can serve the correct language on first request.
  • Wire translations into UI (navbar) and make it possible for users to switch languages from the navbar.

Description

  • Add a Paraglide inlang project and message catalogs: project.inlang/settings.json and messages/en.json / messages/fr.json, and register the @inlang/plugin-message-format plugin.
  • Add src/lib/i18n.ts with locale normalization, resolveLocale, constants for cookie handling, and setAppLocale that calls Paraglide's setLocale and persists the cookie.
  • Wire locale resolution into the request pipeline by adding an i18n hook and calling setLocale in src/hooks.server.ts, expose locale via locals, and include locale in layout data types (src/app.d.ts) and +layout.server.ts.
  • Integrate messages into the UI by compiling Paraglide output into src/lib/paraglide, using the generated m API in src/lib/components/layout/navbar.svelte for labels, and add a language selector; add i18n:compile and prebuild/predev scripts to package.json to generate message code at build/dev time.

Testing

  • Ran the Paraglide compiler with paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide --emit-ts-declarations, which completed successfully and produced src/lib/paraglide.
  • Starting the dev server (npm run dev) ran the predev compile and served the app successfully (dev server reachable), and a screenshot of the navbar with the language selector was produced.
  • npm run build was executed but failed due to a missing environment variable (PUBLIC_TURNSTILE_SITE_KEY) exported from $env/static/public, unrelated to the i18n changes.
  • The initial npx @inlang/paraglide-js init attempt failed due to network/plugin fetch errors, but compilation using the local project.inlang succeeds.

Codex Task

@netlify
Copy link

netlify bot commented Jan 11, 2026

Deploy Preview for cubeindex ready!

Name Link
🔨 Latest commit 8d2592c
🔍 Latest deploy log https://app.netlify.com/projects/cubeindex/deploys/69674b62f5f0ec0008d5e16e
😎 Deploy Preview https://deploy-preview-150--cubeindex.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…or-french-support-8e8nep

Localize component UI strings with Paraglide
- Removed locale definitions from global types in app.d.ts.
- Added DetailedProfiles interface to dbTableTypes.ts for better type safety.
- Simplified ExplorePopover.svelte by removing redundant titles and descriptions.
- Cleaned up bottomNav.svelte by removing unnecessary aria-labels and imports.
- Streamlined footer.svelte by removing unused elements and improving structure.
- Updated navbar.svelte to simplify locale handling and improve readability.
- Removed unnecessary elements from inConstruction.svelte and confirmSignOut.svelte.
- Updated userCard.svelte to use a more concise method for deriving cube count title.
- Deleted unused i18n.ts file to reduce clutter.
- Adjusted user profile loading in +page.ts to select all columns instead of specific ones.
- Cleaned up report page components by removing redundant text and improving clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant