function tacjs_library_info_build in TacJS 8.6
Same name and namespace in other branches
- 8.3 tacjs.module \tacjs_library_info_build()
- 8.4 tacjs.module \tacjs_library_info_build()
- 8.5 tacjs.module \tacjs_library_info_build()
Implements hook_library_info_build().
Add tarteaucitron translations dynamically.
File
- ./
tacjs.module, line 41 - The main file for the TacJS module.
Code
function tacjs_library_info_build() {
$libraries = [];
/** @var \Drupal\Core\File\FileSystemInterface $fileSystem */
$fileSystem = Drupal::service('file_system');
foreach ($fileSystem
->scanDirectory(drupal_get_path('module', 'tacjs') . '/assets/vendor/tarteaucitron.js/lang/', '/tarteaucitron\\.(\\w+)\\.js/') as $file) {
$libraries[$file->filename] = [
'js' => [
'/' . $file->uri => [],
],
];
}
return $libraries;
}