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: List of string identifiers that have been updated / created.
function _locale_refresh_translations($langcodes, $lids) {
if ($lids && $langcodes) {
// Update javascript translations if any of the strings has a javascript location.
if ($strings = locale_storage()
->getStrings(array(
'lid' => $lids,
'type' => 'javascript',
))) {
array_map('_locale_invalidate_js', $langcodes);
}
}
// Clear locale cache.
cache()
->deleteTags(array(
'locale' => TRUE,
));
}