simple-translator
simple-translator copied to clipboard
[Question] I would like to use without `import` for vanilla JavaScript code
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/"
}
);