1import { Controller } from "@hotwired/stimulus" 2 3// Connects to data-controller="numiko--locale" 4export default class extends Controller { 5 static targets = ['localizedPaths'] 6 7 connect () { 8 const paths = this.localizedPathsTarget.dataset['localizedPaths']; 9 if (paths) { 10 const localizedPaths = JSON.parse(paths); 11 if (!localizedPaths) { return } 12 Object.keys(localizedPaths).forEach(locale => { 13 document.querySelectorAll(`[data-locale-localized-path="${locale}"]`).forEach(item => { 14 item.href += localizedPaths[locale].replace(/^\//, ''); 15 }) 16 }) 17 } 18 } 19}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.