I have an application, the main problem is that i can't understand how to "create" custom locale. For example i have routes like this /hello and /ja/hello, where the first route is default english language and the second one is japanese. I trying to left my english locale without prefix, but add the prefix only for one route of this version like /eng/hello.
My nuxt.config.js for i18n:
i18n: {
locales: [
{
code: 'en',
file: 'en.js',
domain: domains.en,
icon: 'english',
name: 'English',
iso: 'en',
},
{
code: 'ja',
file: 'ja.js',
domain: domains.ja,
icon: 'japan',
name: '日本語',
iso: 'ja',
},
],
// differentDomains: true,
lazy: true,
langDir: 'lang/',
defaultLocale: 'en',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'clang',
onlyOnRoot: true, // recommended
alwaysRedirect: true,
},
seo: false,
strategy: 'prefix_except_default',
},
Try configuring under the modules prop like this, example from my project: