I would like to add to my next.js app the ability to change (add / remove) language versions and translate texts from API.
At the moment I'm using next-i18next. I keep the translation files in /public/locales, and in the config I have 2 language versions specified.
I would like to download config from the API, so the "locales" array could be extended. It would be nice if these translations were updated duringrevalidation.
It is possible to do something like that?
Currently my next-i18next.config.js file looks like this:
const path = require("path");
module.exports = {
i18n: {
locales: ["pl", "en"], // this should be changeable
defaultLocale: "pl",
localeDetection: false,
},
localePath: path.resolve("./public/locales"), // this should be API endpoint
};