Replies: 1 comment
-
You can create your namespace in the format you want. The only condition is that https://github.com/aralroca/next-translate#create-your-namespaces-files i18n.js const fs = require('fs/promises');
module.exports = {
// ...rest of config
"loadLocaleFrom": async (lang, ns) => {
const markdown = await fs.readFile(`locales/${lang}/${ns}.md`, { encoding: 'utf8' });
const json = markdownToJSON(markdown)
return json
}
} Then it is everyone's responsibility to respect the formatting correctly in order to return the JSON correctly. Or use some tool like this https://github.com/njvack/markdown-to-json |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is possible to provide markdown content as value. The problem is that additional formatting is required, e.g., multiline content; the value must be of type array. Embedding a lot of markdown content in this way makes it hard to apply the proper formatting. It would be nice if it is possible to provide references to external markdown files and resolve them when the respective translation key is required. Thx!
Beta Was this translation helpful? Give feedback.
All reactions