simple-translator icon indicating copy to clipboard operation
simple-translator copied to clipboard

[Question] I would like to use without `import` for vanilla JavaScript code

Open gusbemacbe opened this issue 2 years ago • 0 comments

Hello!

I want to use the vanilla JavaScript code. But I do not want to use import and module nor Node.js. I want to load JSON files, but it doesn't load them. The i18n folder is the root folder, but the vanilla JavaScript file similar to index.js is in the folder assets/js/translator.js.

The tree view:

- root
   - assets
      - js
         - translator.js
  - index.html
  - i18n
    - en.json

whose translator.js file code is:

var translator = new Translator(
  { 
    filesLocation: "../../i18n/"
  }
);

gusbemacbe avatar Jun 16 '22 17:06 gusbemacbe