Type-safe getTranslations namespace option #1828
CarrettaRiccardo
started this conversation in
General
Replies: 1 comment
-
From my experience, autocomplete somehow doesn't really work for In the future, once |
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.
-
With a basic setup of next-intl and nextjs, i came across the documentations to enable static rendering.
Following the last step, it is required to provide locale and namespace to
getTranslations
, like so:The above namespace is not type-safe:
Even tho the usual getTranslation way has it:
Not sure why, as it seems to correctly infer the namespaces in the type definition and when hovering the function:
Tried a couple different ts versions (5.8.2, 5,9)
Using next-intl 4.0.2, with "Messages" strictly-typed
Beta Was this translation helpful? Give feedback.
All reactions