From b0df8e10f512939e43f65c7a4ea59091d08d5cc5 Mon Sep 17 00:00:00 2001 From: TW - Vincent <315173+touchweb-vincent@users.noreply.github.com> Date: Sun, 21 Sep 2025 19:01:30 +0200 Subject: [PATCH] Update privatebin.js --- js/privatebin.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/privatebin.js b/js/privatebin.js index 53a29a4b..a0e0831c 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -930,7 +930,15 @@ jQuery.PrivateBin = (function($) { } // load strings from JSON - $.getJSON('i18n/' + newLanguage + '.json' + new URL(document.currentScript.src).search, function(data) { + let main_script = document.querySelector('script[src^="js/privatebin.js"]'); + + if (main_script) { + let privatebin_version = main_script.getAttribute("src").split("?")[1] || null; + } else { + let privatebin_version = Math.floor(Date.now() / 60000); + } + + $.getJSON('i18n/' + newLanguage + '.json?v=' + privatebin_version, function(data) { language = newLanguage; translations = data; $(document).triggerHandler(languageLoadedEvent);