vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

feature: add support for multi locale file

Open gurusalih opened this issue 3 years ago • 0 comments
trafficstars

Clear and concise description of the problem

I'm currently working on a project that implements feature/domain based architecture. My goal is to define a separate locale for each domain.

At the end of the job, all local files can be merged into a single file. It doesn't matter. The important thing is to be able to manage piecemeal works during the development phase.

Currently when I define a config like below (with vite plugin), it only accepts the last uploaded file.

import { URL, fileURLToPath } from "url";
import { dirname, resolve } from "path";
import { defineConfig } from "vite";
import vueI18n from "@intlify/vite-plugin-vue-i18n";

export default defineConfig({
  plugins: [
    vueI18n({
      include: resolve(
        dirname(fileURLToPath(import.meta.url)),
        "./**/locales/*"
      ),
    })
  ]
})

I need a file structure like below:

- src
- - domains
- - - domain1
- - - - locales
- - - - - en.json
- - - - - tr.json
- - - domain2
- - - - locales
- - - - - en.json
- - - - - tr.json

Suggested solution

If there are files with the same name during upload, they can be merged.

Alternative

No response

Additional context

No response

Validations

gurusalih avatar Nov 21 '22 15:11 gurusalih