X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fthemes%2Fcontrib%2Fbootstrap%2Fbootstrap.api.php;fp=web%2Fthemes%2Fcontrib%2Fbootstrap%2Fbootstrap.api.php;h=6110a29a31088fd00c36b6b24b42818a469490f0;hp=6346320d7a7d85f64165c37ba40371a1e190f9a5;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/themes/contrib/bootstrap/bootstrap.api.php b/web/themes/contrib/bootstrap/bootstrap.api.php index 6346320d7..6110a29a3 100644 --- a/web/themes/contrib/bootstrap/bootstrap.api.php +++ b/web/themes/contrib/bootstrap/bootstrap.api.php @@ -1,4 +1,5 @@ render()] = 'primary'; // This would also match the string above, however the class returned would // also be the one above; "matches" takes precedence over "contains". - $texts['contains'][t('Unique')] = 'notice'; + $texts['contains'][t('Unique')->render()] = 'notice'; // Remove matching for strings that contain "apply": - unset($texts['contains'][t('Apply')]); + unset($texts['contains'][t('Apply')->render()]); // Change the class that matches "Rebuild" (originally "warning"): - $texts['contains'][t('Rebuild')] = 'success'; + $texts['contains'][t('Rebuild')->render()] = 'success'; } /** @@ -43,19 +46,21 @@ function hook_bootstrap_colorize_text_alter(&$texts) { * * @see \Drupal\bootstrap\Bootstrap::glyphiconFromString() */ -function hook_bootstrap_iconize_text_alter(&$texts) { +function hook_bootstrap_iconize_text_alter(array &$texts) { // This matches the exact string: "My Unique Button Text". - $texts['matches'][t('My Unique Button Text')] = 'heart'; + // Note: the t() function in D8 returns a TranslatableMarkup object. + // It must be rendered to a string before it can be added as an array key. + $texts['matches'][t('My Unique Button Text')->render()] = 'heart'; // This would also match the string above, however the class returned would // also be the one above; "matches" takes precedence over "contains". - $texts['contains'][t('Unique')] = 'bullhorn'; + $texts['contains'][t('Unique')->render()] = 'bullhorn'; // Remove matching for strings that contain "filter": - unset($texts['contains'][t('Filter')]); + unset($texts['contains'][t('Filter')->render()]); // Change the icon that matches "Upload" (originally "upload"): - $texts['contains'][t('Upload')] = 'ok'; + $texts['contains'][t('Upload')->render()] = 'ok'; } /**