Skip to content

Commit

Permalink
fix weployScriptTag
Browse files Browse the repository at this point in the history
  • Loading branch information
jemikanegara authored Nov 20, 2023
1 parent 9e2e137 commit 141fd23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { getTranslations, isBrowser, createLanguageSelect } = require("./index.js");

if (isBrowser) {
var weployScriptTag = document.currentScript;
window.weployScriptTag = document.currentScript;
document.addEventListener("DOMContentLoaded", function() {
const apiKey = weployScriptTag.getAttribute("data-weploy-key");
const disableAutoTranslateAttr = weployScriptTag.getAttribute("data-disable-auto-translate")
const apiKey = window.weployScriptTag.getAttribute("data-weploy-key");
const disableAutoTranslateAttr = window.weployScriptTag.getAttribute("data-disable-auto-translate")
const disableAutoTranslate = disableAutoTranslateAttr == "true";
getTranslations(apiKey, {disableAutoTranslate});
createLanguageSelect(apiKey);
Expand Down

0 comments on commit 141fd23

Please sign in to comment.