_locale_refresh_translations($langcodes, $lids = array())
Refresh related information after string translations have been updated.
The information that will be refreshed includes:
array $langcodes: Language codes for updated translations.
array $lids: (optional) List of string identifiers that have been updated / created. If not provided, all caches for the affected languages are cleared.
function _locale_refresh_translations($langcodes, $lids = array()) { if (!empty($langcodes)) { // Update javascript translations if any of the strings has a javascript // location, or if no string ids were provided, update all languages. if (empty($lids) || ($strings = \Drupal::service('locale.storage')->getStrings(array('lid' => $lids, 'type' => 'javascript')))) { array_map('_locale_invalidate_js', $langcodes); } } // Throw locale.save_translation event. \Drupal::service('event_dispatcher')->dispatch(LocaleEvents::SAVE_TRANSLATION, new LocaleEvent($langcodes, $lids)); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.module/function/_locale_refresh_translations/8.1.x