Commit 6bfdc3bd authored by alexpott's avatar alexpott
Browse files

Issue #2570355 by Sutharsan, stefan.r, kgoel, josephdpurcell, joelpittet,...

Issue #2570355 by Sutharsan, stefan.r, kgoel, josephdpurcell, joelpittet, justAChris, dawehner, pfrenssen, pwolanin, David_Rothstein, catch: Replace remaining !placeholder and @placeholder with :placeholder for URLs
parent e2d424db
......@@ -844,7 +844,7 @@ function batch_process($redirect = NULL, Url $url = NULL, $redirect_callback = N
$query_options['op'] = 'finished';
$error_url->setOption('query', $query_options);
$batch['error_message'] = t('Please continue to <a href="@error_url">the error page</a>', array('@error_url' => $error_url->toString(TRUE)->getGeneratedUrl()));
$batch['error_message'] = t('Please continue to <a href=":error_url">the error page</a>', array(':error_url' => $error_url->toString(TRUE)->getGeneratedUrl()));
// Clear the way for the redirection to the batch processing page, by
// saving and unsetting the 'destination', if there is any.
......
......@@ -1864,7 +1864,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Translations directory'),
'value' => t('The translations directory does not exist.'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array('%translations_directory' => $translations_directory, '@install_txt' => base_path() . 'core/INSTALL.txt')),
'description' => t('The installer requires that you create a translations directory as part of the installation process. Create the directory %translations_directory . More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.', array('%translations_directory' => $translations_directory, ':install_txt' => base_path() . 'core/INSTALL.txt')),
);
}
else {
......@@ -1878,7 +1878,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Translations directory'),
'value' => t('The translations directory is not readable.'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The installer requires read permissions to %translations_directory at all times. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array('%translations_directory' => $translations_directory, '@handbook_url' => 'https://www.drupal.org/server-permissions')),
'description' => t('The installer requires read permissions to %translations_directory at all times. If you are unsure how to grant file permissions, consult the <a href=":handbook_url">online handbook</a>.', array('%translations_directory' => $translations_directory, ':handbook_url' => 'https://www.drupal.org/server-permissions')),
);
}
// If translations directory is not writable, throw an error.
......@@ -1887,7 +1887,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Translations directory'),
'value' => t('The translations directory is not writable.'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The installer requires write permissions to %translations_directory during the installation process. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array('%translations_directory' => $translations_directory, '@handbook_url' => 'https://www.drupal.org/server-permissions')),
'description' => t('The installer requires write permissions to %translations_directory during the installation process. If you are unsure how to grant file permissions, consult the <a href=":handbook_url">online handbook</a>.', array('%translations_directory' => $translations_directory, ':handbook_url' => 'https://www.drupal.org/server-permissions')),
);
}
else {
......@@ -1904,7 +1904,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Internet'),
'value' => t('The translation server is offline.'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href="!server_url">!server_url</a>.', array('!server_url' => $server_url)),
'description' => t('The installer requires to contact the translation server to download a translation file. Check your internet connection and verify that your website can reach the translation server at <a href=":server_url">@server_url</a>.', array(':server_url' => $server_url, '@server_url' => $server_url)),
);
}
else {
......@@ -1919,7 +1919,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Translation'),
'value' => t('The %language translation is not available.', array('%language' => $language)),
'severity' => REQUIREMENT_ERROR,
'description' => t('The %language translation file is not available at the translation server. <a href="@url">Choose a different language</a> or select English and translate your website later.', array('%language' => $language, '@url' => UrlHelper::stripDangerousProtocols($_SERVER['SCRIPT_NAME']))),
'description' => t('The %language translation file is not available at the translation server. <a href=":url">Choose a different language</a> or select English and translate your website later.', array('%language' => $language, ':url' => $_SERVER['SCRIPT_NAME'])),
);
}
else {
......@@ -1938,7 +1938,7 @@ function install_check_translations($langcode, $server_pattern) {
'title' => t('Translation'),
'value' => t('The %language translation could not be downloaded.', array('%language' => $language)),
'severity' => REQUIREMENT_ERROR,
'description' => t('The %language translation file could not be downloaded. <a href="@url">Choose a different language</a> or select English and translate your website later.', array('%language' => $language, '@url' => UrlHelper::stripDangerousProtocols($_SERVER['SCRIPT_NAME']))),
'description' => t('The %language translation file could not be downloaded. <a href=":url">Choose a different language</a> or select English and translate your website later.', array('%language' => $language, ':url' => $_SERVER['SCRIPT_NAME'])),
);
}
}
......@@ -2053,11 +2053,11 @@ function install_check_requirements($install_state) {
'title' => $default_file_info['title'],
'value' => t('The %file does not exist.', array('%file' => $default_file_info['title'])),
'severity' => REQUIREMENT_ERROR,
'description' => t('The @drupal installer requires that you create a %file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>.', array(
'description' => t('The @drupal installer requires that you create a %file as part of the installation process. Copy the %default_file file to %file. More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>.', array(
'@drupal' => drupal_install_profile_distribution_name(),
'%file' => $file,
'%default_file' => $default_file,
'@install_txt' => base_path() . 'core/INSTALL.txt'
':install_txt' => base_path() . 'core/INSTALL.txt'
)),
);
}
......@@ -2072,10 +2072,10 @@ function install_check_requirements($install_state) {
'title' => $default_file_info['title'],
'value' => t('The %file is not readable.', array('%file' => $default_file_info['title'])),
'severity' => REQUIREMENT_ERROR,
'description' => t('@drupal requires read permissions to %file at all times. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array(
'description' => t('@drupal requires read permissions to %file at all times. If you are unsure how to grant file permissions, consult the <a href=":handbook_url">online handbook</a>.', array(
'@drupal' => drupal_install_profile_distribution_name(),
'%file' => $file,
'@handbook_url' => 'https://www.drupal.org/server-permissions'
':handbook_url' => 'https://www.drupal.org/server-permissions'
)),
);
}
......@@ -2085,10 +2085,10 @@ function install_check_requirements($install_state) {
'title' => $default_file_info['title'],
'value' => t('The %file is not writable.', array('%file' => $default_file_info['title'])),
'severity' => REQUIREMENT_ERROR,
'description' => t('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the <a href="@handbook_url">online handbook</a>.', array(
'description' => t('The @drupal installer requires write permissions to %file during the installation process. If you are unsure how to grant file permissions, consult the <a href=":handbook_url">online handbook</a>.', array(
'@drupal' => drupal_install_profile_distribution_name(),
'%file' => $file,
'@handbook_url' => 'https://www.drupal.org/server-permissions'
':handbook_url' => 'https://www.drupal.org/server-permissions'
)),
);
}
......@@ -2103,12 +2103,12 @@ function install_check_requirements($install_state) {
'title' => $default_file_info['title'],
'value' => t('The @file is owned by the web server.', array('@file' => $default_file_info['title'])),
'severity' => REQUIREMENT_ERROR,
'description' => t('The @drupal installer failed to create a %file file with proper file ownership. Log on to your web server, remove the existing %file file, and create a new one by copying the %default_file file to %file. More details about installing Drupal are available in <a href="@install_txt">INSTALL.txt</a>. If you have problems with the file permissions on your server, consult the <a href="@handbook_url">online handbook</a>.', array(
'description' => t('The @drupal installer failed to create a %file file with proper file ownership. Log on to your web server, remove the existing %file file, and create a new one by copying the %default_file file to %file. More details about installing Drupal are available in <a href=":install_txt">INSTALL.txt</a>. If you have problems with the file permissions on your server, consult the <a href=":handbook_url">online handbook</a>.', array(
'@drupal' => drupal_install_profile_distribution_name(),
'%file' => $file,
'%default_file' => $default_file,
'@install_txt' => base_path() . 'core/INSTALL.txt',
'@handbook_url' => 'https://www.drupal.org/server-permissions'
':install_txt' => base_path() . 'core/INSTALL.txt',
':handbook_url' => 'https://www.drupal.org/server-permissions'
)),
);
}
......@@ -2148,11 +2148,11 @@ function install_display_requirements($install_state, $requirements) {
$build['report']['#requirements'] = $requirements;
if ($severity == REQUIREMENT_WARNING) {
$build['#title'] = t('Requirements review');
$build['#suffix'] = t('Check the messages and <a href="@retry">retry</a>, or you may choose to <a href="@cont">continue anyway</a>.', array('@retry' => UrlHelper::stripDangerousProtocols(drupal_requirements_url(REQUIREMENT_ERROR)), '@cont' => UrlHelper::stripDangerousProtocols(drupal_requirements_url($severity))));
$build['#suffix'] = t('Check the messages and <a href=":retry">retry</a>, or you may choose to <a href=":cont">continue anyway</a>.', array(':retry' => drupal_requirements_url(REQUIREMENT_ERROR), ':cont' => drupal_requirements_url($severity)));
}
else {
$build['#title'] = t('Requirements problem');
$build['#suffix'] = t('Check the messages and <a href="@url">try again</a>.', array('@url' => UrlHelper::stripDangerousProtocols(drupal_requirements_url($severity))));
$build['#suffix'] = t('Check the messages and <a href=":url">try again</a>.', array(':url' => drupal_requirements_url($severity)));
}
return $build;
}
......
......@@ -482,9 +482,9 @@ function drupal_install_config_directories() {
// itself. But if it somehow fails anyway, the installation cannot proceed.
// Bail out using a similar error message as in system_requirements().
if (!install_ensure_config_directory(CONFIG_STAGING_DIRECTORY)) {
throw new Exception(t('The directory %directory could not be created or could not be made writable. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see the <a href="@handbook_url">online handbook</a>.', array(
throw new Exception(t('The directory %directory could not be created or could not be made writable. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see the <a href=":handbook_url">online handbook</a>.', array(
'%directory' => config_get_config_directory(CONFIG_STAGING_DIRECTORY),
'@handbook_url' => 'https://www.drupal.org/server-permissions',
':handbook_url' => 'https://www.drupal.org/server-permissions',
)));
}
......
......@@ -29,26 +29,26 @@ function unicode_requirements() {
'value' => $libraries[$library],
'severity' => $severities[$library],
);
$t_args = array('@url' => 'http://www.php.net/mbstring');
$t_args = array(':url' => 'http://www.php.net/mbstring');
switch ($failed_check) {
case 'mb_strlen':
$requirements['unicode']['description'] = t('Operations on Unicode strings are emulated on a best-effort basis. Install the <a href="@url">PHP mbstring extension</a> for improved Unicode support.', $t_args);
$requirements['unicode']['description'] = t('Operations on Unicode strings are emulated on a best-effort basis. Install the <a href=":url">PHP mbstring extension</a> for improved Unicode support.', $t_args);
break;
case 'mbstring.func_overload':
$requirements['unicode']['description'] = t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini <em>mbstring.func_overload</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', $t_args);
$requirements['unicode']['description'] = t('Multibyte string function overloading in PHP is active and must be disabled. Check the php.ini <em>mbstring.func_overload</em> setting. Please refer to the <a href=":url">PHP mbstring documentation</a> for more information.', $t_args);
break;
case 'mbstring.encoding_translation':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', $t_args);
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href=":url">PHP mbstring documentation</a> for more information.', $t_args);
break;
case 'mbstring.http_input':
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', $t_args);
$requirements['unicode']['description'] = t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href=":url">PHP mbstring documentation</a> for more information.', $t_args);
break;
case 'mbstring.http_output':
$requirements['unicode']['description'] = t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', $t_args);
$requirements['unicode']['description'] = t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href=":url">PHP mbstring documentation</a> for more information.', $t_args);
break;
}
......
......@@ -72,7 +72,7 @@ protected function connect() {
catch (\Exception $e) {
// Detect utf8mb4 incompability.
if ($e->getCode() == Connection::UNSUPPORTED_CHARSET) {
$this->fail(t('Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the <a href="@documentation" target="_blank">MySQL documentation</a> for more information.', array('@documentation' => 'https://dev.mysql.com/doc/refman/5.0/en/cannot-initialize-character-set.html')));
$this->fail(t('Your MySQL server and PHP MySQL driver must support utf8mb4 character encoding. Make sure to use a database system that supports this (such as MySQL/MariaDB/Percona 5.5.3 and up), and that the utf8mb4 character set is compiled in. See the <a href=":documentation" target="_blank">MySQL documentation</a> for more information.', array(':documentation' => 'https://dev.mysql.com/doc/refman/5.0/en/cannot-initialize-character-set.html')));
$info = Database::getConnectionInfo();
$info_copy = $info;
// Set a flag to fall back to utf8. Note: this flag should only be
......
......@@ -116,7 +116,7 @@ public function onKernelRequestMaintenance(GetResponseEvent $event) {
// settings page.
if ($route_match->getRouteName() != 'system.site_maintenance_mode') {
if ($this->account->hasPermission('administer site configuration')) {
$this->drupalSetMessage($this->t('Operating in maintenance mode. <a href="@url">Go online.</a>', array('@url' => $this->urlGenerator->generate('system.site_maintenance_mode'))), 'status', FALSE);
$this->drupalSetMessage($this->t('Operating in maintenance mode. <a href=":url">Go online.</a>', array(':url' => $this->urlGenerator->generate('system.site_maintenance_mode'))), 'status', FALSE);
}
else {
$this->drupalSetMessage($this->t('Operating in maintenance mode.'), 'status', FALSE);
......
......@@ -950,13 +950,13 @@ function hook_requirements($phase) {
}
else {
$requirements['cron'] = array(
'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href="@url">configuring cron jobs</a>.', array('@url' => 'https://www.drupal.org/cron')),
'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for <a href=":url">configuring cron jobs</a>.', array(':url' => 'https://www.drupal.org/cron')),
'severity' => REQUIREMENT_ERROR,
'value' => t('Never run'),
);
}
$requirements['cron']['description'] .= ' ' . t('You can <a href="@cron">run cron manually</a>.', array('@cron' => \Drupal::url('system.run_cron')));
$requirements['cron']['description'] .= ' ' . t('You can <a href=":cron">run cron manually</a>.', array(':cron' => \Drupal::url('system.run_cron')));
$requirements['cron']['title'] = t('Cron maintenance tasks');
}
......
......@@ -126,7 +126,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
$elements['custom_date_format'] = array(
'#type' => 'textfield',
'#title' => $this->t('Custom date format'),
'#description' => $this->t('See <a href="@url" target="_blank">the documentation for PHP date formats</a>.', ['@url' => 'http://php.net/manual/function.date.php']),
'#description' => $this->t('See <a href=":url" target="_blank">the documentation for PHP date formats</a>.', [':url' => 'http://php.net/manual/function.date.php']),
'#default_value' => $this->getSetting('custom_date_format') ?: '',
);
......
......@@ -63,7 +63,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
if (!$this->getRequest()->isSecure()) {
$form['information']['https_warning'] = array(
'#prefix' => '<div class="messages messages--error">',
'#markup' => $this->t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. <a href="@https-link">Learn more</a>.', array('@https-link' => 'https://www.drupal.org/https-information')),
'#markup' => $this->t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. <a href=":https-link">Learn more</a>.', array(':https-link' => 'https://www.drupal.org/https-information')),
'#suffix' => '</div>',
);
}
......@@ -179,9 +179,9 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
catch (\Exception $e) {
// The format of this error message is similar to that used on the
// database connection form in the installer.
$form_state->setErrorByName('connection_settings', $this->t('Failed to connect to the server. The server reports the following message: <p class="error">@message</p> For more help installing or updating code on your server, see the <a href="@handbook_url">handbook</a>.', array(
$form_state->setErrorByName('connection_settings', $this->t('Failed to connect to the server. The server reports the following message: <p class="error">@message</p> For more help installing or updating code on your server, see the <a href=":handbook_url">handbook</a>.', array(
'@message' => $e->getMessage(),
'@handbook_url' => 'https://www.drupal.org/documentation/install/modules-themes',
':handbook_url' => 'https://www.drupal.org/documentation/install/modules-themes',
)));
}
}
......
......@@ -133,7 +133,7 @@ public function setInvalidTokenError(FormStateInterface $form_state) {
$url = $this->requestStack->getCurrentRequest()->getRequestUri();
// Setting this error will cause the form to fail validation.
$form_state->setErrorByName('form_token', $this->t('The form has become outdated. Copy any unsaved work in the form below and then <a href="@link">reload this page</a>.', array('@link' => $url)));
$form_state->setErrorByName('form_token', $this->t('The form has become outdated. Copy any unsaved work in the form below and then <a href=":link">reload this page</a>.', array(':link' => $url)));
}
/**
......
......@@ -26,11 +26,11 @@ public function __construct(TranslationInterface $string_translation) {
$title = $this->t('Drupal already installed');
$message = $this->t('<ul>
<li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
<li>To upgrade an existing installation, proceed to the <a href="!update-url">update script</a>.</li>
<li>View your <a href="!base-url">existing site</a>.</li>
<li>To upgrade an existing installation, proceed to the <a href=":update-url">update script</a>.</li>
<li>View your <a href=":base-url">existing site</a>.</li>
</ul>', array(
'!base-url' => $GLOBALS['base_url'],
'!update-url' => $GLOBALS['base_path'] . 'update.php',
':base-url' => $GLOBALS['base_url'],
':update-url' => $GLOBALS['base_path'] . 'update.php',
));
parent::__construct($message, $title);
}
......
......@@ -137,7 +137,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
// successfully.)
$post_params = $this->getRequest()->request->all();
if (empty($post_params) && (!drupal_verify_install_file($this->root . '/' . $settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($this->root . '/' . $settings_dir, FILE_NOT_WRITABLE, 'dir'))) {
drupal_set_message(t('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href="@handbook_url">online handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'https://www.drupal.org/server-permissions')), 'warning');
drupal_set_message(t('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href=":handbook_url">online handbook</a>.', array('%dir' => $settings_dir, '%file' => $settings_file, ':handbook_url' => 'https://www.drupal.org/server-permissions')), 'warning');
}
$form['#attached']['library'][] = 'system/drupal.system';
......@@ -227,7 +227,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
2 => $this->t('Receive email notifications'),
),
'#default_value' => array(1, 2),
'#description' => $this->t('The system will notify you when updates and important security releases are available for installed components. Anonymous information about your site is sent to <a href="@drupal">Drupal.org</a>.', array('@drupal' => 'https://www.drupal.org')),
'#description' => $this->t('The system will notify you when updates and important security releases are available for installed components. Anonymous information about your site is sent to <a href=":drupal">Drupal.org</a>.', array(':drupal' => 'https://www.drupal.org')),
'#weight' => 15,
);
$form['update_notifications']['update_status_module'][2] = array(
......
......@@ -31,7 +31,7 @@ interface LinkGeneratorInterface {
* However, for links enclosed in translatable text you should use t() and
* embed the HTML anchor tag directly in the translated string. For example:
* @code
* $text = t('Visit the <a href="@url">content types</a> page', array('@url' => \Drupal::url('entity.node_type.collection')));
* $text = t('Visit the <a href=":url">content types</a> page', array(':url' => \Drupal::url('entity.node_type.collection')));
* @endcode
* This keeps the context of the link title ('settings' in the example) for
* translators.
......
......@@ -18,7 +18,7 @@ function aggregator_requirements($phase) {
);
if (!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = t('The Aggregator module could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/curl.setup.php'));
$requirements['curl']['description'] = t('The Aggregator module could not be installed because the PHP <a href=":curl_url">cURL</a> library is not available.', array(':curl_url' => 'http://php.net/manual/curl.setup.php'));
}
return $requirements;
}
......@@ -168,7 +168,7 @@ public function adminOverview() {
'#type' => 'table',
'#header' => $header,
'#rows' => $rows,
'#empty' => $this->t('No feeds available. <a href="@link">Add feed</a>.', array('@link' => $this->url('aggregator.feed_add'))),
'#empty' => $this->t('No feeds available. <a href=":link">Add feed</a>.', array(':link' => $this->url('aggregator.feed_add'))),
);
return $build;
......
......@@ -87,7 +87,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#title' => $this->t('Update interval'),
'#default_value' => 3600,
'#options' => $period,
'#description' => $this->t('The length of time between feed updates. Requires a correctly configured <a href="@cron">cron maintenance task</a>.', array('@cron' => $this->url('system.status'))),
'#description' => $this->t('The length of time between feed updates. Requires a correctly configured <a href=":cron">cron maintenance task</a>.', array(':cron' => $this->url('system.status'))),
);
$form['actions'] = array('#type' => 'actions');
......
......@@ -154,7 +154,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
'#title' => t('Discard items older than'),
'#default_value' => $config->get('items.expire'),
'#options' => $period,
'#description' => t('Requires a correctly configured <a href="@cron">cron maintenance task</a>.', array('@cron' => $this->url('system.status'))),
'#description' => t('Requires a correctly configured <a href=":cron">cron maintenance task</a>.', array(':cron' => $this->url('system.status'))),
);
$lengths = array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000);
......
......@@ -86,8 +86,8 @@ public function add(Request $request) {
}
if (count($types) === 0) {
return array(
'#markup' => $this->t('You have not created any block types yet. Go to the <a href="!url">block type creation page</a> to add a new block type.', [
'!url' => Url::fromRoute('block_content.type_add')->toString(),
'#markup' => $this->t('You have not created any block types yet. Go to the <a href=":url">block type creation page</a> to add a new block type.', [
':url' => Url::fromRoute('block_content.type_add')->toString(),
]),
);
}
......
......@@ -156,9 +156,9 @@ public function build() {
}
else {
return array(
'#markup' => $this->t('Block with uuid %uuid does not exist. <a href="!url">Add custom block</a>.', array(
'#markup' => $this->t('Block with uuid %uuid does not exist. <a href=":url">Add custom block</a>.', array(
'%uuid' => $this->getDerivativeId(),
'!url' => $this->urlGenerator->generate('block_content.add_page')
':url' => $this->urlGenerator->generate('block_content.add_page')
)),
'#access' => $this->account->hasPermission('administer blocks')
);
......
......@@ -78,7 +78,7 @@ public function render($empty = FALSE) {
/** @var \Drupal\Core\Access\AccessResultInterface|\Drupal\Core\Cache\CacheableDependencyInterface $access_result */
$access_result = $this->accessManager->checkNamedRoute('block_content.add_page', array(), $this->currentUser, TRUE);
$element = array(
'#markup' => $this->t('Add a <a href="!url">custom block</a>.', array('!url' => Url::fromRoute('block_content.add_page')->toString())),
'#markup' => $this->t('Add a <a href=":url">custom block</a>.', array(':url' => Url::fromRoute('block_content.add_page')->toString())),
'#access' => $access_result->isAllowed(),
'#cache' => [
'contexts' => $access_result->getCacheContexts(),
......
......@@ -22,14 +22,14 @@ function color_requirements($phase) {
// Check for PNG support.
if (!function_exists('imagecreatefrompng')) {
$requirements['color_gd']['severity'] = REQUIREMENT_WARNING;
$requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/ref.image.php'));
$requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href=":url">PHP image documentation</a> for information on how to correct this.', array(':url' => 'http://www.php.net/manual/ref.image.php'));
}
}
else {
$requirements['color_gd'] = array(
'value' => t('Not installed'),
'severity' => REQUIREMENT_ERROR,
'description' => t('The GD library for PHP is missing or outdated. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/book.image.php')),
'description' => t('The GD library for PHP is missing or outdated. Check the <a href=":url">PHP image documentation</a> for information on how to correct this.', array(':url' => 'http://www.php.net/manual/book.image.php')),
);
}
$requirements['color_gd']['title'] = t('GD library PNG support');
......
......@@ -410,7 +410,7 @@ function color_scheme_form_submit($form, FormStateInterface $form_state) {
$memory_limit = ini_get('memory_limit');
$size = Bytes::toInt($memory_limit);
if (!Environment::checkMemoryLimit($usage + $required, $memory_limit)) {
drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the <a href="@url">PHP documentation</a> for more information.', array('%size' => format_size($usage + $required - $size), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error');
drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the <a href=":url">PHP documentation</a> for more information.', array('%size' => format_size($usage + $required - $size), ':url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error');
return;
}
}
......
......@@ -175,15 +175,15 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) {
if ($this->userConfig->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
// Users can register themselves.
return $this->t('<a href="@login">Log in</a> or <a href="@register">register</a> to post comments', array(
'@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
'@register' => $this->urlGenerator->generateFromRoute('user.register', array(), array('query' => $destination)),
return $this->t('<a href=":login">Log in</a> or <a href=":register">register</a> to post comments', array(
':login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
':register' => $this->urlGenerator->generateFromRoute('user.register', array(), array('query' => $destination)),
));
}
else {
// Only admins can add new users, no public registration.
return $this->t('<a href="@login">Log in</a> to post comments', array(
'@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
return $this->t('<a href=":login">Log in</a> to post comments', array(
':login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
));
}
}
......
......@@ -194,7 +194,7 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state
'#title' => t('Comment type'),
'#options' => $options,
'#required' => TRUE,
'#description' => $this->t('Select the Comment type to use for this comment field. Manage the comment types from the <a href="@url">administration overview page</a>.', array('@url' => $this->url('entity.comment_type.collection'))),
'#description' => $this->t('Select the Comment type to use for this comment field. Manage the comment types from the <a href=":url">administration overview page</a>.', array(':url' => $this->url('entity.comment_type.collection'))),
'#default_value' => $this->getSetting('comment_type'),
'#disabled' => $has_data,
);
......
......@@ -129,7 +129,7 @@ public function itemPage(Request $request, RouteMatchInterface $route_match, $pl
$languages = $this->languageManager->getLanguages();
if (count($languages) == 1) {
drupal_set_message($this->t('In order to translate configuration, the website must have at least two <a href="@url">languages</a>.', array('@url' => $this->url('entity.configurable_language.collection'))), 'warning');
drupal_set_message($this->t('In order to translate configuration, the website must have at least two <a href=":url">languages</a>.', array(':url' => $this->url('entity.configurable_language.collection'))), 'warning');
}
$original_langcode = $mapper->getLangcode();
if (!isset($languages[$original_langcode])) {
......
......@@ -20,7 +20,7 @@ class DateFormat extends FormElementBase {
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
/** @var \Drupal\Core\Datetime\DateFormatter $date_formatter */
$date_formatter = \Drupal::service('date.formatter');
$description = $this->t('A user-defined date format. See the <a href="@url">PHP manual</a> for available options.', array('@url' => 'http://php.net/manual/function.date.php'));
$description = $this->t('A user-defined date format. See the <a href=":url">PHP manual</a> for available options.', array(':url' => 'http://php.net/manual/function.date.php'));
$format = $this->t('Displayed as %date_format', array('%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config)));
return [
......
......@@ -69,8 +69,8 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
// If there are no forms, do not display the form.
if (empty($contact_form)) {
if ($this->currentUser()->hasPermission('administer contact forms')) {
drupal_set_message($this->t('The contact form has not been configured. <a href="@add">Add one or more forms</a> .', array(
'@add' => $this->url('contact.form_add'))), 'error');
drupal_set_message($this->t('The contact form has not been configured. <a href=":add">Add one or more forms</a> .', array(
':add' => $this->url('contact.form_add'))), 'error');
return array();
}
else {
......
......@@ -23,12 +23,12 @@ function content_translation_install() {
function content_translation_enable() {
// Translation works when at least two languages are added.
if (count(\Drupal::languageManager()->getLanguages()) < 2) {
$t_args = array('!language_url' => \Drupal::url('entity.configurable_language.collection'));
$message = t('Be sure to <a href="!language_url">add at least two languages</a> to translate content.', $t_args);
$t_args = array(':language_url' => \Drupal::url('entity.configurable_language.collection'));
$message = t('Be sure to <a href=":language_url">add at least two languages</a> to translate content.', $t_args);
drupal_set_message($message, 'warning');
}
// Point the user to the content translation settings.
$t_args = array('!settings_url' => \Drupal::url('language.content_settings_page'));
$message = t('<a href="!settings_url">Enable translation</a> for <em>content types</em>, <em>taxonomy vocabularies</em>, <em>accounts</em>, or any other element you wish to translate.', $t_args);
$t_args = array(':settings_url' => \Drupal::url('language.content_settings_page'));
$message = t('<a href=":settings_url">Enable translation</a> for <em>content types</em>, <em>taxonomy vocabularies</em>, <em>accounts</em>, or any other element you wish to translate.', $t_args);
drupal_set_message($message, 'warning');
}
......@@ -376,8 +376,8 @@ function content_translation_form_field_config_edit_form_alter(array &$form, For
$toggle_url = \Drupal::url('language.content_settings_page', array(), array(
'query' => \Drupal::destination()->getAsArray(),
));
$form['translatable']['#description'] = t('To configure translation for this field, <a href="@language-settings-url">enable language support</a> for this type.', array(
'@language-settings-url' => $toggle_url,
$form['translatable']['#description'] = t('To configure translation for this field, <a href=":language-settings-url">enable language support</a> for this type.', array(
':language-settings-url' => $toggle_url,
));
}
......
......@@ -84,7 +84,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
$form['date_format'] = array(
'#type' => 'textfield',
'#title' => $this->t('Date/time format'),
'#description' => $this->t('See <a href="@url" target="_blank">the documentation for PHP date formats</a>.', ['@url' => 'http://php.net/manual/function.date.php']),
'#description' => $this->t('See <a href=":url" target="_blank">the documentation for PHP date formats</a>.', [':url' => 'http://php.net/manual/function.date.php']),
'#default_value' => $this->getSetting('date_format'),
);
......
......@@ -101,7 +101,7 @@ function dblog_form_system_logging_settings_alter(&$form, FormStateInterface $fo
'#title' => t('Database log messages to keep'),
'#default_value' => \Drupal::configFactory()->getEditable('dblog.settings')->get('row_limit'),
'#options' => array(0 => t('All')) + array_combine($row_limits, $row_limits),
'#description' => t('The maximum number of messages to keep in the database log. Requires a <a href="@cron">cron maintenance task</a>.', array('@cron' => \Drupal::url('system.status')))
'#description' => t('The maximum number of messages to keep in the database log. Requires a <a href=":cron">cron maintenance task</a>.', array(':cron' => \Drupal::url('system.status')))
);
$form['#submit'][] = 'dblog_logging_settings_submit';
......
......@@ -170,9 +170,9 @@ public function testFieldAdminHandler() {
'settings[handler]' => 'views',
);
$this->drupalPostAjaxForm($bundle_path . '/fields/' . $field_name, $edit, 'settings[handler]');
$this->assertRaw(t('No eligible views were found. <a href="@create">Create a view</a> with an <em>Entity Reference</em> display, or add such a display to an <a href="@existing">existing view</a>.', array(
'@create' => \Drupal::url('views_ui.add'),
'@existing' => \Drupal::url('entity.view.collection'),
$this->assertRaw(t('No eligible views were found. <a href=":create">Create a view</a> with an <em>Entity Reference</em> display, or add such a display to an <a href=":existing">existing view</a>.', array(
':create' => \Drupal::url('views_ui.add'),
':existing' => \Drupal::url('entity.view.collection'),
)));
$this->drupalPostForm(NULL, $edit, t('Save settings'));
// If no eligible view is available we should see a message.
......
......@@ -153,7 +153,7 @@ public function form(array $form, FormStateInterface $form_state) {