Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

@intlify/vite-plugin-vue-i18n locale translation files splitting

Aperta
#97 10 commenti 18 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
32/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript, vite

Direzione di ricerca

Inizia esaminando l’entry point di @intlify/vite-plugin-vue-i18n e la documentazione attuale della README sul caricamento delle locale. Riproduci il comportamento segnalato con le strutture di directory en e fr dell’issue, quindi determina quale comportamento di suddivisione e unione sia previsto; il lavoro è completato quando più file per locale vengono combinati correttamente oppure viene documentata l’alternativa supportata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status: proposal
Clear and concise description of the problem
  • for some projects custom block code is not the right way
  • if we want place locale files in separate directory, we need to use "global" access, so everything is in one file per locale,
    example (these files can really grow in size and be really unclear):
locales/en.yaml
locales/fr.yaml
  • if we split locale translation files into multiple files, import all locales at once is not working, because its not correctly merged
Suggested solution
  • add possibility to split each locale to multiple files, so our structure can look like this:
locales/en/group1/subject1.yaml
locales/en/group1/subject2.yaml
locales/en/group2/subject3.yaml

locales/fr/group1/subject1.yaml
locales/fr/group1/subject2.yaml
locales/fr/group2/subject3.yaml

There are to possibilities how to achieve this:

  1. more complex way - first directory will define the locale and each directory is a subject path, so if locales/en/group1/subject1.yaml content is this:
foo: foo
bar:
  baz: baz

the "generated" file for en locale will be:

group1:
  subject1:
    foo: foo
    bar:
      baz: baz
  1. more simple way - just merge the content, use root subject as locale - we will need to define whole subject in each file, the plugin will just merge everything in one
    locales/en/group1/subject1.yaml
en:
  group1:
    subject1:
      foo: foo
      bar:
        baz: baz

locales/fr/group1/subject1.yaml

fr:
  group1:
    subject1:
      foo: foo
      bar:
        baz: baz
Alternative

If there is any existing way how to achieve similar code spliting right now without need to implement it, please add it to documentation, because now there is nothing about it.

Additional context

I tried several ways how to structure the dirs, files and content of yaml/json files and nothing was correctly merged, always only one file worked and other were ignored.

Validations
  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Lingua principale
TypeScript
Stelle
270
Fork
46
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di intlify/bundle-tools

Tutte le issue di intlify/bundle-tools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.