Where to place translation files in Docs theme? Getting "Cannot find module"
See original GitHub issueI’ve been trying to set up a Nuxt Content site using the Docs theme. I need to translate strings to Dutch, so I’ve set up the following in the config file:
i18n: {
locales: () => [{
code: 'nl',
iso: 'nl-BE',
file: 'nl-BE.json',
name: 'Nederlands'
}],
defaultLocale: 'nl',
},
Looking at the generated .nuxt
folder, it appears the folder it needs to go into is i18n/
, but when the server starts it complains about it not finding the module ./nl-BE.json
. I’ve tried pasting it around to pretty much everywhere with many different folder names I found around the web, but none worked. I’ve also tried doing it the javascript way and calling it nl-BE.js
and exporting the object, but it still can’t find the module.
I have also added the langDir option manually to no avail.
Is there something I’m not getting about this system (first time working with i18n localization) or is there something else wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Hello @benjamincanac, thank you for pointing me in the right direction! I opened a PR to add the file, though it’s the first time I’ve ever contributed a PR to an open source project. In other words, I hope I did it right and followed the guidelines correctly.
Thanks for taking the time to help!
Hey @Ragura, unfortunately this translation file does not exist yet in the
docs-theme
, check out the available locales: https://github.com/nuxt/content/tree/dev/packages/theme-docs/src/i18n. Feel free to open a PR to add it.