adonisjs / i18n

Internationalization module for AdonisJs. Supports file and database drivers
MIT License
43 stars 19 forks source link

Translation files are not copied to build folder #131

Closed jaysson closed 8 months ago

jaysson commented 8 months ago

Package version

2.0.0

Describe the bug

Installed and configured i18n.

npm i @adonisjs/i18n
node ace configure @adonisjs/i18n

Created language file resources/lang/en/crud.json and used it. Everything works fine while running in dev mode.

When I build the app using npm run build, it does not copy the resources/lang folder to build. Note that I am not using edge views, so resources only has lang folder.

I am copying it separately after build for now.

Reproduction repo

No response

RomainLanz commented 8 months ago

Hey @jaysson! 👋🏻

Thanks for the feedback! It should have been automatically added to the metaFiles key in the adonisrc.ts file. In the meanwhile, you can add them by hand:

{
  metaFiles: [
    // ...
    {
      pattern: 'resources/lang/**/*.json',
      reloadServer: false
    }
  ]
}

📚 https://docs.adonisjs.com/guides/adonisrc-file#metafile

jaysson commented 8 months ago

That was quick! Awesome job @RomainLanz!