- Issue created by @orkut murat yılmaz
- 🇹🇷Turkey orkut murat yılmaz Istanbul
Problem still remains, even when I turn the view cache off.
- 🇹🇷Turkey orkut murat yılmaz Istanbul
I've also tried to cache setting as tag based, it didn't work either.
- 🇹🇷Turkey orkut murat yılmaz Istanbul
I've solved my problem with Asset Injector → module.
After installing the module, I've added a JS Injector with a relevant name and the code below:
function replaceText(searchTextArray, replacementTextArray) { const textNodes = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false); while (textNodes.nextNode()) { const node = textNodes.currentNode; let nodeText = node.nodeValue; for (let i = 0; i < searchTextArray.length; i++) { const searchText = searchTextArray[i]; const replacementText = replacementTextArray[i]; if (nodeText.includes(searchText)) { nodeText = nodeText.replaceAll(searchText, replacementText); } } node.nodeValue = nodeText; } } document.addEventListener("DOMContentLoaded", function() { const searchTextArray = ["Original Layer Name 1", "Translation of Layer Name 1"]; const replacementTextArray = ["Original Layer Name 2", "Translation of Layer Name 2"]; replaceText(searchTextArray, replacementTextArray); });
After setting the conditions, saved the JS injector and flushed the cache.
Until this conflict is solved, this quick and dirty solution might help.
- 🇹🇷Turkey orkut murat yılmaz Istanbul
I've also installed the leaflet's latest dev version, but the problem remained. I'm adding the related issue too.