You are here

function _l10n_update_status_debug_info in Localization update 7.2

Provides debug info for projects in case translation files are not found.

Translations files are being fetched either from Drupal translation server and local files or only from the local filesystem depending on the "Translation source" setting at admin/config/regional/language/update. This method will produce debug information including the respective path(s) based on this setting.

Translations for development versions are never fetched, so the debug info for that is a fixed message.

Parameters

object $source: An object which is the project information of the source.

Return value

string The string which contains debug information.

1 call to _l10n_update_status_debug_info()
l10n_update_status_form in ./l10n_update.admin.inc
Page callback: Translation status page.

File

./l10n_update.admin.inc, line 381
Admin settings and update page.

Code

function _l10n_update_status_debug_info($source) {
  $remote_path = isset($source->files['remote']->uri) ? $source->files['remote']->uri : '';
  $local_path = isset($source->files['local']->uri) ? $source->files['local']->uri : '';
  if (strpos($source->version, 'dev') !== FALSE) {
    return t('No translation files are provided for development releases.');
  }
  if (l10n_update_use_remote_source() && $remote_path && $local_path) {
    return t('File not found at %remote_path nor at %local_path', array(
      '%remote_path' => $remote_path,
      '%local_path' => $local_path,
    ));
  }
  elseif ($local_path) {
    return t('File not found at %local_path', array(
      '%local_path' => $local_path,
    ));
  }
  return t('Translation file location could not be determined.');
}