示例#1
0
 /**
  * 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/translate/settings.
  * 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.
  *
  * @param array $project_info
  *   An array which is the project information of the source.
  *
  * @return string
  *   The string which contains debug information.
  */
 protected function createInfoString($project_info)
 {
     $remote_path = isset($project_info->files['remote']->uri) ? $project_info->files['remote']->uri : false;
     $local_path = isset($project_info->files['local']->uri) ? $project_info->files['local']->uri : false;
     if (strpos($project_info->version, 'dev') !== false) {
         return $this->trans('commands.locale.translation.status.messages.no-translation-files');
     }
     if (locale_translation_use_remote_source() && $remote_path && $local_path) {
         return sprintf($this->trans('commands.locale.translation.status.messages.file-not-found'), $local_path, $remote_path);
     } elseif ($local_path) {
         return sprintf($this->trans('commands.locale.translation.status.messages.local-file-not-found'), $local_path);
     }
     return $this->trans('commands.locale.translation.status.messages.translation-not-determined');
 }
 /**
  * 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/translate/settings.
  * 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.
  *
  * @param array $project_info
  *   An array which is the project information of the source.
  *
  * @return string
  *   The string which contains debug information.
  */
 protected function createInfoString($project_info)
 {
     $remote_path = isset($project_info->files['remote']->uri) ? $project_info->files['remote']->uri : FALSE;
     $local_path = isset($project_info->files['local']->uri) ? $project_info->files['local']->uri : FALSE;
     if (strpos($project_info->version, 'dev') !== FALSE) {
         return $this->t('No translation files are provided for development releases.');
     }
     if (locale_translation_use_remote_source() && $remote_path && $local_path) {
         return $this->t('File not found at %remote_path nor at %local_path', array('%remote_path' => $remote_path, '%local_path' => $local_path));
     } elseif ($local_path) {
         return $this->t('File not found at %local_path', array('%local_path' => $local_path));
     }
     return $this->t('Translation file location could not be determined.');
 }
示例#3
0
 /**
  * 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/translate/settings.
  * This method will produce debug information including the respective path(s)
  * based on this setting.
  *
  * @param array $project_info
  *   An array which is the project information of the source.
  *
  * @return string
  *   The string which contains debug information.
  */
 protected function createInfoString($project_info)
 {
     $remote_path = isset($project_info->files['remote']->uri) ? $project_info->files['remote']->uri : FALSE;
     $local_path = isset($project_info->files['local']->uri) ? $project_info->files['local']->uri : FALSE;
     if (locale_translation_use_remote_source() && $remote_path && $local_path) {
         return $this->t('File not found at %remote_path nor at %local_path', array('%remote_path' => $remote_path, '%local_path' => $local_path));
     } elseif ($local_path) {
         return $this->t('File not found at %local_path', array('%local_path' => $local_path));
     }
     return $this->t('Translation file location could not be determined.');
 }