Closed OutOfBoundCats closed 10 months ago
Thanks for the PR.
If you want to detect it from the param you can use Remix params object directly instead of using the language detection features of remix-i18next:
// app/routes/($lng)._index.tsx
export async function loader({ request, params }: LoaderFunctionArgs) {
let lng = params.lng ?? fallbackLanguage;
let t = await i18n.getFixedT(lng);
// use t here
}
This is the recommended way since Remix already gives you a way to deal with params in the URL.
As per my understanding of this article https://developers.google.com/search/docs/specialty/international/localized-versions Google recommends having lang as part of url. This aids in good seo. So i added language detection using path parameters as option to the repository.