PageSourceSearch

https://recovery.lacounty.gov/wp-content/themes/blade-child/scripts/add_google_translate_to_header.js

js lacounty.gov collected 2026-10-01 07:33:08 UTC 1,041 bytes, 22 lines download raw bytes

1// This script replaces the existing Blade Translate widget and replaces it with a Google Translate element
2
3var globHeaderElement = document.querySelector('.grve-header-element:has(i.grve-icon-globe)');
4
5if (globHeaderElement != null) {
6    // When element is found, clear out all contents
7    globHeaderElement.innerHTML = '';
8    // Create new element for Google Translate Element
9    var googleTranlateElement = document.createElement('div');
10    googleTranlateElement.id = 'google_translate_element';
11    // Append new element to empty header element
12    globHeaderElement.appendChild(googleTranlateElement);
13}
14// Call back function that generates element once src files are available
15function googleTranslateElementInit() {
16    new google.translate.TranslateElement({
17        pageLanguage: 'en'
18    },
19        'google_translate_element');
20    // Adds the fully genereated element to the hidden mobile nav menu
21    document.querySelector('ul.grve-language').append(document.querySelector('#google_translate_element').cloneNode(true));
22}

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.