You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I asked myself if next-intl could solve that problem as well for me.
In my current use case I try to find a way to use https://react-pdf.org/ in my current Next setup.
Describe the solution you'd like
Add pages/api/* support, like:
importuseApiTranslationsfrom'next-intl/useApiTranslations'exportdefaultasyncfunctionhandler(req,res){constt=awaituseApiTranslations(req.query.__nextLocale,'common')consttitle=t('title')res.statusCode=200res.setHeader('Content-Type','application/json')res.end(JSON.stringify({ title }))}
ATM it is not possible to use it for instance because of this line:
Is your feature request related to a problem? Please describe.
I am looking for an i18n-library that I can use in my Next app on both the client- and server-side (especially in API routes). At the moment I am using https://github.com/isaachinman/next-i18next, which does not solve the problem. I am also about to test https://github.com/vinissimus/next-translate#gett, which could be useful as well.
But I asked myself if
next-intl
could solve that problem as well for me.In my current use case I try to find a way to use https://react-pdf.org/ in my current Next setup.
Describe the solution you'd like
Add
pages/api/*
support, like:ATM it is not possible to use it for instance because of this line:
next-intl/packages/next-intl/src/NextIntlProvider.tsx
Line 1 in 23aed9a
Describe alternatives you've considered
As mentioned above, the idea came to me after seeing the
getT
feature innext-translate
.The text was updated successfully, but these errors were encountered: