Page title not being translated after deployment (on Vercel) #219
Unanswered
CHR-onicles
asked this question in
Q&A
Replies: 1 comment 4 replies
-
The most probable issue is that the translation files are not being loaded server side, this is common in Vercel if you use the fs backend of i18next, I recommend you to import them server side or fetch them with another backend |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've followed the instructions from the readme on using
getFixedT()
in my loader and returning translated text which I then use in my meta function. This works in my local dev and preview environments, but I've noticed on Vercel it fails to translate, and just displays the translation keys:Local env:
![image](https://private-user-images.githubusercontent.com/44934037/381777921-cc043cd2-d99f-441f-a74c-92a41003d335.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzExMTYsIm5iZiI6MTczOTY3MDgxNiwicGF0aCI6Ii80NDkzNDAzNy8zODE3Nzc5MjEtY2MwNDNjZDItZDk5Zi00NDFmLWE3NGMtOTJhNDEwMDNkMzM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDAxNTMzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYwMzExNWZlNWU2M2Q0MjAyYzk1OWNiMjdiMDM0MjE0YWUwM2ZlN2NkY2UxZTU2ZWEyMzg0M2M3MjNjMTI2ZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B9m9bm8uS6HF21cXbdZ_ZlJUhiBo64gVD9wANb_c56A)
Deployed version:
![image](https://private-user-images.githubusercontent.com/44934037/381777966-79e6d9d2-c99c-4564-976b-e5d2583bf730.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzExMTYsIm5iZiI6MTczOTY3MDgxNiwicGF0aCI6Ii80NDkzNDAzNy8zODE3Nzc5NjYtNzllNmQ5ZDItYzk5Yy00NTY0LTk3NmItZTVkMjU4M2JmNzMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDAxNTMzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5ZDFlNzIwNDhjMWZlNzNmNDYyNmY1ZWVjNTk1ZmI5Mjk1NDQ2YWQ2NTAxMmZhOWMyM2ZkMzgwM2QwYWJkY2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RQsXWiFFifEZe_3FKGqT3PVwBLBOcjut3o7JEVfJzpc)
I've tried all sort of different configs but it doesn't seem to work. In Vercel logs, I see the accepted languages from logging
request
but I'm starting to think i18n might not be ready early enough to translate stuff in the<head>
element? Everything else on the page works absolutely fine!I'll appreciate any help with this 🙏🏼
Beta Was this translation helpful? Give feedback.
All reactions