aurelia/i18n

Cannot build aurelia-i18n with 'au build'

Leonidnei opened this issue · 3 comments

I'm submitting a bug report

aurelia-i18n@1.0.0

Windows 7

  • Node Version:
    4.4.3
  • NPM Version:
    3.10.5
  • Browser:
    all
  • Language:
    ESNext

Current behavior:

Cannot build my project by 'au build' when it contains aurelia-i18n in aurelia.json
Getting error: ('d:\aurelia' is the current dir)
{ [Error: ENOENT: no such file or directory, open 'd:\aurelia\src\i18n.js']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'd:\aurelia\src\i18n.js',
moduleTree: [ 'aurelia-i18n' ],
fileName: 'd:/aurelia/node_modules/aurelia-i18n/dist/amd/aurelia-i18n.js' }

Please show me the configuration. Also, you need to configure i18n as well. The error seems to indicate that you haven't configured i18n itself.

I'm attaching aurelia.json
aurelia.txt
i18n configuration left from the existing project (except replacing XHR by Backend)

  .plugin('aurelia-i18n', async (instance) => {
      // adapt options to your needs (see http://i18next.com/pages/doc_init.html)
      instance.i18next.use(Backend);
      await instance.setup({
          backend: {
              loadPath: 'dist/locale/{{lng}}/{{ns}}.json'
          },
          lng : 'en',
          attributes : ['t','i18n'],
          sendMissing : false,
          fallbackLng : 'en',
          debug : false,
          defaultNs: 'translation',
          ns: ['common', 'translation']
      });
  })

The following configuration worked (at least build proceeded until the next issue):

    {
        "name": "aurelia-i18n",
        "path": "../node_modules/aurelia-i18n/dist/amd",
        "main": "index"
      },
      {
        "name": "i18next-xhr-backend",
        "path": "../node_modules/i18next-xhr-backend/dist/umd",
        "main": "i18nextXHRBackend"
      },
      {
        "name": "i18next",
        "path": "../node_modules/i18next/dist/umd",
        "main": "i18next"
      },