react-pdf
react-pdf copied to clipboard
translation not working inside of PDF document
Describe the bug
I'm using gatsby
and react-i18n
for translation along with react-pdf/renderer's PDFViewer
component, however the translation is missing within PDFViewer / iframe and only the translation keys are rendered instead, it seems to work properly however outside
To Reproduce Steps to reproduce the behavior including code snippet (if applies):
- Go to https://github.com/Hiiiij/gatsby-pdf
- run
npm install
- run `npm start'
Expected behavior
intro
key within the rendered / downloaded PDF should show the translated text as set in translation.json
Current behavior only translation key is rendered instead
Yeah, experiencing the same issue right now
Edit: Small followup, for me the issue was not with react-pdf, but with a simple .use(HttpApi) call in the i18n-next configuration, see: https://github.com/i18next/i18next-http-backend
Any example for using useTranslation
on /api/ route
endpoints with Next.js?
I tried import { i18n } from 'next-i18next'
;
but i18n?.init()
always returns null
@pascalporedda @Hiiiij