comparison core/modules/locale/locale.bulk.js @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, Drupal) {
9 Drupal.behaviors.importLanguageCodeSelector = {
10 attach: function attach(context, settings) {
11 var $form = $('#locale-translate-import-form').once('autodetect-lang');
12 if ($form.length) {
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]);
18 }
19 });
20 }
21 }
22 };
23 })(jQuery, Drupal);