Closed typeofweb closed 1 month ago
@typeofweb Hi, thanks for opening the issue.
I currently do not understand what you are doing with the argument of /chart
& /product
.
According to the docs, this is not a "Link field", but a regular string. https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components
Regardless, if your key is then also /cart.empty.title
or /product.page.imagesTitle
this should work.
But I'm assuming in your language file, this is just cart
or product
.
As you can probably imagine, the (concat) string has to be a perfect match.
See also: it("should add the defined namespace by useTranslations hook", async () => {
Here's my language file (simplified):
{
"/product": {
"page": {
"imagesTitle": "Images"
}
},
"/cart": {
"empty": {
"title": "Your cart is empty"
}
}
}
Everything in next-intl and TypeScript is fine, and the matches are perfect. It's just the vscode extension that reports a problem, and only if t
is initialized multiple times in the same file with different arguments.
Not sure why this issue was closed, it's not fixed.
Sorry for closing too early! I see. The second hook namespace isn't properly addressed to the respective t function. Let me inspect this real quick.
Environment
project.inlang/settings.json
Code
Result
There's an error reported on line
t("page.imagesTitle")
"ERROR: … not found in source with" even though the invocation is correct and works.