You are here

function i18n_string_refresh_group in Internationalization 7

Refresh all user defined strings for a given text group.

Parameters

$group: Text group to refresh

$delete: Optional, delete existing (but not refresed, strings and translations)

Return value

Boolean True if the strings have been refreshed successfully. False otherwise.

File

i18n_string/i18n_string.admin.inc, line 63
Helper functions for string administration.

Code

function i18n_string_refresh_group($group, $delete = FALSE) {
  $result = FALSE;

  // Compile all strings for this group
  if ($strings = i18n_string_group_string_list($group)) {
    i18n_string_refresh_string_list($strings);
    $result = TRUE;
  }

  // Invoke refresh hook
  $result = $result || module_invoke_all('i18n_string_refresh', $group);

  // Now delete all source strings that were not refreshed (they don't have a row in i18n_string)
  if ($result && $delete) {
    i18n_string_refresh_cleanup($group);
  }
  return $result;
}