Commit 075f222a authored by dhruveshdtripathi's avatar dhruveshdtripathi Committed by Robert Ragas

Issue #2843899 by nehakhadke, dhruveshdtripathi: $this->t() should be used...

Issue #2843899 by nehakhadke, dhruveshdtripathi: $this->t() should be used instead of t() for Drupal 8 version
parent 459011cd
......@@ -64,11 +64,11 @@ class YoastSeoController extends ControllerBase {
// Inform the user about altering the XML Sitemap configuration on the
// module configuration page if he has access to do so.
if (\Drupal::currentUser()->hasPermission('administer xmlsitemap')) {
$xmlsitemap_description = t(
$xmlsitemap_description = $this->t(
'You can configure the XML Sitemap settings at the @url.',
[
'@url' => \Drupal::l(
t('XML Sitemap configuration page'),
$this->t('XML Sitemap configuration page'),
Url::fromRoute('xmlsitemap.admin_search')
),
]
......@@ -76,13 +76,13 @@ class YoastSeoController extends ControllerBase {
}
else {
$xmlsitemap_description
= t('You do not have the permission to administer XML Sitemap.');
= $this->t('You do not have the permission to administer XML Sitemap.');
}
}
else {
// XML Sitemap is not enabled, inform the user he should think about
// installing and enabling it.
$xmlsitemap_description = t(
$xmlsitemap_description = $this->t(
'You currently do not have XML Sitemap enabled. We strongly recommend you to install XML Sitemap. You can download the module from <a href="@project-page-url">@project-page-url</a>.',
['@project-page-url' => 'https://www.drupal.org/project/xmlsitemap']
);
......@@ -90,7 +90,7 @@ class YoastSeoController extends ControllerBase {
$form['xmlsitemap'] = [
'#type' => 'details',
'#title' => t('XML Sitemap'),
'#title' => $this->t('XML Sitemap'),
'#markup' => $xmlsitemap_description,
'#open' => TRUE,
];
......@@ -99,11 +99,11 @@ class YoastSeoController extends ControllerBase {
// configuration page if he has access to do so.
// We do not check if the module is enabled since it is our dependency.
if (\Drupal::currentUser()->hasPermission('administer meta tags')) {
$metatag_description = t(
$metatag_description = $this->t(
'You can configure and override the Metatag title & description default settings at the @url.',
[
'@url' => \Drupal::l(
t('Metatag configuration page'),
$this->t('Metatag configuration page'),
Url::fromRoute('entity.metatag_defaults.collection')
),
]
......@@ -111,12 +111,12 @@ class YoastSeoController extends ControllerBase {
}
else {
$metatag_description
= t('You currently do not have the permission to administer Metatag.');
= $this->t('You currently do not have the permission to administer Metatag.');
}
$form['metatag'] = [
'#type' => 'details',
'#title' => t('Configure Metatag default templates'),
'#title' => $this->t('Configure Metatag default templates'),
'#markup' => $metatag_description,
'#open' => TRUE,
];
......
......@@ -37,7 +37,7 @@ class YoastSeoConfigForm extends FormBase {
// enable/disable Yoast SEO for supported bundles.
$form[$entity_type] = array(
'#type' => 'checkboxes',
'#title' => t('@label', array('@label' => $entity_label)),
'#title' => $this->t('@label', array('@label' => $entity_label)),
'#options' => $options,
'#required' => FALSE,
'#default_value' => $enabled_bundles,
......@@ -48,7 +48,7 @@ class YoastSeoConfigForm extends FormBase {
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#value' => $this->t('Save'),
);
return $form;
......
......@@ -77,7 +77,7 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
public function settingsSummary() {
$summary = [];
$summary[] = t('Body: @body', ['@body' => $this->getSetting('body')]);
$summary[] = $this->t('Body: @body', ['@body' => $this->getSetting('body')]);
return $summary;
}
......@@ -107,7 +107,7 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
$element['body'] = [
'#type' => 'select',
'#title' => t('Body'),
'#title' => $this->t('Body'),
'#required' => TRUE,
'#description' => $this->t('Select a field which is used as the body field.'),
'#options' => $text_fields,
......@@ -126,7 +126,7 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
// Create the form element.
$element['yoast_seo'] = array(
'#type' => 'details',
'#title' => t('Real-time SEO for drupal'),
'#title' => $this->t('Real-time SEO for drupal'),
'#open' => TRUE,
'#attached' => array(
'library' => array(
......@@ -138,16 +138,16 @@ class YoastSeoWidget extends WidgetBase implements ContainerFactoryPluginInterfa
$element['yoast_seo']['focus_keyword'] = array(
'#type' => 'textfield',
'#title' => t('Focus keyword'),
'#title' => $this->t('Focus keyword'),
'#default_value' => isset($items[$delta]->focus_keyword) ? $items[$delta]->focus_keyword : NULL,
'#description' => t("Pick the main keyword or keyphrase that this post/page is about."),
'#description' => $this->t("Pick the main keyword or keyphrase that this post/page is about."),
);
$element['yoast_seo']['status'] = array(
'#type' => 'hidden',
'#title' => t('Real-time SEO status'),
'#title' => $this->t('Real-time SEO status'),
'#default_value' => isset($items[$delta]->status) ? $items[$delta]->status : NULL,
'#description' => t("The SEO status in points."),
'#description' => $this->t("The SEO status in points."),
);
return $element;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment