diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 0581af4..a6c415e 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -431,11 +431,11 @@ function locale_translate_batch_import($filepath, $options, &$context) { ); // The filename is either {langcode}.po or {prefix}.{langcode}.po, so // we can extract the language code to use for the import from the end. - if ($options['langcode'] || preg_match('!(/|\.)([^\./]+)\.po$!', $filepath, $matches)) { + if (!empty($options['langcode']) || preg_match('!(/|\.)([^\./]+)\.po$!', $filepath, $matches)) { $file = entity_create('file', array('filename' => drupal_basename($filepath), 'uri' => $filepath)); // We need only the last match, but only if the langcode is not explicitly // specified in the $options array. - if (!$options['langcode'] && is_array($matches)) { + if (empty($options['langcode']) && is_array($matches)) { $options['langcode'] = array_pop($matches); } try {