2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function ($, Drupal) {
9 Drupal.behaviors.importLanguageCodeSelector = {
10 attach: function attach(context, settings) {
11 var $form = $('#locale-translate-import-form').once('autodetect-lang');
13 var $langcode = $form.find('.langcode-input');
14 $form.find('.file-import-input').on('change', function () {
15 var matches = $(this).val().match(/([^.][\.]*)([\w-]+)\.po$/);
16 if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) {
17 $langcode.val(matches[2]);