intlify / bundle-tools

bundling for intlify i18n tools
MIT License
239 stars 37 forks source link

can not inclue js locale files #297

Open hzhoup opened 1 year ago

hzhoup commented 1 year ago

Reporting a bug?

when the locales file is the .js file, the messges is empty. try to rename xxx.json it can work.

plugin setting: image

files: image

use:

import { createI18n } from 'vue-i18n'
import messages from '@intlify/unplugin-vue-i18n/messages'

export let i18n

function createI18nOptions() {
  // ...
  return {
    messages,
    locale: 'zh',
    sync: true,
    legacy: false,
    missingWarn: false,
    fallbackLocale: 'zh',
    silentTranslationWarn: true,
    silentFallbackWarn: true
  }
}

Expected behavior

can include js files

Reproduction

non

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
    Memory: 6.55 GB / 15.89 GB
  Binaries:
    Node: 16.20.0 - E:\nodejs\node.EXE
    Yarn: 1.22.19 - E:\nvm\npm\yarn.CMD
    npm: 9.6.5 - E:\nvm\npm\npm.CMD
    pnpm: 8.7.5 - E:\nodejs\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (116.0.1938.81)
    Internet Explorer: 11.0.19041.1566

Screenshot

No response

Additional context

No response

Validations

hzhoup commented 1 year ago

like #266

kazupon commented 1 year ago

Thank you for your reporting! We need your minimal reproduction with github repo or stackbliz. Could you give us about it ,please?