From 10af33ad152464ef995e6b8a2b14b81637d80a5f Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 12 Mar 2014 12:15:54 -0700 Subject: [PATCH] Issue #2205157 by jibran, rteijeiro | sun: Convert locale.admin.css into a library. --- .../locale/lib/Drupal/locale/Form/TranslateEditForm.php | 4 ---- .../locale/lib/Drupal/locale/Form/TranslateFilterForm.php | 4 +--- core/modules/locale/locale.libraries.yml | 3 +++ core/modules/locale/locale.pages.inc | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php index 423aebe759..fb41d018f5 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateEditForm.php @@ -34,10 +34,6 @@ public function buildForm(array $form, array &$form_state) { $langname = isset($langcode) ? $languages[$langcode]->name : "- None -"; - $path = drupal_get_path('module', 'locale'); - $form['#attached']['css'] = array( - $path . '/css/locale.admin.css', - ); $form['#attached']['library'][] = 'locale/drupal.locale.admin'; $form['langcode'] = array( diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php index 2fd6ad6f08..213935abbb 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateFilterForm.php @@ -26,9 +26,7 @@ public function buildForm(array $form, array &$form_state) { $filters = $this->translateFilters(); $filter_values = $this->translateFilterValues(); - $form['#attached']['css'] = array( - drupal_get_path('module', 'locale') . '/css/locale.admin.css', - ); + $form['#attached']['library'][] = 'locale/drupal.locale.admin'; $form['filters'] = array( '#type' => 'details', diff --git a/core/modules/locale/locale.libraries.yml b/core/modules/locale/locale.libraries.yml index 230f1820b4..69efb02dc5 100644 --- a/core/modules/locale/locale.libraries.yml +++ b/core/modules/locale/locale.libraries.yml @@ -2,6 +2,9 @@ drupal.locale.admin: version: VERSION js: locale.admin.js: {} + css: + component: + css/locale.admin.css: {} dependencies: - core/jquery - core/drupal diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 00a27f91ee..7ab9ce0e2a 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -162,7 +162,6 @@ function locale_translation_status_form($form, &$form_state) { ); $form['#attached']['library'][] = 'locale/drupal.locale.admin'; - $form['#attached']['css'] = array(drupal_get_path('module', 'locale') . '/css/locale.admin.css'); $form['actions'] = array('#type' => 'actions'); if ($languages_update) { -- GitLab