Update privatebin.js

This commit is contained in:
TW - Vincent 2025-09-21 19:01:30 +02:00 committed by GitHub
parent 493d848c83
commit b0df8e10f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -930,7 +930,15 @@ jQuery.PrivateBin = (function($) {
} }
// load strings from JSON // 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; language = newLanguage;
translations = data; translations = data;
$(document).triggerHandler(languageLoadedEvent); $(document).triggerHandler(languageLoadedEvent);