Mercurial > hg > isophonics-drupal-site
annotate core/modules/locale/locale.bulk.js @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * DO NOT EDIT THIS FILE. |
Chris@0 | 3 * See the following change record for more information, |
Chris@0 | 4 * https://www.drupal.org/node/2815083 |
Chris@0 | 5 * @preserve |
Chris@0 | 6 **/ |
Chris@0 | 7 |
Chris@0 | 8 (function ($, Drupal) { |
Chris@0 | 9 Drupal.behaviors.importLanguageCodeSelector = { |
Chris@0 | 10 attach: function attach(context, settings) { |
Chris@0 | 11 var $form = $('#locale-translate-import-form').once('autodetect-lang'); |
Chris@0 | 12 if ($form.length) { |
Chris@0 | 13 var $langcode = $form.find('.langcode-input'); |
Chris@0 | 14 $form.find('.file-import-input').on('change', function () { |
Chris@14 | 15 var matches = $(this).val().match(/([^.][.]*)([\w-]+)\.po$/); |
Chris@0 | 16 if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) { |
Chris@0 | 17 $langcode.val(matches[2]); |
Chris@0 | 18 } |
Chris@0 | 19 }); |
Chris@0 | 20 } |
Chris@0 | 21 } |
Chris@0 | 22 }; |
Chris@0 | 23 })(jQuery, Drupal); |