diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 0b07f54..353314a 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -444,21 +444,6 @@ function locale_cache_flush() {
 }
 
 /**
- * Implements hook_js_alter().
- */
-function locale_js_alter(&$javascript, AttachedAssetsInterface $assets) {
-  $files = array();
-  foreach ($javascript as $item) {
-    if (isset($item['type']) && $item['type'] == 'file') {
-      $files[] = $item['data'];
-    }
-  }
-  if ($translation_file = locale_js_translate($files)) {
-    $javascript[$translation_file] = drupal_js_defaults($translation_file);
-  }
-}
-
-/**
  * Returns a list of translation files given a list of JavaScript files.
  *
  * This function checks all JavaScript files passed and invokes parsing if they
@@ -527,7 +512,7 @@ function locale_js_translate(array $files = array()) {
 /**
  * Implements hook_library_info_alter().
  *
- * Provides the language support for the jQuery UI Date Picker.
+ * Provides translations and the language support for the jQuery UI Date Picker.
  */
 function locale_library_info_alter(array &$libraries, $module) {
   if ($module === 'core' && isset($libraries['jquery.ui.datepicker'])) {
@@ -537,6 +522,23 @@ function locale_library_info_alter(array &$libraries, $module) {
       'firstDay' => NULL,
     ];
   }
+
+  $files = array();
+  foreach ($libraries as $name => $library) {
+    if (isset($library['js'])) {
+      foreach ($library['js'] as $js => $js_data) {
+        $files[] = $js;
+      }
+    }
+  }
+  if ($translation_file = locale_js_translate($files)) {
+    $libraries['locale/drupal.locale.translation'] = array(
+      'dependencies' => ['drupal/drupal'],
+      'version' => 'VERSION',
+      'license' => '',
+      'js' => array(file_create_url($translation_file) => array('minified' => TRUE, 'type' => 'external')),
+    );
+  }
 }
 
 /**
