1/** 2 * @file 3 * 4 * Registers localized ALTCHA labels through Drupal config translations. 5 */ 6(function (Drupal, drupalSettings) { 7 8 'use strict'; 9 10 Drupal.behaviors.altchaDrupalTranslations = { 11 attach() { 12 const i18n = globalThis.altchaI18n; 13 if (!i18n) { 14 return; 15 } 16 17 const currentLanguage = drupalSettings?.altcha.i18n?.currentLanguage || null; 18 const overriddenLabels = drupalSettings?.altcha.i18n?.labels || {}; 19 if (currentLanguage && overriddenLabels) { 20 const existingLabels = typeof i18n.get === 'function' ? i18n.get(currentLanguage) || {} : {}; 21 i18n.set(currentLanguage, { 22 ...existingLabels, 23 ...overriddenLabels 24 }); 25 } 26 27 globalThis.altchaI18n = i18n; 28 } 29 }; 30 31})(Drupal, drupalSettings);
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.