[Vuejs]-Import Resource Bundle to vue project

0👍

npm install ResourceBundle should be npm install --save resource-bundle. Try re-installing with the correct package name and the save flag.

After that, check the package.json file in your project root directory for resource-bundle listed in the "dependencies" section.

  "dependencies": {
    ...
    "resource-bundle": "^0.1.2",
    ...
  }

Changed your import statement to:

import loader from 'resource-bundle'

And call the loader function:

let message = loader('en_US', __dirname+'/resources',message')
console.log(message.get('some-key')) 

Leave a comment