Programmatically set locales

Is there any way to programmatically set locales in strapi?

As an example in Next.js you can specify locales the following way,

next.config.js

module.exports = {
  i18n: {
    locales: ['en', 'da'],
    defaultLocale: 'en',
  },
}