diff --git a/core/modules/locale/locale.bulk.js b/core/modules/locale/locale.bulk.js index ba9986b..5cde1b0 100644 --- a/core/modules/locale/locale.bulk.js +++ b/core/modules/locale/locale.bulk.js @@ -14,9 +14,11 @@ var $langcode = $form.find('.langcode-input'); $form.find('.file-import-input') .on('change', function () { - var matches = $(this).val().match(/\.([\-\w]+)\.po/); - if (matches && $langcode.find('option[value="' + matches[1] + '"]').length) { - $langcode.val(matches[1]); + // If there is a language which prefix is on the filename before the + // extension, pre-select it on the language input. + var matches = $(this).val().match(/(|\.)([\-\w]+)\.po/); + if (matches && $langcode.find('option[value="' + matches[2] + '"]').length) { + $langcode.val(matches[2]); } }); }