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
![image](https://private-user-images.githubusercontent.com/127468/341564327-f77a0f05-b2cb-47c2-9355-d9e5feb3f7c4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0MDI0NzksIm5iZiI6MTcyNDQwMjE3OSwicGF0aCI6Ii8xMjc0NjgvMzQxNTY0MzI3LWY3N2EwZjA1LWIyY2ItNDdjMi05MzU1LWQ5ZTVmZWIzZjdjNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFl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Y3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.J72A3Z5PkspZd4FiBA69_e-NQnGTeNqP3AjYevJ_Drc)
![image](https://private-user-images.githubusercontent.com/127468/341565123-2934a4d7-3510-48be-93d9-812b6f418fff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ0MDI0NzksIm5iZiI6MTcyNDQwMjE3OSwicGF0aCI6Ii8xMjc0NjgvMzQxNTY1MTIzLTI5MzRhNGQ3LTM1MTAtNDhiZS05M2Q5LTgxMmI2ZjQxOGZmZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyM1QwODM2MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02M2EyYTM0ZTE5MDk0MmE5Y2Q4NWQ5M2Y1ZjQ3MTJmZGIwZmU3YTY5MThlNDY3ZGM3OTUyYzY4MTQxNWU1ODg5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Gh4YiYb3VaBVyOy8hnJO8Z1rswcMegb9MDkprNF8t1M)
The text was updated successfully, but these errors were encountered: