D
D
devilsD2018-07-10 00:40:57
JavaScript
devilsD, 2018-07-10 00:40:57

How to load a list of locales via api in nuxt-i18n?

The application uses nuxt-i18n https://nuxt-community.github.io/nuxt-i18n/ . The list of locales is set in the nuxt config:

{
  modules: [
    ['nuxt-i18n', {
      locales: ['en', 'fr', 'es'],
      defaultLocale: 'en',
      vueI18n: {
        fallbackLocale: 'en',
        messages: {
          en: {
            welcome: 'Welcome'
          },
          fr: {
            welcome: 'Bienvenue'
          },
          es: {
            welcome: 'Bienvenido'
          }
        }
      }
    }]
  ]
}

How can I specify a list of locales by requesting it via api ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question