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
Describe the bug
When using getTranslations({ locale, namespace: "Metadata" }) inside of the generateMetadata() function, the parsing is incorrect. I would expect this to return only title, as that is the only item in that namespace in en.json.
The fix is on another post but here is the solution :
Go on the .vscode folder (at the root of your project, create it if it doesn't exist)
Inside it create a settings.json (it will be the settings for this project only, overriding VScode global settings. You'll do the same for every project you do) and add this :
{"i18n-ally.enabledFrameworks": ["custom"],// * This is the fix for the getTranslations issue"i18n-ally.localesPaths": ["src/i18n/messages"],// Change it to match your folder with all the JSON messages"i18n-ally.sourceLanguage": "en",// Language that will replace the key on the file"i18n-ally.sortKeys": true// On key edit through the plugin, sort the JSON}
note that only i18n-ally.enabledFrameworks is part of the fix, other settings are here just to show how it works / more options.
create another file inside the .vscode folder and name it i18n-ally-custom-framework.yml. Paste this content
Describe the bug
When using
getTranslations({ locale, namespace: "Metadata" })
inside of thegenerateMetadata()
function, the parsing is incorrect. I would expect this to return onlytitle
, as that is the only item in that namespace inen.json
.Extension Version
v2.12.0
Framework/i18n package you are using
next-intl
To Reproduce
.vscode/settings.json
config:Device Infomation
Extension Log
Screenshots
The text was updated successfully, but these errors were encountered: