i18next-parser
i18next-parser copied to clipboard
Export as 1 file
🚀 Feature Proposal
I would like to export the translation as 1 language file with all the namespace in it.
Motivation
Not every project are big enough to necessarily make multiple files per a language.
Example
I think if the output only have one $LOCALE, the parser should export 1 file contains all the namespace and translation in it. If it have $LOCALE and $NAMESPACE, the parser will create many files.
What is the issue with having multiple files? My assumption is that if the project is so small then it probably isn't changing much either.
Some translation tools doesn't support multiple files :D (ex. POEditor)
I'm not a fan of obscure configurations that trigger a behaviour like you suggested. That said you are welcome to open a PR with a configuration option name 'concatenateNamespaces` or something like that.
I'm busy currently, but I would love to learn the source code and contribute it. (Kinda busy in this month, maybe next month? Does it sound good? 😁)
You can do this now with the following sample config:
module.exports = {
namespaceSeparator: false,
output: "src/locales/$LOCALE/translations.json"
};