Errors
No locale found
Paraglide JS was not able to resolve a locale. This can happen if:
- Your strategy array is empty.
- You are using
overwriteGetLocale()
andoverwriteSetLocale()
but forgot to call them at the root/entrypoint of your app.
- You are using the
url
strategy but call messages outside of a request context.
Make sure to call messages within a request context that is set by the paraglideMiddleware:
- You make API requests and only have
strategy: ["url"]
set.
Paraglide JS will only extract the locale from a URL if the request is a document request, indicated by Sec-Fetch-Dest: document to distinguish it from API requests.
Add cookie
or baseLocale
to your strategy array to ensure that the locale is always resolved in API requests as well.
Switching locales via links doesn't work
Use setLocale()
to switch locales.
If your application uses client-side routing, the UI will not update if you use a localized href to switch the locale. You need to force a reload or navigate to the new locale.
Issue #472 discusses possibilities to handle this in a framework-agnostic way.