Hi,

I've been using l10n_update 1.x for a while now in my custom drupal distribution. In my distroname.profile file I've got the following section:

function distroname_install_tasks($install_state) {

  // Installs additional languages.
  return array(
    'install_additional_languages' => array(
      'type' => 'batch',
    ),
  );
}

function install_additional_languages(&$install_state) {

  module_load_include('check.inc', 'l10n_update');
  module_load_include('batch.inc', 'l10n_update');

  $operations = array();
  $translations = array(
    'nn', // Norsk nynorsk
    //'se', // Northern Sami
  );

  foreach ($translations as $translation) {
    locale_add_language(strtolower($translation));

    // Build batch with l10n_update module.
    $history = l10n_update_get_history();
    $available = l10n_update_available_releases();
    $updates = l10n_update_build_updates($history, $available);

    $operations = array_merge($operations, _l10n_update_prepare_updates($updates, NULL, array()));
  }

  $batch = l10n_update_batch_multiple($operations, LOCALE_IMPORT_KEEP);
  return $batch;
}

And this used to work fine. Not so with l10n_update 7.0-2.0. I get the following error:

PHP Fatal error:  Call to undefined function l10n_update_get_history()

It should be mentioned, that I also get an error when running drush make before I get this far:

Example:

title-7.x-1.0-alpha7 downloaded.     [ok]
Could not retrieve l10n update url for .     [error]

These aren't related I guess, let me know if I should split them up.

Could someone please provide a best practice for a drupal distro with language support? I've searched around, looked at other distros withouth luck.
Thank you for your time.

Comments

odegard’s picture

I've found an issue in the l10n_install issue queue here that is probably better place to discuss this. #2530434: Upgrade to Localization update 7.x-2.0

odegard’s picture

Status: Active » Closed (fixed)

See other issue for interim solution.