Pikawshh
Pikawshh
NNuxt
Created by Pikawshh on 3/4/2025 in #❓・help
Best practices for loading nuxt-i18n from an API / CMS
Hi @TheAlexLichter, thanks for your answer! So, if I understand correctly, I need to create a file under /server/api/myFile.ts, where I’ll make the GraphQL request to fetch the translations. Then, I will call this route inside my Nuxt plugin. Do you think this two-step approach (making the API call in /server/api/ and then calling it from the plugin) could cause any issues, or is it a good solution? Also, I’m experimenting with Pinia to store the translation data, but I’m not sure if it's the best approach. Would it make sense to store the translations in Pinia, or is there a better solution?
12 replies