Js translation files cannot obtain TS type support #1979
Replies: 2 comments
-
Hmm, I don't see an obvious problem with that code snippet. Can you share a repro based on next-intl-bug-repro-app-router? Happy to take a look! |
Beta Was this translation helpful? Give feedback.
0 replies
-
I found that this was caused by the TS call stack exceeding the limit after I wrote a recursive type calculation—not entirely sure why this issue wasn't detected in version 3.0. I'll close this discussion. Thank you for your reply! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thank you very much for developing this project, which has solved our team's text internationalization issues! Now we are encountering a problem: in version 3.0 of next-intl (e.g., 3.26.5), we could easily replace JSON files with JS files.
Doing so has the advantage of distributing translation files across various components, reducing the mental burden during our development process. For example:
In global.d.ts:
However, in version 4.0, while the original translation feature remains functional, the TypeScript type support feature has ceased to work:
Is there a way for me to use a JS file as a translation file in 4.0 with TS type support?
BTW, I reviewed the issues, and this situation is similar to #1894, but we are not overly concerned about the impact of translation files on the response speed of the compiled pages.
Beta Was this translation helpful? Give feedback.
All reactions