NextJS[next-i18next] - Create translation sub-folders

Viewed 225

Following the documentation, the default file structure is:

.
└── public
    └── locales
        ├── en
        |   └── common.json
        └── de
            └── common.json

When we can add different .json files under each language.

In my NextJS application I structured many different services and I want to have different translations for each.

I would like to create a locales folder for each specific service, which will be in the service itself. Or at least have a sub-folder under locales or under each language with the name of the service.

Something like this:

.
└── public
    └── locales
        ├── en
        |   ├── service_one
        |   |   └── content.json
        |   └── service_two
        |       └── content.json
        └── de
            ├── service_one
            |   └── content.json
            └── service_two
                └── content.json

Or even better, something like

|
└── service_one
    └── locales
        ├── en
        |   └── content.json
        └── de
            └── content.json

I can't find a way to target sub-folders, or different localePath for different pages.

0 Answers
Related